Compare commits

..

57 Commits

Author SHA1 Message Date
kdletters 9b1e06b50a Merge branch 'master' into fix/codex-session-management
Project CI / Frontend tests (pull_request) Successful in 3m41s
Project CI / Backend tests (pull_request) Successful in 8m6s
Project CI / Repository checks (pull_request) Successful in 3m22s
Project CI / Native shell tests (pull_request) Successful in 21m49s
2026-09-03 19:30:13 +08:00
kdletters 3e034d681d 修复 master CI 的 Codex CLI 失败状态竞态 (#273)
Project CI / Frontend tests (push) Successful in 3m0s
Project CI / Backend tests (push) Successful in 6m29s
Project CI / Repository checks (push) Successful in 2m39s
Project CI / Native shell tests (push) Successful in 20m46s
修复 Codex CLI 子进程提前退出时 stdin BrokenPipe 导致未采集真实退出码的问题。\n\n- BrokenPipe 时继续等待并采集脱敏 stderr\n- 非零退出优先返回真实退出码\n- 保留其他 stdin 错误的快速失败行为\n\n已验证:Codex CLI 失败回归测试、cargo fmt、编码检查、git diff --check。

Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/273
Co-authored-by: kdletters <kdletters@qq.com>
Co-committed-by: kdletters <kdletters@qq.com>
2026-09-03 17:34:28 +08:00
k88936 0b6efd98fe Merge branch 'master' into fix/codex-session-management
Project CI / Backend tests (pull_request) Successful in 7m57s
Project CI / Native shell tests (pull_request) Successful in 21m28s
Project CI / Repository checks (pull_request) Successful in 2m41s
Project CI / Frontend tests (pull_request) Successful in 2m57s
2026-09-03 16:08:17 +08:00
suzmii d5e05d79fe 优化项目名称显示与命名链路 (#248)
Project CI / Repository checks (push) Successful in 2m49s
Project CI / Frontend tests (push) Successful in 2m45s
Project CI / Backend tests (push) Successful in 7m4s
Project CI / Native shell tests (push) Failing after 15m31s
## 优化项目名称显示与命名链路

关联:#245

按 Issue 中的需求文档实现:

- 新增项目名称修改入口,保存到本地项目 \.agent/manifest.json\
- 项目页、当前项目上下文、窗口标题在重命名后同步刷新
- 首页自动创建工作区时,根据用户输入用 LLM 提炼项目名
- LLM 命名失败或返回非法内容时,回退现有默认名,不阻断创作流程

---------

Co-authored-by: 段舒康 <kdletters@qq.com>
Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/248
Co-authored-by: suzmii <suzmii@qq.com>
Co-committed-by: suzmii <suzmii@qq.com>
2026-09-03 15:50:55 +08:00
lhk229 8b4c3792c7 主站对AGC请求头做特殊处理和记录 (#246)
Project CI / Repository checks (push) Successful in 2m43s
Project CI / Frontend tests (push) Successful in 3m26s
Project CI / Backend tests (push) Successful in 6m23s
Project CI / Native shell tests (push) Successful in 20m45s
Co-authored-by: 段舒康 <kdletters@qq.com>
Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/246
Co-authored-by: Linghong <ink29535@proton.me>
Co-committed-by: Linghong <ink29535@proton.me>
2026-09-03 15:33:26 +08:00
k88936 41b660bdc4 Merge branch 'master' into fix/codex-session-management
Project CI / Backend tests (pull_request) Successful in 7m28s
Project CI / Repository checks (pull_request) Failing after 1m8s
Project CI / Frontend tests (pull_request) Successful in 3m37s
Project CI / Native shell tests (pull_request) Failing after 18m11s
2026-09-03 13:31:41 +08:00
k88936 da1759322c 修复 DirectProject 回合上下文持久化
Project CI / Repository checks (pull_request) Failing after 13s
Project CI / Backend tests (pull_request) Failing after 9s
Project CI / Frontend tests (pull_request) Successful in 3m19s
Project CI / Native shell tests (pull_request) Has been cancelled
回合开始前幂等持久化规范化 user prompt
附件回合统一由 Rust 写入规范化历史,避免原始消息冲突
补充重启后多轮 user/assistant 历史恢复测试
同步 DirectProject replay 文档合同
2026-09-03 13:21:27 +08:00
kdletters 025f627297 新增旧玩法表阶段一清空迁移能力 (#251)
Project CI / Frontend tests (push) Successful in 3m11s
Project CI / Backend tests (push) Successful in 6m52s
Project CI / Repository checks (push) Failing after 53s
Project CI / Native shell tests (push) Failing after 17m50s
阶段一新增受 migration operator 保护的旧玩法表清空 procedure,暂不删除表定义。\n\n固定 63 张旧表,支持 dry-run 与事务 apply;生成 bindings;更新契约和决策记录;保留阶段二删表 TODO。\n\n已完成 cargo check、migration 测试、bindings/schema/encoding/diff 检查;本地 dry-run 返回 63 张表且全为 0 行,未执行 apply。

Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/251
2026-09-03 12:57:01 +08:00
k88936 ff1f77f88a Merge remote-tracking branch 'origin/master' into fix/codex-session-management
Project CI / Backend tests (pull_request) Successful in 6m8s
Project CI / Repository checks (pull_request) Successful in 2m55s
Project CI / Frontend tests (pull_request) Successful in 3m37s
Project CI / Native shell tests (pull_request) Successful in 17m5s
# Conflicts:
#	docs/project-memory/shared-memory/decision-log.md
2026-09-03 11:51:28 +08:00
k88936 e73d04db00 补充 Direct replay 有界历史设计
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 2m45s
Project CI / Native shell tests (pull_request) Successful in 19m23s
记录不可变 project.jsonl 与滑动窗口恢复约定

说明 system 标记、预算边界和超限失败语义
2026-09-03 11:44:38 +08:00
k88936 8a679d7011 实现 Direct replay 有界滑动窗口
DirectProject replay 按上下文预算保留最新连续历史

超预算时仅派生裁剪 prompt,不修改 project.jsonl

补充超大历史与当前请求超限测试
2026-09-03 11:44:29 +08:00
kdletters 8ed0626627 恢复预览环境本地配置注入
Project CI / Frontend tests (push) Successful in 3m15s
Project CI / Repository checks (push) Successful in 2m12s
Project CI / Backend tests (push) Successful in 7m31s
Project CI / Native shell tests (push) Successful in 20m0s
恢复 API 与 worker 的 .env.local BuildKit secret 挂载

补齐 Jenkins 固定文件校验与预览文档

增加双配置文件构建门禁
2026-09-03 11:38:40 +08:00
k88936 456762f569 Merge remote-tracking branch 'origin/fix/codex-session-management' into fix/codex-session-management 2026-09-03 10:44:36 +08:00
k88936 48a2723527 支持自定义Direct历史根路径 2026-09-03 10:42:29 +08:00
kdletters 53070e0390 支持 AGC 多行发布说明
Project CI / Repository checks (push) Successful in 2m31s
Project CI / Frontend tests (push) Successful in 3m10s
Project CI / Backend tests (push) Successful in 7m6s
Project CI / Native shell tests (push) Successful in 19m53s
Jenkins 参数改为多行文本输入
客户端更新提示保留换行并支持滚动
增加清单与客户端多行说明测试
同步 AGC 更新发布文档
2026-09-03 10:36:43 +08:00
suzmii 258501918f 修复 AGC 运行预览尺寸抖动 (#252)
Project CI / Repository checks (push) Successful in 2m42s
Project CI / Frontend tests (push) Successful in 3m18s
Project CI / Backend tests (push) Successful in 6m59s
Project CI / Native shell tests (push) Successful in 17m33s
## 问题

AGC 项目运行页的本地预览会根据 iframe 上报内容尺寸调整 iframe viewport;部分使用 `100vh`、百分比或响应式布局的游戏会把宿主调整后的 viewport 再反映为新的内容尺寸,形成反馈环并在两个缩放档位之间持续抖动。

附件工程和录屏已确认可触发该问题,普通浏览器直接打开不受影响。

## 落地方案

- 补充宿主 viewport 变更与真实内容变更的区分,忽略由宿主首次应用 fit 引起的回灌尺寸;
- 保留同一稳定 viewport 下真实动态内容变化后的重新适配;
- 增加反馈环收敛、动态内容变化和陈旧消息回归;
- 同步 AGC 运行预览权威文档和项目记忆。

## 验证计划

- 附件 `gameagent-2873e5ac` 在 AGC WebView 中稳定显示;
- 相关 TypeScript 单测与类型检查;
- preview Rust 定向测试;
- `npm run check:encoding`、`git diff --check`。

Fixes #250

---------

Co-authored-by: 段舒康 <kdletters@qq.com>
Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/252
Reviewed-by: 段舒康 <kdletters@qq.com>
Co-authored-by: 董羽秦 <suzmii@qq.com>
Co-committed-by: 董羽秦 <suzmii@qq.com>
2026-09-03 10:35:23 +08:00
lhk229 a465e481e3 修复 AGC 本地 BgFilter worker 启动链路 (#258)
Project CI / Repository checks (push) Successful in 3m14s
Project CI / Frontend tests (push) Successful in 3m18s
Project CI / Backend tests (push) Successful in 6m58s
Project CI / Native shell tests (push) Successful in 18m13s
backend 模式复用 Rust 双进程启动与 watcher

AGC 后端复用门禁增加 BgFilter worker readiness

补充启动编排与 ready 门禁回归测试

同步本地开发运维文档

---------

Co-authored-by: 段舒康 <kdletters@qq.com>
Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/258
Co-authored-by: Linghong <ink29535@proton.me>
Co-committed-by: Linghong <ink29535@proton.me>
2026-09-03 10:15:29 +08:00
kdletters 2079e274b6 修复 AGC 发布清单覆盖
Project CI / Repository checks (push) Successful in 3m3s
Project CI / Frontend tests (push) Successful in 3m49s
Project CI / Backend tests (push) Successful in 7m16s
Project CI / Native shell tests (push) Successful in 17m49s
强制覆盖版本安装包与 latest.json
增加 latest 上传覆盖回归检查
同步 AGC 更新发布文档
2026-09-03 10:11:29 +08:00
k88936 422c8931d6 Feat/AGC错误报告 (#240)
Project CI / Repository checks (push) Successful in 2m45s
Project CI / Frontend tests (push) Successful in 3m22s
Project CI / Backend tests (push) Successful in 5m53s
Project CI / Native shell tests (push) Successful in 16m45s
实现:
在rust内存里维护错误事件队列, webview调用tauri command传入, 后台任务agent工具等直接插入
把rust , webview console的日志统一写到AppData文件夹下的(滚动保存的)日志文件.
rust对传入的错误进行筛选,脱敏, 防抖,后通知前端提醒用户.
用户提醒是一个不阻塞的小UI, 展开后可以选择错误上报, 可以附加文字描述
上传时附带最近日志, 错误堆栈等信息

元数据存在数据库, 考虑到字符串信息很难查询, 所以在api server打包成zip存在OSS.
管理页面新增错误报告的查看页面

![shotmd-1788328504.jpg](/attachments/641b43c8-deed-47d8-8c78-36adb9a2548f)
![shotmd-1788328495.jpg](/attachments/33c6ada3-dd4d-44b6-9859-f18f944eb653)
![shotmd-1788328222.jpg](/attachments/59267df9-f624-4e47-bb9b-b69d77f595c4)
![shotmd-1788328230.jpg](/attachments/63ea6a86-9a51-412b-a98c-dce454bcc968)

---------

Co-authored-by: 段舒康 <kdletters@qq.com>
Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/240
Co-authored-by: 王德宇 <kvtodev@outlook.com>
Co-committed-by: 王德宇 <kvtodev@outlook.com>
2026-09-03 10:02:05 +08:00
k88936 1132fe5325 Merge branch 'master' into fix/codex-session-management
Project CI / Repository checks (pull_request) Successful in 2m42s
Project CI / Frontend tests (pull_request) Successful in 3m11s
Project CI / Backend tests (pull_request) Successful in 5m58s
Project CI / Native shell tests (pull_request) Successful in 17m9s
2026-09-02 20:21:20 +08:00
k88936 ea3c34beef Merge remote-tracking branch 'origin/fix/codex-session-management' into fix/codex-session-management
Project CI / Backend tests (pull_request) Failing after 9s
Project CI / Repository checks (pull_request) Failing after 15s
Project CI / Frontend tests (pull_request) Successful in 3m0s
Project CI / Native shell tests (pull_request) Successful in 18m39s
# Conflicts:
#	docs/project-memory/shared-memory/decision-log.md
2026-09-02 20:16:30 +08:00
k88936 877724d7bc 保持Direct观察器调用接口稳定
保留原有run_turn_with_direct_observer参数形状。

将历史回放参数收口到内部专用入口。
2026-09-02 20:14:53 +08:00
k88936 ae8d51500b 记录Direct回放有意设计取舍
在partial持久化处说明普通assistant与中断标记语义。

在技术方案和决策日志记录全量回放与简单前缀的设计原因。
2026-09-02 20:12:56 +08:00
k88936 8ed2f42b52 原子化Direct线程与历史回放判定
让thread_for在同一锁内返回线程是否新建。

仅新建Direct线程时读取project.jsonl并注入历史。

保持已有线程只发送当前用户消息。
2026-09-02 20:12:41 +08:00
kdletters aad9be8274 Merge pull request '移除 AGC Skill 读取工具' (#256) from fix/remove-read-skill-tool into master
Project CI / Frontend tests (push) Successful in 3m18s
Project CI / Repository checks (push) Successful in 2m37s
Project CI / Backend tests (push) Successful in 6m59s
Project CI / Native shell tests (push) Successful in 19m4s
Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/256
Reviewed-by: 段舒康 <kdletters@qq.com>
2026-09-02 20:04:59 +08:00
k88936 300ea76780 Merge branch 'master' into fix/codex-session-management
Project CI / Repository checks (pull_request) Successful in 2m26s
Project CI / Frontend tests (pull_request) Successful in 3m8s
Project CI / Backend tests (pull_request) Successful in 7m12s
Project CI / Native shell tests (pull_request) Failing after 12m58s
2026-09-02 20:03:19 +08:00
k88936 b136a7c346 删除Direct打开项目自动重发测试
Project CI / Repository checks (pull_request) Failing after 10s
Project CI / Backend tests (pull_request) Failing after 10s
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
移除已废弃的hydrated Direct回合自动恢复场景。

保留当前新发送与历史回放语义的测试覆盖。
2026-09-02 19:58:00 +08:00
k88936 b1a9a296e8 恢复Direct失败态临时回复清理
失败事件到达时清空界面中的临时回复。

保留ref中的partial供中断持久化流程使用。
2026-09-02 19:58:00 +08:00
k88936 75875a0fad 删除失效的Direct重试单测
移除已删除helper的测试导入。

删除已废弃的user-only自动重发用例。
2026-09-02 19:58:00 +08:00
k88936 1b12b7b98e 限制Direct历史回放到新线程
保留进程内thread的正常连续对话
补充中断恢复与线程重建文档
2026-09-02 19:58:00 +08:00
k88936 bb51c2716b 修正Direct聊天中断上下文恢复
删除打开项目自动重发旧消息
持久化partial并在新消息前回放完整历史
2026-09-02 19:58:00 +08:00
k88936 9e8b7d880e 让Direct Codex请求携带项目聊天历史
读取project.jsonl完整user assistant tool记录
新请求覆盖当前消息并保留ephemeral线程
2026-09-02 19:57:59 +08:00
k88936 d93dd39e23 Merge remote-tracking branch 'origin/master' into fix/remove-read-skill-tool
Project CI / Repository checks (pull_request) Successful in 3m24s
Project CI / Frontend tests (pull_request) Successful in 3m47s
Project CI / Native shell tests (pull_request) Successful in 17m20s
Project CI / Backend tests (pull_request) Successful in 7m20s
2026-09-02 19:15:44 +08:00
k88936 1e67728953 清理已移除工具名称残留
删除 unknown-tool 测试中对旧 AGC 工具名的硬编码引用
2026-09-02 19:12:38 +08:00
k88936 6fe91a169c 移除 AGC Skill 受控引用读取工具
删除 agc_read_skill_resource 的实现、MCP 暴露、审计分支与专用测试

将内置 Skill references 改为 Codex 原生相对路径读取

同步 Skill manifest 指纹、Runtime 提示词与 AGC 项目文档

保留既有 references 安装与隔离 HOME 校验
2026-09-02 19:00:31 +08:00
suzmii 8932f0b27c 修复泥点紧凑显示向上舍入 (#255)
Project CI / Repository checks (push) Successful in 2m59s
Project CI / Frontend tests (push) Successful in 3m15s
Project CI / Backend tests (push) Successful in 7m57s
Project CI / Native shell tests (push) Successful in 17m13s
## 变更内容

- 将泥点紧凑显示从四舍五入改为按一位小数向下截断;
- “万”和“亿”两个紧凑单位分支使用一致规则,不会再显示出高于实际余额的数值;
- `12,999` 由 `1.3万` 改为 `1.2万`,`19,999` 由 `2.0万` 改为 `1.9万`;
- 低于 `1万` 的完整数字显示和非紧凑模式保持不变。

## 前后对照

| 实际泥点 | 修改前 | 修改后 |
| --- | --- | --- |
| `9,999` | `9,999` | `9,999` |
| `12,999` | `1.3万` | `1.2万` |
| `19,999` | `2.0万` | `1.9万` |

## 排查范围

- 仓库内泥点紧凑缩写只有 `formatMudPointCount` 一处;
- 该函数仅包含“万”和“亿”两个单位分支,本次均已修改;
- 其它泥点展示使用完整整数,不存在同类单位舍入问题。

## 验证

- `npm run check:encoding`
- `git diff --check`
- 按需求未新增测试
- 首轮 Frontend CI 唯一失败为 `AdminEditorAssetQueryPage.test.tsx` 既有大量缩略图换签用例超时,与本次格式化改动无关;新提交已触发 CI 重跑

Closes #254

Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/255
Reviewed-by: 段舒康 <kdletters@qq.com>
Co-authored-by: suzmii <suzmii@qq.com>
Co-committed-by: suzmii <suzmii@qq.com>
2026-09-02 18:40:17 +08:00
kdletters 97b0231afc 优化 AGC 会话恢复超时与 Runner 启动校验 (#253)
Project CI / Frontend tests (push) Successful in 4m33s
Project CI / Repository checks (push) Successful in 4m48s
Project CI / Backend tests (push) Successful in 8m38s
Project CI / Native shell tests (push) Successful in 18m37s
## 变更内容

- 增加启动会话恢复阶段、等待时间和可操作错误提示。
- 为客户端 HTTP 请求增加默认超时、AbortController 取消和可选长请求豁免。
- 会话恢复失败后提供重试,并隔离旧请求的迟到结果。
- 让 Runner 启动探测严格遵守剩余启动时间预算。
- 补充前端、HTTP、Runner 定向测试并同步技术方案。

## 验证

- npm run typecheck --workspace @genarrative/ai-game-creator-shell
- npm run check:encoding
- clientHttp 定向测试
- AuthenticatedClient 定向测试
- Runner 启动探测测试
- cargo fmt --check
- git diff --check

Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/253
Co-authored-by: kdletters <kdletters@qq.com>
Co-committed-by: kdletters <kdletters@qq.com>
2026-09-02 18:15:38 +08:00
k88936 609efe805c 补充DirectProject会话恢复约定
明确ephemeral线程与AGC聊天事实源
记录partial中断标记和取消自动重发
2026-09-02 17:47:32 +08:00
k88936 5de9554426 Feat/ui编辑器与code agent整合 (#237)
Project CI / Repository checks (push) Successful in 3m36s
Project CI / Frontend tests (push) Successful in 4m30s
Project CI / Native shell tests (push) Successful in 18m33s
Project CI / Backend tests (push) Successful in 8m12s
实现:
在ui编辑器保存旁增加一个保存并生成代码(js)
生成的是js字符串形式的html, 在整个js前有文档说明
code agent使用js直接注入已经生成的 export的html片段,
每次保存会直接覆盖这些html片段, 依靠动态注入实现编辑器的微调反映到游戏中.
每个节点提供了稳定的id用于code agent在生成html的基础上进行功能实现, 节点增删

目前是作为一个自说明的文件直接让code agent阅读使用, 都是用户调整保存顺便生成, 不提供工具调用.
希望以skill的形式使用

---------

Co-authored-by: 段舒康 <kdletters@qq.com>
Co-authored-by: 孔令弘 <ink29535@proton.me>
Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/237
Co-authored-by: 王德宇 <kvtodev@outlook.com>
Co-committed-by: 王德宇 <kvtodev@outlook.com>
2026-09-02 16:49:19 +08:00
kdletters fe35fcf264 修复 AGC Windows NSIS 打包工具缓存
Project CI / Backend tests (push) Successful in 6m48s
Project CI / Repository checks (push) Successful in 2m46s
Project CI / Frontend tests (push) Successful in 3m16s
Project CI / Native shell tests (push) Successful in 15m39s
启用 Tauri 项目级 NSIS 工具缓存,避开 Jenkins systemprofile AppData。

补充 Windows 配置门禁,防止 useLocalToolsDir 回退。

增强 Jenkins 预检与失败诊断,记录实际用户和 makensis 路径。

同步 AGC 发布文档与 NSIS 排障记忆。
2026-09-02 15:24:07 +08:00
lhk229 65d7a57eb7 AGC对主站的请求添加header (#241)
Project CI / Frontend tests (push) Successful in 4m0s
Project CI / Repository checks (push) Successful in 4m4s
Project CI / Backend tests (push) Successful in 8m40s
Project CI / Native shell tests (push) Successful in 17m56s
Project CI / Frontend tests (pull_request) Successful in 5m16s
Project CI / Repository checks (pull_request) Successful in 6m57s
Project CI / Backend tests (pull_request) Successful in 6m31s
Project CI / Native shell tests (pull_request) Successful in 16m57s
Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/241
Co-authored-by: Linghong <ink29535@proton.me>
Co-committed-by: Linghong <ink29535@proton.me>
2026-09-02 14:39:01 +08:00
kdletters a75dc94f20 稳定 GDD 审批响应标识测试
Project CI / Repository checks (push) Successful in 3m2s
Project CI / Frontend tests (push) Successful in 3m46s
Project CI / Backend tests (push) Successful in 7m10s
Project CI / Native shell tests (push) Successful in 16m58s
等待审批提交按钮恢复可用后再触发重试

消除慢环境下 React 状态更新未完成导致的偶发红灯
2026-09-02 11:36:00 +08:00
kdletters 4a2f5be6c5 同步 AGC 更新下载域名门禁
Project CI / Repository checks (push) Successful in 3m2s
Project CI / Backend tests (push) Successful in 7m7s
Project CI / Frontend tests (push) Failing after 2m54s
Project CI / Native shell tests (push) Successful in 17m15s
允许受信任 OSS 更新资源域名

保持客户端更新网络范围与运行时配置一致
2026-09-02 11:14:47 +08:00
kdletters cb737cae94 修复 AGC Jenkins 空参数处理
Project CI / Repository checks (push) Successful in 3m44s
Project CI / Frontend tests (push) Successful in 4m34s
Project CI / Backend tests (push) Successful in 6m55s
Project CI / Native shell tests (push) Failing after 16m37s
COMMIT_HASH 为空时按空字符串处理

OSSUTIL_BIN 为空时按默认命令处理

补充 Windows 构建节点参数行为说明
2026-09-02 11:02:30 +08:00
kdletters eb14cec0b8 修复客户端更新代码格式
Project CI / Frontend tests (push) Successful in 4m4s
Project CI / Backend tests (push) Successful in 8m3s
Project CI / Repository checks (push) Successful in 2m48s
Project CI / Native shell tests (push) Failing after 17m21s
同步 Rust 更新下载与重启逻辑的 rustfmt 输出
2026-09-01 20:17:42 +08:00
kdletters 89e021f52b 补齐 H5 导航静态断言格式兼容
兼容原生页面 URL 调用对象被格式化拆行
2026-09-01 20:16:51 +08:00
kdletters 3e8e238286 统一原生壳静态断言格式兼容
所有源码片段断言统一兼容格式化拆行

保留严格语义匹配并归一化空白与标点
2026-09-01 20:16:51 +08:00
lhk229 b14e42d9bb AGC支持安装扩展skill、MCP (#233)
Project CI / Repository checks (push) Failing after 1m45s
Project CI / Frontend tests (push) Successful in 4m1s
Project CI / Backend tests (push) Successful in 6m55s
Project CI / Native shell tests (push) Failing after 16m22s
Co-authored-by: 段舒康 <kdletters@qq.com>
Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/233
Co-authored-by: Linghong <ink29535@proton.me>
Co-committed-by: Linghong <ink29535@proton.me>
2026-09-01 20:13:48 +08:00
kdletters a7e810b999 添加 AGC 客户端更新检查与下载能力 (#230)
Project CI / Backend tests (push) Successful in 7m40s
Project CI / Native shell tests (push) Failing after 18m53s
Project CI / Repository checks (push) Failing after 1m11s
Project CI / Frontend tests (push) Failing after 2m27s
实现 AGC 启动版本检测与 OSS 安装包下载。

- 每次客户端打开时从 OSS latest.json 检查新版本
- 新版本提示支持 releaseNotes,并通过 Tauri 命令下载到系统下载目录
- 下载地址限制受信任 OSS、HTTPS、大小与可选 SHA-256 校验
- 补充 Tauri capability/CSP、单测和发布文档

Closes #224

Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/230
2026-09-01 19:23:55 +08:00
kdletters 59a76be3c4 补齐微信认证静态断言格式兼容
Project CI / Native shell tests (push) Failing after 19m0s
Project CI / Repository checks (push) Successful in 2m57s
Project CI / Frontend tests (push) Successful in 3m24s
Project CI / Backend tests (push) Successful in 7m56s
兼容认证边界测试被格式化拆行后的源码匹配
2026-09-01 19:17:06 +08:00
kdletters a187d78a1c 修复原生壳静态断言格式兼容
Project CI / Repository checks (push) Successful in 4m5s
Project CI / Frontend tests (push) Successful in 4m59s
Project CI / Backend tests (push) Successful in 8m12s
Project CI / Native shell tests (push) Failing after 18m0s
放宽能力文档方法表的 Markdown 空白解析

统一源码片段断言的空白、括号与尾逗号归一化
2026-09-01 18:37:41 +08:00
kdletters 80f34d062d 修复原生壳能力检查换行解析
Project CI / Repository checks (push) Successful in 2m40s
Project CI / Frontend tests (push) Successful in 4m2s
Project CI / Backend tests (push) Successful in 7m43s
Project CI / Native shell tests (push) Failing after 20m9s
允许能力数组导出等号后的格式化空白
2026-09-01 17:28:30 +08:00
kdletters b489244e03 修复原生壳 CI 格式化兼容
Project CI / Frontend tests (push) Successful in 3m44s
Project CI / Repository checks (push) Successful in 3m1s
Project CI / Backend tests (push) Successful in 7m54s
Project CI / Native shell tests (push) Failing after 17m32s
放宽移动壳能力数组导出解析的空白匹配

兼容格式化后的移动壳源码断言换行

放宽桌面壳能力数组导出解析的空白匹配
2026-09-01 17:00:44 +08:00
kdletters 669405c8b8 忽略所有 Rust target 目录
Project CI / Repository checks (push) Successful in 3m35s
Project CI / Frontend tests (push) Successful in 4m21s
Project CI / Native shell tests (push) Failing after 3m19s
Project CI / Backend tests (push) Successful in 7m56s
将 target 忽略规则扩展到仓库任意层级
2026-09-01 16:30:15 +08:00
kdletters 071faa482c 统一 Rust 与 TypeScript 格式化门禁
纳入 AGC Cargo workspace 的统一 rustfmt 检查与格式化入口

完成项目 TypeScript/Prettier 与 Rust 全量格式化

修复 Pingora expected executable 门禁的空白敏感误报

同步开发运维文档与 AGC skill pack 格式化忽略规则
2026-09-01 16:28:34 +08:00
k88936 ae79d50b14 Fix/修复ui-editor调用llm与实际配置不一致 (#235)
Project CI / Repository checks (push) Successful in 2m54s
Project CI / Frontend tests (push) Successful in 4m56s
Project CI / Backend tests (push) Successful in 6m39s
Project CI / Native shell tests (push) Successful in 14m28s
复用统一的LLM调用, 原来的方法内部会默认不stream传输,
一些上游要求流式传输会出现问题

---------

Co-authored-by: 段舒康 <kdletters@qq.com>
Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/235
Co-authored-by: 王德宇 <kvtodev@outlook.com>
Co-committed-by: 王德宇 <kvtodev@outlook.com>
2026-09-01 14:35:45 +08:00
suzmii f0142f7019 Close213/215 本地资源注册与后台表查询 (#232)
Project CI / Repository checks (push) Successful in 4m8s
Project CI / Frontend tests (push) Successful in 4m52s
Project CI / Backend tests (push) Successful in 6m35s
Project CI / Native shell tests (push) Successful in 16m33s
## 关联 Issue

- Close #213:补充本地资源注册类型
- Close #215:后台表查询添加字段查询

## 背景

本 PR 合并处理两个规模较小、已完成统一 review 的客户端与后台能力改动,整体已基于远端最新 master。

## 本地资源注册(#213)

- AGC 本地项目资源支持图片、字体、音频、视频、文档和代码类型。
- 支持 PNG/JPEG/WEBP/GIF/SVG/AVIF/BMP、TTF/OTF/WOFF/WOFF2、MP3/WAV/OGG/FLAC/M4A/AAC/OPUS、MP4/WEBM/MOV,以及常见文本、配置和源码扩展名。
- 同步更新 Direct Tool Bridge、MCP schema、Runtime/Provider Prompt、AGC Skill 文档和技术方案。
- 保留项目相对路径、敏感目录、符号链接、文件大小、字体解析、UTF-8、项目锁、manifest/revision 和幂等语义。
- 修复从 game 等目录复制到 assets/uploads 时扩展名退化为 .bin 的问题。

## 后台表查询(#215)

- 使用结构化筛选条件替换手写筛选 JSON。
- 支持多条件、比较、包含、前后缀、列表、空值和旧 JSON object 兼容。
- 优化预览表格、详情复制、Toast、JSON 预览和排序交互。
- 修复数字范围筛选,包括数据库字符串化数字的数值比较。
- 补充前后端回归测试与文档。

## 验证

- AGC 本地资源导入测试:6/6
- AGC Direct/MCP 工具测试:8/8
- 本地资源扩展名与 Prompt 映射回归测试通过
- 后台 admin 数据库测试:17/17
- 后台页面 Vitest:16/16
- `npm run admin-web:typecheck`
- `npm run admin-web:build`
- `npm run check:encoding`
- `git diff --check`
- `rustfmt --edition 2024 --check server-rs/crates/api-server/src/admin.rs`

## 限制

- 未执行真实生产 SpacetimeDB、OSS 或其它付费服务验证。
- Native shell CI 及其它 PR CI 以最新 head 的远端结果为准。
- 当前 PR 保持 WIP,待 reviewer 基于最新 head 重新 review。

Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/232
Co-authored-by: 董羽秦 <suzmii@qq.com>
Co-committed-by: 董羽秦 <suzmii@qq.com>
2026-09-01 14:27:39 +08:00
2312 changed files with 36795 additions and 670931 deletions
+1 -1
View File
@@ -1 +1 @@
{"containers":[],"config":{}}
{ "containers": [], "config": {} }
+23 -11
View File
@@ -7,23 +7,33 @@ import { fileURLToPath } from 'node:url';
const scriptDir = dirname(fileURLToPath(import.meta.url));
const repoRoot = resolve(scriptDir, '..', '..');
const logDir = resolve(repoRoot, '.codex', 'logs');
const hasCodegraphConfig = existsSync(resolve(repoRoot, '.codegraph', 'config.json'));
const hasCodegraphConfig = existsSync(
resolve(repoRoot, '.codegraph', 'config.json'),
);
const npmCommand = process.platform === 'win32' ? 'cmd' : 'npm';
if (!hasCodegraphConfig) {
console.log('[codex-hook] 未发现 .codegraph/config.json,跳过 CodeGraph 同步。');
console.log(
'[codex-hook] 未发现 .codegraph/config.json,跳过 CodeGraph 同步。',
);
process.exit(0);
}
const result = spawnSync(npmCommand, process.platform === 'win32' ? ['/d', '/s', '/c', 'npm run codegraph:sync'] : ['run', 'codegraph:sync'], {
cwd: repoRoot,
shell: false,
encoding: 'utf8',
env: {
...process.env,
NO_COLOR: process.env.NO_COLOR ?? '1',
const result = spawnSync(
npmCommand,
process.platform === 'win32'
? ['/d', '/s', '/c', 'npm run codegraph:sync']
: ['run', 'codegraph:sync'],
{
cwd: repoRoot,
shell: false,
encoding: 'utf8',
env: {
...process.env,
NO_COLOR: process.env.NO_COLOR ?? '1',
},
},
});
);
mkdirSync(logDir, { recursive: true });
if (result.stdout) {
@@ -44,7 +54,9 @@ if (result.signal) {
}
if ((result.status ?? 0) !== 0) {
console.error('[codex-hook] CodeGraph 同步失败,请手动运行 npm run codegraph:sync 查看详情。');
console.error(
'[codex-hook] CodeGraph 同步失败,请手动运行 npm run codegraph:sync 查看详情。',
);
process.exit(result.status ?? 1);
}
@@ -28,16 +28,11 @@
"longDescription": "Plan, prototype, and build browser games with guided workflows for gameplay systems, UI, asset pipelines, and playtesting across 2D and 3D projects.",
"developerName": "OpenAI",
"category": "Coding",
"capabilities": [
"Interactive",
"Write"
],
"capabilities": ["Interactive", "Write"],
"websiteURL": "https://openai.com/",
"privacyPolicyURL": "https://openai.com/policies/privacy-policy/",
"termsOfServiceURL": "https://openai.com/policies/terms-of-use/",
"defaultPrompt": [
"Design a browser game and plan the core loop"
],
"defaultPrompt": ["Design a browser game and plan the core loop"],
"brandColor": "#0F766E",
"composerIcon": "./assets/game-studio.svg",
"logo": "./assets/app-icon.png",
+2 -1
View File
@@ -1,6 +1,7 @@
name: game-studio
version: 0.1.0
description: Design, prototype, and ship browser games with guided 2D and 3D workflows,
description:
Design, prototype, and ship browser games with guided 2D and 3D workflows,
asset pipelines, and playtesting support.
author: OpenAI
kind: standalone
@@ -5,19 +5,19 @@ Use this as the canonical minimal pattern for loading shipped 3D content.
## Vanilla Three.js
```ts
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
import { DRACOLoader } from "three/examples/jsm/loaders/DRACOLoader.js";
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';
const draco = new DRACOLoader();
draco.setDecoderPath("/draco/");
draco.setDecoderPath('/draco/');
const gltfLoader = new GLTFLoader();
gltfLoader.setDRACOLoader(draco);
gltfLoader.load("/assets/hero.glb", (gltf) => {
gltfLoader.load('/assets/hero.glb', (gltf) => {
const root = gltf.scene;
root.traverse((node) => {
if ("castShadow" in node) {
if ('castShadow' in node) {
node.castShadow = true;
node.receiveShadow = true;
}
@@ -29,10 +29,10 @@ gltfLoader.load("/assets/hero.glb", (gltf) => {
## React Three Fiber
```tsx
import { useGLTF } from "@react-three/drei";
import { useGLTF } from '@react-three/drei';
function HeroModel() {
const gltf = useGLTF("/assets/hero.glb");
const gltf = useGLTF('/assets/hero.glb');
return <primitive object={gltf.scene} />;
}
```
@@ -5,12 +5,14 @@ Use this as the smallest canonical pattern for adding physics without letting it
## Vanilla Three.js
```ts
import RAPIER from "@dimforge/rapier3d-compat";
import RAPIER from '@dimforge/rapier3d-compat';
await RAPIER.init();
const world = new RAPIER.World({ x: 0, y: -9.81, z: 0 });
const body = world.createRigidBody(RAPIER.RigidBodyDesc.dynamic().setTranslation(0, 2, 0));
const body = world.createRigidBody(
RAPIER.RigidBodyDesc.dynamic().setTranslation(0, 2, 0),
);
world.createCollider(RAPIER.ColliderDesc.cuboid(0.5, 0.5, 0.5), body);
renderer.setAnimationLoop(() => {
@@ -24,7 +26,7 @@ renderer.setAnimationLoop(() => {
## React Three Fiber
```tsx
import { Physics, RigidBody } from "@react-three/rapier";
import { Physics, RigidBody } from '@react-three/rapier';
<Physics gravity={[0, -9.81, 0]}>
<RigidBody colliders="cuboid">
@@ -12,7 +12,7 @@ src/
## `src/App.tsx`
```tsx
import { Canvas } from "@react-three/fiber";
import { Canvas } from '@react-three/fiber';
function Spinner() {
return (
@@ -27,7 +27,7 @@ export default function App() {
return (
<div className="app-shell">
<Canvas camera={{ position: [0, 1.5, 4], fov: 60 }}>
<color attach="background" args={["#101418"]} />
<color attach="background" args={['#101418']} />
<ambientLight intensity={0.7} />
<directionalLight position={[4, 6, 3]} intensity={1.2} />
<Spinner />
@@ -12,12 +12,17 @@ src/
## `src/main.ts`
```ts
import * as THREE from "three";
import * as THREE from 'three';
const scene = new THREE.Scene();
scene.background = new THREE.Color("#101418");
scene.background = new THREE.Color('#101418');
const camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 200);
const camera = new THREE.PerspectiveCamera(
60,
window.innerWidth / window.innerHeight,
0.1,
200,
);
camera.position.set(0, 1.5, 4);
const renderer = new THREE.WebGLRenderer({ antialias: true });
@@ -32,11 +37,11 @@ scene.add(light);
const mesh = new THREE.Mesh(
new THREE.BoxGeometry(1, 1, 1),
new THREE.MeshStandardMaterial({ color: "#3dd9b8" }),
new THREE.MeshStandardMaterial({ color: '#3dd9b8' }),
);
scene.add(mesh);
window.addEventListener("resize", () => {
window.addEventListener('resize', () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
@@ -1,4 +1,4 @@
interface:
display_name: "Game Playtest"
short_description: "Run browser-game playtests and QA"
default_prompt: "Playtest the browser game, check core interactions and visual state changes, and report concrete issues."
display_name: 'Game Playtest'
short_description: 'Run browser-game playtests and QA'
default_prompt: 'Playtest the browser game, check core interactions and visual state changes, and report concrete issues.'
@@ -1,4 +1,4 @@
interface:
display_name: "Game Studio"
short_description: "Route browser-game work to the right path"
default_prompt: "Help me choose the right browser-game stack and workflow before implementation starts."
display_name: 'Game Studio'
short_description: 'Route browser-game work to the right path'
default_prompt: 'Help me choose the right browser-game stack and workflow before implementation starts.'
@@ -1,4 +1,4 @@
interface:
display_name: "Game UI Frontend"
short_description: "Design browser-game HUDs, menus, and overlays"
default_prompt: "Design a browser-game UI layer that supports the play experience without crowding the playfield."
display_name: 'Game UI Frontend'
short_description: 'Design browser-game HUDs, menus, and overlays'
default_prompt: 'Design a browser-game UI layer that supports the play experience without crowding the playfield.'
@@ -1,4 +1,4 @@
interface:
display_name: "Phaser 2D Game"
short_description: "Build 2D browser games with Phaser"
default_prompt: "Implement this 2D browser game with Phaser, TypeScript, and a clear gameplay architecture."
display_name: 'Phaser 2D Game'
short_description: 'Build 2D browser games with Phaser'
default_prompt: 'Implement this 2D browser game with Phaser, TypeScript, and a clear gameplay architecture.'
@@ -1,4 +1,4 @@
interface:
display_name: "React Three Fiber Game"
short_description: "Build React-hosted 3D browser games"
default_prompt: "Build this 3D browser game with React Three Fiber and keep the 3D runtime aligned with the React app shell."
display_name: 'React Three Fiber Game'
short_description: 'Build React-hosted 3D browser games'
default_prompt: 'Build this 3D browser game with React Three Fiber and keep the 3D runtime aligned with the React app shell.'
@@ -1,4 +1,4 @@
interface:
display_name: "Sprite Pipeline"
short_description: "Generate and normalize 2D sprite animations"
default_prompt: "Create and normalize 2D sprite animation assets for a browser game with consistent scale and anchors."
display_name: 'Sprite Pipeline'
short_description: 'Generate and normalize 2D sprite animations'
default_prompt: 'Create and normalize 2D sprite animation assets for a browser game with consistent scale and anchors.'
@@ -1,4 +1,4 @@
interface:
display_name: "Three WebGL Game"
short_description: "Build browser-game runtimes with Three.js"
default_prompt: "Implement this browser-game runtime with plain Three.js and keep the scene architecture easy to debug."
display_name: 'Three WebGL Game'
short_description: 'Build browser-game runtimes with Three.js'
default_prompt: 'Implement this browser-game runtime with plain Three.js and keep the scene architecture easy to debug.'
@@ -1,4 +1,4 @@
interface:
display_name: "Web 3D Asset Pipeline"
short_description: "Prepare and optimize browser-game 3D assets"
default_prompt: "Prepare these browser-game 3D assets for shipping as predictable runtime-ready GLB or glTF files."
display_name: 'Web 3D Asset Pipeline'
short_description: 'Prepare and optimize browser-game 3D assets'
default_prompt: 'Prepare these browser-game 3D assets for shipping as predictable runtime-ready GLB or glTF files.'
@@ -1,4 +1,4 @@
interface:
display_name: "Web Game Foundations"
short_description: "Set browser-game architecture before implementation"
default_prompt: "Establish the core architecture for this browser game before implementation starts."
display_name: 'Web Game Foundations'
short_description: 'Set browser-game architecture before implementation'
default_prompt: 'Establish the core architecture for this browser game before implementation starts.'
@@ -5,7 +5,13 @@ license: MIT
metadata:
codex:
tags: [BDD, Gherkin, 验收标准, 用户故事, 测试, Genarrative]
related_skills: [writing-plans, test-driven-development, systematic-debugging, requesting-code-review]
related_skills:
[
writing-plans,
test-driven-development,
systematic-debugging,
requesting-code-review,
]
---
# BDD 行为驱动开发流程
@@ -218,14 +224,14 @@ Feature: Work publish permission
## 映射到测试类型
| BDD 场景关注点 | 推荐测试层级 | 示例 |
| --- | --- | --- |
| 纯领域规则、状态机、校验 | Rust/TS 单元测试 | reducer、module-*、schema validator |
| DTO 契约、API 请求响应 | API/contract 测试 | Axum handler、shared-contracts serde |
| 页面渲染、按钮状态、表单校验 | 组件测试 | Vitest + Testing Library |
| 路由、tab、页面阶段切换 | 前端集成测试 | appPageRoutes、FlowShell 行为 |
| 登录态、发布、运行态完整链路 | E2E/smoke | Playwright 或项目 smoke 脚本 |
| 埋点、副作用、后台导出 | 后端集成/API 测试 | tracking event、admin export |
| BDD 场景关注点 | 推荐测试层级 | 示例 |
| ---------------------------- | ----------------- | ------------------------------------ |
| 纯领域规则、状态机、校验 | Rust/TS 单元测试 | reducer、module-\*、schema validator |
| DTO 契约、API 请求响应 | API/contract 测试 | Axum handler、shared-contracts serde |
| 页面渲染、按钮状态、表单校验 | 组件测试 | Vitest + Testing Library |
| 路由、tab、页面阶段切换 | 前端集成测试 | appPageRoutes、FlowShell 行为 |
| 登录态、发布、运行态完整链路 | E2E/smoke | Playwright 或项目 smoke 脚本 |
| 埋点、副作用、后台导出 | 后端集成/API 测试 | tracking event、admin export |
原则:
@@ -255,8 +261,8 @@ describe('帮助与反馈入口', () => {
// Given ...
// When ...
// Then ...
})
})
});
});
```
Rust 测试命名建议:
@@ -276,13 +282,13 @@ fn anonymous_user_cannot_publish_generated_draft() {
### Gherkin/BDD 场景默认落点
| 产物类型 | 推荐路径 | 适用场景 |
| --- | --- | --- |
| 实施前分析 / 临时计划 | 当前任务说明或 `.tmp/<task-name>-bdd-scenarios.md` | 某次 Codex 开发任务前,用于澄清行为、拆测试、辅助实现;不作为长期产品依据。 |
| 正式产品验收 / PRD 场景 | 当前 `docs/` 融合文档,必要时新增 `docs/【产品验收】<功能名>BDD场景-YYYY-MM-DD.md` | 产品、测试、开发都需要长期参考的验收标准、用户故事、功能边界。 |
| 技术/API/领域行为场景 | 当前 `docs/` 融合文档,必要时新增 `docs/【技术验收】<功能名>BDD场景-YYYY-MM-DD.md` | 后端 API、领域规则、状态机、SpacetimeDB reducer/table、SSE/异步任务、埋点副作用。 |
| 自动化 Gherkin feature 文件 | `tests/features/*.feature``e2e/features/*.feature` | 项目已接入 Cucumber/Playwright BDD 等 Gherkin runner 时。未接入前不要随意新建测试 runner 目录。 |
| 稳定流程或团队经验 | `docs/project-memory/shared-memory/``.codex/skills/` | 不是某个功能验收,而是长期可复用的团队流程、坑点、执行规范。 |
| 产物类型 | 推荐路径 | 适用场景 |
| --------------------------- | ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| 实施前分析 / 临时计划 | 当前任务说明或 `.tmp/<task-name>-bdd-scenarios.md` | 某次 Codex 开发任务前,用于澄清行为、拆测试、辅助实现;不作为长期产品依据。 |
| 正式产品验收 / PRD 场景 | 当前 `docs/` 融合文档,必要时新增 `docs/【产品验收】<功能名>BDD场景-YYYY-MM-DD.md` | 产品、测试、开发都需要长期参考的验收标准、用户故事、功能边界。 |
| 技术/API/领域行为场景 | 当前 `docs/` 融合文档,必要时新增 `docs/【技术验收】<功能名>BDD场景-YYYY-MM-DD.md` | 后端 API、领域规则、状态机、SpacetimeDB reducer/table、SSE/异步任务、埋点副作用。 |
| 自动化 Gherkin feature 文件 | `tests/features/*.feature``e2e/features/*.feature` | 项目已接入 Cucumber/Playwright BDD 等 Gherkin runner 时。未接入前不要随意新建测试 runner 目录。 |
| 稳定流程或团队经验 | `docs/project-memory/shared-memory/``.codex/skills/` | 不是某个功能验收,而是长期可复用的团队流程、坑点、执行规范。 |
默认规则:
@@ -313,15 +319,17 @@ e2e/features/invite-code.feature
BDD 文档建议包含:
```markdown
````markdown
# <功能名> BDD 验收场景
## 背景
- 需求来源:
- 相关文档:
- 相关入口/接口:
## 角色与目标
- 角色:
- 目标:
- 非目标:
@@ -336,16 +344,19 @@ BDD 文档建议包含:
当 ...
那么 ...
```
````
## 测试映射
| 场景 | 测试层级 | 目标文件 | 状态 |
| --- | --- | --- | --- |
| ... | component | ... | planned |
| 场景 | 测试层级 | 目标文件 | 状态 |
| ---- | --------- | -------- | ------- |
| ... | component | ... | planned |
## 开放问题
- ...
```
````
注意:上面的 Markdown 模板中如果嵌套代码块,需要在真实文档里调整围栏长度,避免代码块提前闭合。
@@ -384,7 +395,7 @@ BDD 文档建议包含:
npm run check:encoding
npm run typecheck
npm run test -- --run <相关测试文件>
```
````
- [ ] 若涉及后端 Rust/API,按相关 DDD/SpacetimeDB 文档运行对应 cargo/npm/API smoke 验证。
- [ ] 若产生长期有效经验,已同步到 `docs/project-memory/shared-memory/` 或合适的仓库级 skill。
@@ -4,7 +4,17 @@ description: 在 Genarrative/陶泥儿后台新增或修改管理页、后台 BF
license: MIT
metadata:
codex:
tags: [Genarrative, 陶泥儿后台, admin-web, 后台接口, Excel导出, Rust, Axum, SpacetimeDB]
tags:
[
Genarrative,
陶泥儿后台,
admin-web,
后台接口,
Excel导出,
Rust,
Axum,
SpacetimeDB,
]
related_skills: [genarrative-play-type-integration]
---
@@ -206,6 +216,7 @@ npm install
3. `cargo fmt --all` 可能格式化不相关 Rust 文件;提交前用 `git status` 检查并 revert 非本任务文件。
4. patch 工具对 Rust 单文件 lint 可能用 Rust 2015 edition 误报 `async fn is not permitted in Rust 2015`;以 `cargo test/check` 为准。
5. `adminRoutes` 新增 route id 后,`AdminShell.routeIcons` 必须同步,否则 TypeScript 会因 `satisfies Record<AdminRouteId, ...>` 报错。
- 后台页面中的中文和 JSON 预览要避免整文件重写导致编码问题;修改后运行 `npm run check:encoding`
- 后台数据页移动端要保证表格横向滚动,不要让整页布局撑坏。
- 若用户追问“之前不是说要把 npm run dev 修好吗”这类已承诺的 dev 启动问题,不要只解释;先复现 `npm run dev`,再按启动日志修脚本并验证到服务就绪。WSL/Linux 下本地开发应走 `spacetime start --data-dir=server-rs/.spacetimedb/local/data` 这一类数据目录隔离,不再用项目级 `--root-dir`,详见 `references/dev-rust-stack-startup-2026-05-08.md`
@@ -1,10 +1,12 @@
# 本次后台表查询接入的可复用经验
## 需求落点
- 后台“总览”页的表统计仍保留,只把每张表的表名改成可点击跳转到 `#tables?table=<name>`
- 新增独立 `#tables` 页承载表选择、关键词搜索、JSON filters、limit、行详情弹窗
- 新增独立 `#tables` 页承载表选择、关键词搜索、结构化字段筛选、limit、行详情弹窗(详情内保留字段复制,列头漏斗按钮可按列添加条件;每条条件可勾选启用或停用,停用时保留字段和值;`in` / `notIn` 使用逐项值标签,支持粘贴多行值,逗号不再作为隐式分隔符)
## 后端实现要点
- 新增只读接口:
- `GET /admin/api/database/tables`
- `GET /admin/api/database/tables/{table_name}/rows`
@@ -13,17 +15,20 @@
- `search` / `filters` 不进入 SQL 字符串:
- SQL 只负责 `SELECT * FROM {table_name} LIMIT {limit}`
- 返回后在 api-server 内存中过滤
- `filters` 接受 JSON object,按列名匹配;非 object 直接 400
- `filters` 接受两种 JSON 形式:object(列名到等值,如 `{"user_id":"u1"}`)与条件数组(如 `[{"column":"points","op":"gt","value":"5"}]`,运算符含 `eq``ne``gt``gte``lt``lte``contains``notContains``startsWith``endsWith``in``notIn``isEmpty``isNotEmpty`,允许同列多条件,条件间为 AND;非 object 且非数组直接 400,未知运算符或 value 形态不匹配也 400。数组中的 `eq` / `ne` 和其他标量运算符一样必须提供 `value`;显式空值判断使用 `isEmpty` / `isNotEmpty`
- SpacetimeDB HTTP SQL 返回可能是 statement array + rows,解析时要兼容这一层结构。
## 前端实现要点
- `adminRoutes` 必须新增 `tables``AdminShell.routeIcons` 也要同步覆盖。
- `AdminApp` 需要显式渲染 `AdminDatabaseTablesPage`
- 预览表格数据行直接点击(或行自身聚焦后按 Enter / Space)打开详情,行内按钮 / 输入控件的键盘操作不冒泡打开详情;详情按钮不单独占列。详情字段仅提供复制操作,成功、剪贴板失败和空字段复制都使用右下角自动消失的 Toast,JSON 预览与平台亮色 / 暗色主题保持一致,表头保持单行并在空间不足时省略显示。表单和标题区查询按钮共用筛选完整性校验。
- worktree 下可能没有本地 `node_modules/typescript/bin/tsc`,而根目录有依赖;在验证前可以临时把根目录 `node_modules` 软链到 worktree 再执行 `npm run admin-web:typecheck`,验证后删除软链,避免污染 git 状态。
## 验证结果
- `cargo test -p api-server admin_database -- --nocapture` 通过。
- `cargo fmt --manifest-path Cargo.toml -p api-server -p shared-contracts --check` 通过。
- `npm run admin-web:typecheck` 通过。
- `npm run admin-web:build` 通过。
- `npm run check:encoding` 通过。
- `npm run check:encoding` 通过。
@@ -1,6 +1,7 @@
# `npm run dev` / `scripts/dev-rust-stack.sh` 启动修复记录
## 症状
- 多个 worktree 同时本地开发时,SpacetimeDB 数据库名可能相同,早期曾用项目级 CLI root 隔离 CLI 状态来规避冲突。
- 实测后确认:真正需要隔离的是 standalone 的 `data-dir`,不需要把 publish 也绑到项目级 CLI root。
- 早期脚本曾通过把用户级 SpacetimeDB 可执行文件目录同步到 `server-rs/.spacetimedb/local/bin/current` 来满足 standalone 回调需求,但这会把整套可执行文件复制进项目本地目录,维护成本高,也容易和用户级 CLI 版本漂移。
@@ -9,6 +10,7 @@
- `api-server` 首次冷编译时,默认 300 秒超时不够,容易在就绪前被回收。
## 当前方案
1. SpacetimeDB 可执行文件继续使用用户环境里的 `spacetime` 命令
- 启动 standalone 时不再复制 `spacetimedb-cli`、版本目录或 `bin/current`
- `spacetime start` 不再通过工程内 CLI root 寻找可执行文件。
@@ -29,6 +31,7 @@
- `API_SERVER_TIMEOUT_SECONDS` 保持 600,降低首次冷编译误判失败概率。
## 复现 / 验证
- 运行脚本语法检查:`bash -n scripts/dev-rust-stack.sh`
- 运行帮助检查:`bash scripts/dev-rust-stack.sh --help`,确认有 `--spacetime-data-dir`
- 运行 `npm run dev` 后观察日志:
@@ -41,6 +44,7 @@
- api-server 进入健康检查等待并最终可访问 `/healthz`
## 相关文件
- `scripts/dev-rust-stack.sh`
- `server-rs/.spacetimedb/local/data/`
- `server-rs/.cargo/config.toml`
@@ -1,28 +1,34 @@
# 本地 private table SQL 权限修复
场景:
- 后台或 api-server 通过 SpacetimeDB HTTP SQL 读取 `tracking_event` 这类 private table。
- 本地清库、重建 standalone 或重新发布模块后,原 CLI token 失效,SQL 可能报 `no such table ... If the table exists, it may be marked private`
操作步骤:
1. 清空本地 SpacetimeDB 数据目录
- 使用项目脚本停止本地实例后,备份或删除 `server-rs/.spacetimedb/local/data`
- 只清本地开发环境,不要误伤远端或其他 worktree。
2. 启动本地 standalone
- 用项目约定的 `scripts/dev-rust-stack.sh` 或等价命令启动 `spacetime`
- 确认 `/v1/ping` 可访问后再取 identity。
3. 通过 `/v1/identity` 获取新 token 和 identity
- 使用 `POST http://127.0.0.1:3101/v1/identity`
- 只记录 identity,不要在日志中打印 token 明文。
4. 用新 token 登录 CLI
- 运行:`spacetime login --token <token>`
- 这会把 token 写到本地 CLI 配置,后续 HTTP SQL 可读 private table。
5. 重新验证 SQL
- 使用带 token 的 `POST /v1/database/<db>/sql`
- 先尝试 `SELECT ... FROM tracking_event LIMIT 1`
- 若成功,再让 api-server 走同样 token。
@@ -32,6 +38,7 @@
- 输出日志时统一 `[REDACTED]`
排查要点:
- `ORDER BY` 和 private table 是两个独立问题,先分开修。
- 清库后旧 token 很可能不再能看见 private table,不代表表不存在。
-`/v1/identity` 返回的 token 没权限,再检查当前 standalone 是否就是刚启动的本地实例、database 名是否一致、模块是否已重新发布。
@@ -4,8 +4,14 @@ description: 在 Genarrative 中排查或修改登录、access token、refresh c
license: MIT
metadata:
codex:
tags: [Genarrative, auth, session, cookie, refresh-token, AuthGate, tracking]
related_skills: [systematic-debugging, test-driven-development, genarrative-profile-features]
tags:
[Genarrative, auth, session, cookie, refresh-token, AuthGate, tracking]
related_skills:
[
systematic-debugging,
test-driven-development,
genarrative-profile-features,
]
---
# Genarrative 认证会话与登录埋点链路
@@ -4,7 +4,16 @@ description: 在 Genarrative 中修改 npm run dev / dev:spacetime / dev:api-ser
license: MIT
metadata:
codex:
tags: [Genarrative, dev-stack, 端口探测, Vite, api-server, SpacetimeDB, npm-run-dev]
tags:
[
Genarrative,
dev-stack,
端口探测,
Vite,
api-server,
SpacetimeDB,
npm-run-dev,
]
related_skills: [genarrative-admin-backoffice]
---
@@ -1,6 +1,6 @@
interface:
display_name: "Genarrative External Editor API"
short_description: "Route async canvas generation safely"
default_prompt: "Use $genarrative-external-editor-api to discover the hosted integration, prepare a canvas session, and submit and poll asset generation into the canvas and library."
display_name: 'Genarrative External Editor API'
short_description: 'Route async canvas generation safely'
default_prompt: 'Use $genarrative-external-editor-api to discover the hosted integration, prepare a canvas session, and submit and poll asset generation into the canvas and library.'
policy:
allow_implicit_invocation: true

Some files were not shown because too many files have changed in this diff Show More