Commit Graph

5830 Commits

Author SHA1 Message Date
k88936 325466d9b4 feat(会员): AGC 模型目录新增权限档与按档过滤能力
- 新增 agc_model_access.rs:AgcModelAccess(basic/full,缺省 basic 失败开放)、越权错误码 MODEL_NOT_AVAILABLE_FOR_PLAN、AgcModelResolveError,以及会员档位到模型权限档的映射
- AgcModel 末位追加 #[serde(default)] access,存量目录 JSON 缺字段按 basic 解析
- AgcModelCatalog 新增 available_models_for / default_model_id_for / resolve_requested_for:显式越权不静默回退,默认模型优先登记项、不可用时回退目录顺序首个可用项
- 覆盖缺省解析、档位过滤、越权与未知模型区分、无可用模型等纯函数测试
2026-10-04 13:28:13 +08:00
k88936 56708988ed docs(会员): 补 §11.4 实现落点,钉死模型权限与并发的编码约定
- 新增 §11.4:module-runtime 的 AgcModelAccess / 解析错误、spacetime-module 的 (owner_user_id, status) 索引与认领过滤、api-server 的档位解析与 403 错误码、后台 access 字段
- 明确默认模型语义:登记默认项优先,不在该档可用集合里时回退目录顺序首个可用项
- 记录本期复用 get_profile_recharge_center 解析档位的性能 TODO
2026-10-04 13:28:13 +08:00
k88936 cbe6697d03 docs(会员): 定案模型权限与并发上限的服务端强制边界
- 新增 ADR「模型权限与并发上限的强制边界」:并发只在认领事务按账号过滤 running job、模型档缺省 Basic、直连同步生成暂不计入
- 技术设计新增 §11,承接并作废 §9/§10 的「只落字段、不拦截」表述
- CONTEXT 修订「模型权限」「并发上限」词条,新增「独立生成任务」
- docs/README 与 decision-log 登记本 ADR 与拷问定案
2026-10-04 13:28:09 +08:00
k88936 65b9821d25 Merge remote-tracking branch 'origin/master' into feat/pricing-plan
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
# Conflicts:
#	docs/project-memory/shared-memory/decision-log.md
2026-10-04 13:27:20 +08:00
k88936 a6fb2f01c1 Merge pull request 'Feat/游玩计数' (#604) from feat/play-count-with-cache into master
Project CI / AI game creator shell Rust crates (push) Successful in 3m8s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 4m44s
Project CI / AI game creator shell Rust lane 1/2 (push) Successful in 6m7s
Project CI / Backend tests (push) Successful in 7m12s
Project CI / Frontend tests (push) Successful in 3m3s
Project CI / Native shell tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
Project CI / AI game creator shell web tests (push) Has been cancelled
Reviewed-on: #604
2026-10-04 13:21:04 +08:00
k88936 9d7ca1b3b7 文档(会员目录):明确懒播种策略与只读入口首次写库的副作用
- ensure_default_profile_membership_plan 注释说明 init 与读取 helper 共用、目录空时首次读取会写库
- init_profile_membership_plan_catalog 注释改为不覆盖「表已存在但为空」的存放量库
- 报价与建单注释去掉「不写库」的绝对说法,注明目录空时的懒播种例外
- 同步设计文档 7 / 10.2 与决策日志(播种策略定为保留懒播种 + 明示副作用)
2026-10-04 13:20:06 +08:00
k88936 fdf636ce95 补充(会员错误):兑换码链路留 TODO 接入 typed error
- is_runtime_profile_redeem_code_domain_error 顶部注明仍靠中文文案匹配判 400
- 指明后续按 RuntimeProfileMembershipErrorCode + ProcedureRejected 的做法改造
2026-10-04 13:19:42 +08:00
k88936 9ce43071ad Add gamePlayClientId.ts to module and test exclusions
Project CI / AI game creator shell Rust crates (pull_request) Successful in 3m14s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m54s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 6m0s
Project CI / Backend tests (pull_request) Successful in 6m54s
Project CI / Frontend tests (pull_request) Successful in 2m54s
Project CI / Native shell tests (pull_request) Successful in 6m47s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m8s
Project CI / Repository checks (pull_request) Successful in 5m9s
2026-10-04 12:53:17 +08:00
k88936 68c8544a15 类型化(会员错误):会员业务拒绝改用机器可读 error_code
- module-runtime 新增 RuntimeProfileMembershipErrorCode 与 RuntimeProfileMembershipDomainError
- 会员报价 / 充值中心 / 后台档位 upsert 的 procedure 结果末尾追加 error_code
- spacetime-module 在拒绝点显式赋码,中文 error_message 逐字保持不变
- spacetime-client 新增 SpacetimeClientError::ProcedureRejected 并映射生成绑定
- api-server 删除会员中文前缀分类,改按 error_code 返回 400,基础设施错误仍 502
- 重生成 module_bindings,并同步设计文档 5.8 与决策日志
2026-10-04 12:41:26 +08:00
k88936 ff83b67196 Merge branch 'master' into feat/play-count-with-cache
Project CI / AI game creator shell Rust crates (pull_request) Successful in 3m7s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m20s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m28s
Project CI / Backend tests (pull_request) Successful in 7m46s
Project CI / Frontend tests (pull_request) Successful in 3m55s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m18s
Project CI / Native shell tests (pull_request) Successful in 8m37s
Project CI / Repository checks (pull_request) Failing after 6m40s
2026-10-04 12:08:32 +08:00
k88936 75766824f6 文档(会员计费):同步 granted_points_delta 改 u64 与 wire token 枚举
- membership_granted_points_delta 列类型文档由 i64 更新为 u64
- 补充 shared-contracts 新增四个会员 wire token 枚举及其与模块枚举的映射说明
2026-10-04 11:59:05 +08:00
k88936 57e259278d Merge remote-tracking branch 'origin/master' into feat/play-count-with-cache
Project CI / Backend tests (pull_request) Failing after 36s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m28s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 6m41s
Project CI / Repository checks (pull_request) Failing after 15s
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
# Conflicts:
#	docs/project-memory/shared-memory/decision-log.md
2026-10-04 11:58:25 +08:00
k88936 d7dec9b475 枚举化(会员后台):档位与模型权限请求字段改用 typed enum
- AdminUpsertProfileMembershipPlanRequest.plan/model_access 由 String 改为 token 枚举
- 未登记的档位 / 权限 token 在反序列化阶段直接拒绝,后台不能再持久化任意字符串
- admin handler 去掉字符串解析分支,改为 From 转换
- 删除仅用于手写解析的 parse_runtime_profile_membership_* 辅助函数
2026-10-04 11:46:08 +08:00
kdletters 13a15fed5c 修复 AGC 渠道更新互相终止与快捷方式迁移
Project CI / AI game creator shell Rust crates (push) Successful in 3m5s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 4m24s
Project CI / AI game creator shell Rust lane 1/2 (push) Successful in 5m20s
Project CI / Backend tests (push) Successful in 6m42s
Project CI / Frontend tests (push) Successful in 3m2s
Project CI / Native shell tests (push) Successful in 7m16s
Project CI / AI game creator shell web tests (push) Successful in 3m17s
Project CI / Repository checks (push) Successful in 6m25s
为 release 与自定义渠道注入独立主程序名,隔离 Windows 更新进程。

新增 release 旧安装目录与快捷方式迁移钩子,保护 dev 历史目录清理。

同步渠道规范、共享决策与排障记录,补充发布脚本回归测试。
2026-10-04 11:45:20 +08:00
k88936 c660ca41fe 枚举化(会员):快照与报价/档位响应改用 typed enum
- shared-contracts 新增 ProfileMembershipPlan/CycleKind/ModelAccess/ChangeKind Token 枚举
- RuntimeProfileMembershipOrderChangeSnapshot 与 UpgradeQuoteRecord 档位/周期改用模块枚举
- AdminMembershipOrderChangePayload、ProfileMembership/Plan/UpgradeQuote Response 改用 token 枚举
- module-runtime 提供模块枚举与 wire token 的双向 From 映射
- api-server / spacetime-client / spacetime-module 同步去掉 as_str().to_string() 拼装
- 重生成 SpacetimeDB 绑定:订单变更快照字段改为枚举
2026-10-04 11:43:57 +08:00
k88936 08020e664b 文档:同步客户端 IP 只信 X-Real-IP
- ADR:身份与去重键节写明 IP 取 nginx 覆盖的 X-Real-IP、XFF 只取末段,并追加 2026-10-04 修订记录
- 玩法链路:去重与限流节标注 IP 来源
- decision-log:2026-10-04 条目补安全修正说明与标题
2026-10-04 11:39:00 +08:00
k88936 95705cbb11 后端:客户端 IP 只信 X-Real-IP,不再取 XFF 首段
- request_context.rs:client_ip_from_headers 改为优先 nginx 覆盖写入的 x-real-ip,x-forwarded-for 只作回退且取最后一段(nginx 用 $proxy_add_x_forwarded_for 追加的真实对端),不再信任可伪造的首段
- 影响两个调用方:公开游玩上报的匿名身份与 IP+game 限流键、微信支付下单的 payer_client_ip
- 更新测试:X-Real-IP 优先、XFF 回退取末段、空 X-Real-IP 回退与回环兜底
2026-10-04 11:38:47 +08:00
k88936 1744262b0b 对齐(会员订单):granted_points_delta 全链路 i64 改 u64
- profile_recharge_order.membership_granted_points_delta 列由 i64 改为 u64
- RuntimeProfileMembershipOrderChangeSnapshot 与 AdminMembershipOrderChangePayload 同步改 u64
- 删除 snapshot/order 之间的 as i64 与 try_from 兜底转换
- 重生成 SpacetimeDB 绑定:profile_recharge_order、订单变更快照
2026-10-04 11:23:21 +08:00
k88936 168028d5e5 修正(会员账期):期号水位缺失不再被当成换期重发额度
- advance_profile_membership_cycle_to 只在 cycle_resets_at 缺失时判定需要初始化写库
- cycle_index == 0(新列默认值)只补写期号水位,不重置 cycle_granted/remaining_points
- 补测试覆盖 cycle_index=0 且账期窗口已存在时保留本期余额
2026-10-04 11:21:42 +08:00
k88936 c0148dda7e 文档:同步游玩计数关停不强制 flush 与失败丢弃口径
- ADR:修订「正常关停必须 force flush」为关停不做强制 flush,并补充 flush 任一分片失败即丢弃剩余分片;追加修订记录
- 玩法链路:缓冲与延迟改为崩溃/被杀/正常关停都允许丢一个窗口;限流节补充先做内存预检;写入语义补充失败丢弃口径
- decision-log:顶部新增 2026-10-04 修订条目,并给 2026-10-03 条目标注失效项
- docs/README:ADR 摘要去掉「关停 flush」
2026-10-04 11:13:55 +08:00
k88936 28ac8a1037 后端:游玩计数 flush 失败后直接丢弃剩余分片
- game_play_counter_worker.rs:任一分片失败即停止本次 flush,不再为后续分片逐个重建连接(连接不通时每片都会各自等一次超时)
- Build(确定未发出)仍放回本批,剩余分片直接丢弃;其余错误连本批一起丢弃,并记录丢弃增量
- 补 total_delta 汇总剩余增量,模块文档写明失败即停止与丢弃口径
2026-10-04 11:10:03 +08:00
k88936 75ad087e2c 后端:关停不再强制 flush 游玩计数
- main.rs:finalize_shutdown 删除游戏游玩计数强制 flush,关停不再为它等待网络,内存里剩余增量随进程结束丢弃
- game_play_counter_worker.rs:删除 flush_game_play_counter_for_shutdown,flush_deltas 去掉 requeue_on_build 参数(关停路径已不存在),Build 仍放回等待下一轮
- game_play_counter.rs:take_pending 标记为仅测试使用,模块文档改指 take_pending_if_due
2026-10-04 11:07:02 +08:00
k88936 3f0a77e65e 后端:游玩上报先做内存限流预检再查库
- game_play_counter.rs:新增只读 is_rate_limited,不消耗额度也不改状态
- modules/game_distribution.rs:record_game_play 先做内存限流预检,超限直接 429,不再让这些请求也打一次 SpacetimeDB;真正计数时 record 仍会重新判定
- 补预检只读与固定窗口作用域测试
2026-10-04 11:04:52 +08:00
suzmii f689b97d8a Merge pull request '修复 AGC 画布素材卡「引用」无消费者:新增活跃聊天输入区注册表(Issue #602)' (#605) from fix/agc-canvas-reference-insert into master
Project CI / AI game creator shell Rust crates (push) Successful in 3m2s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 4m17s
Project CI / AI game creator shell Rust lane 1/2 (push) Successful in 5m36s
Project CI / Backend tests (push) Successful in 6m51s
Project CI / Frontend tests (push) Successful in 3m5s
Project CI / Native shell tests (push) Successful in 6m47s
Project CI / AI game creator shell web tests (push) Successful in 3m0s
Project CI / Repository checks (push) Successful in 5m5s
Reviewed-on: #605
2026-10-04 10:48:19 +08:00
k88936 4a2594a90c 修正(会员支付):微信虚拟支付只接受在售且可购买的档位
- build_wechat_virtual_pay_params 的档位校验补齐 enabled 与 is_purchasable
- 与 resolve_enabled_profile_recharge_order_product 的可售判定对齐,拒绝 Normal 占位与下架档位
2026-10-04 10:35:01 +08:00
k88936 44feb7b0f5 修正(会员后台):缺少目录档位时不再回退 rank 0
- upsert 解析 rank 失败改为显式报错,避免与 Normal 占位同档
- 与 module-runtime 用 Option 暴露缺失档位的契约保持一致
2026-10-04 10:33:58 +08:00
k88936 cc30d8ba7a 修正(会员账期):beijing_local_micros 改用 checked 运算
- 年份导致微秒溢出时返回 None,符合函数文档,不再饱和成看似合法的值
- 补测试覆盖 i64 溢出年份返回 None
2026-10-04 10:33:55 +08:00
k88936 b0b1e2519e 文档(日历):注明 civil_from_days 的合法输入范围与饱和行为
- 说明极端日序号会饱和并给出无意义日期,要求调用方保证输入范围
2026-10-04 10:33:52 +08:00
k88936 e855c52d7f 文档(假数据脚本):注明不限并发哨兵对应的后端常量路径
- 在注释里给出 limits.rs 与 MEMBERSHIP_UNLIMITED_CONCURRENCY 定义,便于后端改动时同步
2026-10-04 10:33:15 +08:00
k88936 582a329468 修正(会员弹层):支付方式静态文案去掉 radiogroup/radio 语义
- 微信支付是纯展示的单一选项,不可交互的 radio 会误导读屏
- 改为普通文本容器,视觉样式不变
2026-10-04 10:33:04 +08:00
k88936 951b44b582 修正(会员弹层):升级报价未到时不再把标准价显示为本次补付
- 新增 amountPending:升级报价缺失时金额区显示占位符,CTA 只显示「补差升级」
- 补一条回归测试覆盖报价加载中的确认页
2026-10-04 10:32:50 +08:00
k88936 93837a736d 重构(会员弹层):抽取 resolveRovingIndex 复用方向键索引
- 页签列表与泥点档位网格共用同一个 roving index 解析函数
- 用 switch 取代深层嵌套三元,Home/End/左右键语义保持不变
2026-10-04 10:31:52 +08:00
k88936 987e82605b 重构(会员弹层):档位卡按钮文案去掉嵌套三元
- 用 if/else 预计算 actionButtonLabel,明确 禁用/提交中/默认 的优先级
2026-10-04 10:31:20 +08:00
k88936 a16dbf7bc0 文档(会员账期):说明 membership_cycle_window 把 index=0 收敛为第 1 期
- 注明与升级报价显式拒绝 cycle_index=0 的差异及兼容存量行的原因
2026-10-04 10:30:53 +08:00
k88936 b23ed023fc 文档(会员目录):注明单调校验要求 existing 覆盖完整档位
- 说明缺失档位会让倒挂静默通过,要求新增调用方传全量目录表
2026-10-04 10:30:50 +08:00
k88936 8ad490b39a 重构(后台表单):整数解析收敛到单一内部 helper
- 新增 parseSafeIntegerText 统一十进制校验,四个导出函数改为薄包装
- 注明 parsePositiveIntegerOrZero / parseNonNegativeIntegerOrZero 语义等价
2026-10-04 10:30:29 +08:00
k88936 658a39a357 修正(后台表单):严格整数解析只接受纯十进制数字
- parsePositiveInteger / parseNonNegativeInteger 改用 ^\d+$ 校验原始字符串
- 拒绝 1.0、1e2、0x10、+5 等 Number 会隐式转换的写法,与'严格整数'注释一致
2026-10-04 10:29:55 +08:00
suzmii afc2068fb3 Merge pull request '修复 master CI 红:收银台深链前缀路由、外部 MCP 工具数断言、并发 span 采集竞态、AGC 壳 shard-4 断言' (#609) from fix/ci-master-red into master
Project CI / AI game creator shell Rust crates (push) Successful in 2m58s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 3m58s
Project CI / AI game creator shell Rust lane 1/2 (push) Successful in 4m45s
Project CI / Backend tests (push) Successful in 7m9s
Project CI / Frontend tests (push) Successful in 3m12s
Project CI / Native shell tests (push) Successful in 7m9s
Project CI / AI game creator shell web tests (push) Successful in 3m13s
Project CI / Repository checks (push) Successful in 6m31s
Reviewed-on: #609
2026-10-04 09:20:59 +08:00
suzmii 4fc13bcfe3 合并 fix/ci-master-red(PR #609)到 fix/agc-canvas-reference-insert:取得 master 级 CI 修复
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m54s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m22s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m21s
Project CI / Backend tests (pull_request) Successful in 6m30s
Project CI / Frontend tests (pull_request) Successful in 3m29s
Project CI / Native shell tests (pull_request) Successful in 7m10s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m37s
Project CI / Repository checks (pull_request) Successful in 6m16s
把 #609 的 8/8 全绿修复并进本分支,满足「PR head 必须包含最新 base 提交」的门禁,同时带上共享红修复:check:nginx-spa-routes 的 /pay/<checkoutToken> 前缀路由与 Pingora 路由矩阵、external_mcp::semantic 真值 32、api-server/platform-llm 的 tracing interest 竞态、AGC 壳 Rust shard-4 两条偶发断言
本次 merge 无冲突自动完成:pitfalls.md 两边条目都保留(本分支的 issue #602 条目 + #609 的 2026-10-04 tracing/shard-4/SPA 深链三条)
未改动 #609 引入的任何文件
2026-10-04 03:40:21 +08:00
suzmii 8b11dc4e7a 语义目录测试的总数断言改回字面量,避免恒真
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m50s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m10s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m5s
Project CI / Backend tests (pull_request) Successful in 6m30s
Project CI / Frontend tests (pull_request) Successful in 3m12s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m44s
Project CI / Native shell tests (pull_request) Successful in 6m33s
Project CI / Repository checks (pull_request) Successful in 5m5s
- names.len() == MCP_OPERATIONS.len() + TOOLS.len() 在 BTreeSet 去重构造下恒真、没有判别力;
  改回固定 47(32 条 legacy 工具 + 15 条语义工具),并注明上面的插入断言已保证两组名字互不覆盖
- 本地实跑:cargo test --locked -p api-server --manifest-path server-rs/Cargo.toml --bin api-server semantic
  → 18 passed
2026-10-04 03:25:54 +08:00
suzmii ad0430fcd2 补上收银台深链 /pay/<checkoutToken> 的前缀路由(Nginx 三模板 + Pingora + 门禁)
- 现状:只把 `/pay`、`/profile/payment` 加进 allowlist 只能让 check:nginx-spa-routes 变绿;
  payment.rs 生成的 checkoutUrl 是 `/pay/<checkoutToken>`,深链仍落默认 location 的
  try_files → 404。同一批漂移里 check:pingora-route-parity 也是红的(Pingora MAIN_SPA_PATHS
  缺 /pay、/profile/payment),只是被 lint 链里先失败的门禁掩盖,修一条要跑到链尾
- 真相源:src/routing/activeAppPageRoutes.ts 新增 APP_PREFIX_ROUTE_ENTRIES
  ('/pay' → payment-checkout),resolveSelectionStageFromPath 改用它
- 门禁:scripts/check-nginx-spa-routes.mjs 要求三份模板都有锚定前缀 location
  `location ~* "^/pay/[^/]+/?$"`(裸前缀仍由精确 location 负责;前缀 location 必须镜像精确
  location 的维护闸与 try_files 回退);新增 scripts/check-nginx-spa-routes.test.mjs 正/反用例
  (把前缀写成精确匹配或过宽裸前缀都会红),由 npm run check:nginx-spa-routes 一起执行;
  check-pingora-route-parity 新增 MAIN_SPA_PREFIX_PATHS 与前端前缀路由的逐条比对
- 模板:deploy/nginx/genarrative.conf、deploy/nginx/genarrative-dev-http.conf、
  deploy/container/nginx.conf 各加一条锚定前缀 location
- Pingora:MAIN_SPA_PATHS 补 /pay、/profile/payment;新增 MAIN_SPA_PREFIX_PATHS 与
  is_main_spa_prefix_path(大小写不敏感,只认「前缀 + 恰好一段」),矩阵新增
  pay_checkout_spa_fallback 用例,并给网关补一条前缀正/反单测
- 文档:Pingora 试点文档的路由表与门禁说明、deploy/nginx/README 与本地开发/生产运维文档
  同步前缀路由口径与线上 curl 复验方式
- 本地实跑:node --test scripts/check-nginx-spa-routes.test.mjs(4 passed)、
  node scripts/check-nginx-spa-routes.mjs(OK,14 SPA routes / 1 prefix routes / 3 templates)、
  npm run check:pingora-route-parity(OK,25 routes)、
  cargo test -p pingora-gateway -- pay_checkout_deep_link matches_nginx_route_parity_matrix(2 passed)
2026-10-04 03:25:54 +08:00
suzmii 9e2cea5b72 修复 AGC 壳 Rust shard-4 的两条偶发断言,并补齐 pitfalls 记录
- agent::thread_manager::tests::active_turn_changes_publish_one_notification_per_real_change
  偶发 left 8/right 7:测试计数器 DIRECT_ACTIVE_TURNS_EVENT_TEST_COUNT 曾在 2026-10-01 按线程
  作用域隔离,2026-10-02 退役 runtime_driver 把它搬进 agent/direct_events.rs 时降级回进程级
  static AtomicU64,于是断言会取到宿主 tauri::async_runtime 后台回合在别的线程上的广播
  (--test-threads=1 只串行测试线程)。改回 thread_local! Cell,并注明跨线程口径的覆盖取舍
- process_session::tests::process_session_graceful_terminate_keeps_wrapper_alive_for_target_cleanup
  偶发 left "exited"/right "terminated":测试命令里 leader 打印 READY 后立刻 exit 0,同组后代
  仍存活,trampoline 从 leader 被回收起开始 800ms 宽限;客户端只要晚于宽限才发出 terminate
  就只能读到既成事实。改为 leader 用 wait 等后台子进程,让 terminate 必然落在会话仍 running 时
  (trap / sleep 0.4 / marker / 断言均未改),并注明该用例的确定性来自 400ms < 800ms 的时间余量
- docs/project-memory/shared-memory/pitfalls.md:更新 graceful terminate 那条已过时的验证口径,
  补三条 2026-10-04 条目(tracing interest 竞态、AGC 两条偶发的串台根因、SPA 深链前缀路由)
- 本地实跑:修复前把计数器临时改回 AtomicU64 时同一并行口径 17/20 红;修复后并行 20 次全绿、
  agent::thread_manager:: 连跑 5 次 72 passed;第 2 条用例是 #[cfg(target_os = "linux")],
  Windows 本机跑不到,已用真实 Linux 内核(WSL Alpine)验证命令形状(leader 活到 TERM、
  同组后代完成 400ms 延迟清理 marker=done 0.41s、清理后组内零残留),CI 侧仍需跑
  node apps/ai-game-creator-shell/scripts/run-rust-shell-test-shards.mjs --shards=4 --shard-index=4 复核
2026-10-04 03:25:54 +08:00
suzmii 977b2f0c75 修掉并发测试下 HTTP/Provider span 偶发采集为空的 tracing interest 竞态
- 根因:span!/info_span! 宏在 callsite 的缓存 interest 为 never 时会静默返回空 span
  (tracing-0.1.44/src/macros.rs 的 span! 分支),而 DefaultCallsite::register 只在调用点
  首次被命中时计算一次 interest,且当进程里只注册过一个 dispatcher 时会退化成
  dispatcher::get_default()——也就是命中线程自己的 dispatcher(tracing-core-0.1.36
  callsite.rs 的 Rebuilder::JustOne)。libtest 默认并发下,没有 subscriber 的普通测试线程
  一旦抢到 http.request / llm.request 调用点的首次注册,就会把它永久缓存成 never,
  于是 CI 偶发看到 0 个 span(app.rs:603、observability_tests.rs:98)
- 关键:set_default 与 with_subscriber 在 interest 缓存这件事上**等价**(都只是新建 Dispatch
  并触发一次 rebuild_interest,只能纠正“已经注册过”的调用点,纠正不了 JustOne→get_default
  这条首次注册分支),所以真正起作用的是**在自家 subscriber 下命中同一个调用点做热身**,
  把首次注册的顺序握在自己手里;register_callsite 覆写只用于避免本 subscriber 触发的重建
  把其它调用点永久标记成 never
- api-server app::tests::http_tracing:不再用 with_subscriber,改为在请求前用同一
  http.request 调用点热身到连续两轮采集成功,并在整个请求期间持有 scoped default
  (已注明 set_default 是线程绑定,只适用于默认的 current_thread #[tokio::test])
- platform-llm observability_tests:新增 run_under_capture 固定整段流程的 scoped default,
  并新增 warm_up_provider_span_callsite(用指向刚释放 loopback 端口的最小失败请求命中同一
  llm.request 调用点,连续两轮采集成功才继续)
- 断言未放宽:仍要求每个被拒绝请求恰好 1 个 HTTP span、每次 Provider 调用恰好 1 个
  llm.request span;未使用 sleep
- 本地实跑:cargo test -p api-server --bin api-server app::tests::http_tracing(默认并发与
  --test-threads=1 各 20 次全绿)、app::tests:: 91 用例并发 10 次全绿、--skip bgfilter_worker
  --skip wallet_refund_outbox 的 1133 用例全量 bin 2 次全绿;cargo test -p platform-llm --lib
  (162 passed,含 3 条观测用例)连跑 20 次全绿
2026-10-04 03:25:54 +08:00
suzmii 05707e61e4 修正外部 MCP 语义目录测试里写死的 legacy 工具数断言
- 断言 MCP_OPERATIONS.len() == 30 自 #592 起写死。4b529a895(新增支付服务接入与订单收银台)
  在内置 OpenAPI 中新增 createExternalPaymentOrder、getExternalPaymentOrder 两条未被
  x-mcp-excluded 排除的操作,legacy 可调用工具由 30 合法增至 32(非重复注册、非覆盖)
- 断言更新为 32 并注明来源(内置 OpenAPI 去掉 5 条元数据/入口操作后的可调用集合),
  保留“语义工具是增量、不得覆盖 legacy 工具”的原意;总数断言改为
  MCP_OPERATIONS.len() + TOOLS.len() 派生,避免再次写死
- 本地实跑:cargo test --locked -p api-server --no-fail-fast --manifest-path server-rs/Cargo.toml semantic
  → 18 passed(含 semantic_catalog_adds_fifteen_tools_without_replacing_legacy_tools)
2026-10-04 00:56:55 +08:00
suzmii 26b6e1095b 修复 Nginx SPA allowlist 缺少 /pay 与 /profile/payment
- src/routing/activeAppPageRoutes.ts 的 STAGE_ROUTE_ENTRIES 已把 payment-checkout→/pay、
  profile-payment→/profile/payment 定义为主站对外可直达的 SPA 路由(分别渲染
  PaymentCheckoutView 与 PlatformPaymentServiceView),但三份 Nginx 模板的 SPA allowlist
  仍停留在加入支付入口之前的集合,导致 check:nginx-spa-routes 在 master 上失败
- deploy/nginx/genarrative.conf、deploy/nginx/genarrative-dev-http.conf、
  deploy/container/nginx.conf 的 SPA regex 补上 pay、profile/payment,
  保持既有形状(锚定完整路径 + 大小写不敏感 + 允许一个尾部斜杠)
- 本地实跑:node scripts/check-nginx-spa-routes.mjs → OK (14 SPA routes, 3 Nginx templates)
2026-10-04 00:56:54 +08:00
suzmii 3f18e3dc77 按独立评审的三条 P2 收口:空批次不误报、重复注册留线索、文档与实测对齐
Project CI / AI game creator shell Rust crates (pull_request) Failing after 1m35s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m20s
Project CI / Backend tests (pull_request) Failing after 4m39s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m18s
Project CI / Frontend tests (pull_request) Successful in 3m19s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m43s
Project CI / Native shell tests (pull_request) Successful in 7m28s
Project CI / Repository checks (pull_request) Failing after 4m32s
App.tsx 的监听处对空批次直接返回:空批次没有要插的东西,不能报成「没有可用的聊天输入区」(原因指向错了方向)
activeChatComposer.registerActiveChatComposer 增加重复注册检测:dev 下 console.warn 指出后注册者顶替了前者,不改运行时语义(仍然后注册者接管、身份校验照旧兜住乱序卸载)
tests/activeChatComposer.test.ts 补两条:空批次不打扰已挂载输入区;重复注册出现告警且乱序注销清不掉更新的句柄
tests/resourceCanvasChatReferenceDrop.test.tsx 补一条:直接构造空批次引用事件时不产生「没有可用的聊天输入区」告警
decision-log 的「影响范围」补记 tests/activeChatComposer.test.ts,「验证」换成合并 master 后的实跑数字;功能说明的用例表补两行
反向证伪:去掉空批次短路、去掉重复注册告警后,上面两条新用例各红一处
2026-10-04 00:38:06 +08:00
suzmii 455b265a75 合并 master 到 fix/agc-canvas-reference-insert:按新测试替身与类型门禁解冲突
master 侧(PR #601)新增 tests/tauriRuntimeFake.ts(全仓唯一 window.__TAURI__ 安装点)与 tsconfig.tests.json,测试统一改用 installTauriRuntime / resetTauriRuntime,并新增 check:tests:types 门禁
冲突三处测试文件(resourceCanvasChatReferenceDrop.test.tsx、appSurface/project-development.suite.ts、appSurface/design-agent.suite.ts)按语义两边保留:采用 master 的替身安装点与类型收窄(ResourceReference 过滤),保留本分支的真实 DirectProject 聊天面挂载与端到端草稿断言
App 的 props 类型未导出,新增的两处 chat 节点改用 AppComponent 组件类型别名(与 design-agent.suite.ts 同一写法),通过新的 check:tests:types
docs 侧 pitfalls.md / decision-log.md 自动合并:本分支的 issue #602 条目与 master 的「根因 7/8」条目都保留
未在本分支修 master 既有红(check:nginx-spa-routes 缺 /pay 与 /profile/payment、external_mcp::semantic 32 vs 30、http_tracing 偶发、AGC Rust shard 4/4),由上游 fix/ci-master-red 处理
2026-10-04 00:28:19 +08:00
suzmii f4ada50612 自审加固:注册表按 ref 转发注册、插入成功语义与失败留痕对齐
Project CI / Backend tests (pull_request) Failing after 17s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m50s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m19s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m43s
Project CI / Repository checks (pull_request) Failing after 32s
Project CI / Frontend tests (pull_request) Successful in 2m35s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m23s
Project CI / Native shell tests (pull_request) Successful in 6m26s
ActiveChatComposerHandle.insertReferences 改为返回 boolean:由句柄回答这一批有没有真的递到输入区,注册表不再用「有句柄」冒充「插进去了」
insertChatReferences 增加第三种 false(句柄报落空),且只有插入成功才 focus,失败不抢焦点
DirectProjectChatView 改为注册「按 ref 转发」的句柄,注册时不再读 composerHandleRef.current,去掉对父子 effect 顺序的隐式依赖(内层输入区重挂载也不会留下死句柄)
DirectProjectComposer 与 PlanningChatView 的转发句柄同步返回 boolean
App.tsx 的 dev 失败线索文案改为「没有可用的聊天输入区(未挂载或已卸载)」,覆盖句柄落空这一种
新增 tests/activeChatComposer.test.ts:钉住注册表合同(空批次 / 无输入区 / 句柄报落空不聚焦 / 注销身份校验);反向证伪:去掉身份校验后该用例变红
同步 docs/【功能说明】AGC聊天素材引用-2026-09-08.md 与 shared-memory 决策记录
2026-10-04 00:12:24 +08:00
k88936 ccd2715726 Merge pull request 'Fix/typecheck test' (#601) from fix/typecheck-test into master
Project CI / AI game creator shell Rust crates (push) Successful in 3m9s
Project CI / Backend tests (push) Failing after 4m6s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 4m59s
Project CI / AI game creator shell Rust lane 1/2 (push) Successful in 5m49s
Project CI / Frontend tests (push) Successful in 3m5s
Project CI / AI game creator shell web tests (push) Successful in 2m41s
Project CI / Repository checks (push) Failing after 3m36s
Project CI / Native shell tests (push) Successful in 6m18s
Reviewed-on: #601
2026-10-03 21:05:42 +08:00
k88936 dfa92607b4 Merge remote-tracking branch 'origin/master' into feat/pricing-plan
Project CI / Backend tests (pull_request) Failing after 1m51s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 3m10s
Project CI / Frontend tests (pull_request) Failing after 1m31s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m59s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m50s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m38s
Project CI / Repository checks (pull_request) Failing after 4m27s
Project CI / Native shell tests (pull_request) Successful in 7m43s
# Conflicts:
#	docs/project-memory/shared-memory/decision-log.md
#	server-rs/crates/module-runtime/src/lib.rs
2026-10-03 20:32:40 +08:00