Commit Graph

3658 Commits

Author SHA1 Message Date
suzmii 6aa2f97410 feat(游戏共创): 贡献归集与归因(接口 + 契约 + 文档;反洗稿改判搁置)
Project CI / AI game creator shell Rust lane 1/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
Project CI / Repository checks (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 / 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
产品口径:「子代所有的都算父代的」,并要能溯源「多少是子代给的、多少是自己的」。本期**只做计算**,
不含资金/分成结算。

- 递归定义:`inherited(W) = Σ_{c∈直接子代} total(c)`,`total(W) = own(W) + inherited(W)`;每个后代在它的每个
  祖先里只计一次。
- 接口:`GET /api/game-distribution/games/{game_id}/contribution`(Bearer + `no-store`)——**仅该作品作者**:
  未登录/失效 401(中间件)、非作者 403(复用既有 owner-mismatch → FORBIDDEN,不新增第二套鉴权)、
  作品不存在或根自身已软删 404。响应:`{ gameId, own, inherited, total, byGeneration[], directChildren[],
  nodeCount, truncated, truncatedReason }`;指标结构 `ContributionTotals{playCount}` 可扩展(将来加点赞/收藏/收入)。
- 不变量(测试钉住):`inherited == Σ byGeneration.total == Σ directChildren.total`、`total == own + inherited`、
  `nodeCount == Σ byGeneration.gameCount`;`byGeneration` 只含后代(绝对代际,升序)。
- 上限与截断:节点 500 / 深度 32;超限如实标 `truncated: true` + `truncatedReason ∈ {node_limit, depth_limit}`,
  已计入部分仍自洽(与族谱 `truncated` 同约定,不静默给半个数);遍历只用血缘表既有索引,**不新增表/索引**。
- 契约:shared-contracts 4 个 DTO + TS 镜像 + parity(+4 组 → 66 组);7 个生成绑定(含 procedure)。
- 文档:技术方案新增 `§3.11 贡献归集与权益归因`(定义/归因分解/接口/上限与截断/鉴权口径与理由)+ §3.4 路由行 +
  §5.4 实施证据;**任务 B**:反洗稿(相似度校验)从「待拍板」改为「**产品已决定搁置(2026-10-06)**」并从待拍板
  清单移除,结算口径统一为「本期只做贡献归集与归因计算」。
- 测试:module-game-distribution **131 passed**(contribution 12 条,含 A→B→C 三层链路不变量);spacetime-module
  **304 passed / 1 ignored**(+3 结构断言);spacetime-client 43 passed;api-server game_distribution **107 passed**(+3)。

门禁:wasm build 0;`cargo check --all-targets` 0;`SPACETIME_SCHEMA_BASE_REF=9f4c7d76 npm run check:spacetime-schema`
0(98 表);DTO parity 0(66 组 / 17 构建器 / 15 手拼类型);`check:project-bundle-policy-parity` OK;
`check:encoding` 0(5543 files);`cargo fmt --all --manifest-path server-rs/Cargo.toml -- --check` 0;`git diff --check` 0。

注:本块未提交 `scripts/*.mjs`(`check-game-distribution-lineage-e2e.mjs` / `-theme-e2e.mjs` /
`capture-game-lineage-visual.mjs`)——属其它 owner,工作区保留未提交。
2026-10-06 18:05:49 +08:00
suzmii 512bbb7a62 feat(游戏共创): 衍生作品创建时自动继承父作品授权档位(客户端不可另选)
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m9s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m3s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m46s
Project CI / Frontend tests (pull_request) Successful in 3m11s
Project CI / Native shell tests (pull_request) Failing after 3m18s
Project CI / AI game creator shell web tests (pull_request) Failing after 1m20s
Project CI / Repository checks (pull_request) Successful in 6m4s
Project CI / Backend tests (pull_request) Successful in 8m2s
对齐需求文档 revision 1554「授权设置区:自动继承父作品授权」(被划掉的那句「可收窄、不可放宽」不做)。

- **口径**:衍生作品创建时 `fork_authorization` **直接取父作品当时的档位**(创建时快照),客户端传值一律
  **忽略且不报错**(旧客户端会惯常带默认值);母版不变(按请求值,缺省 `forbidden`,未知档位仍失败关闭);
  收窄入口不做;**PUT 提升接口语义未改**(见下)。
- **落点**:`resolve_game_distribution_fork_declaration_tx` 原本就在父行上判「存在/未软删/已公开/非禁止/来源版本
  等于父当前公开版本」,现在把父档位一并回传(`(root, generation, ForkAuthorization)`);新增纯函数
  `resolve_game_distribution_creation_fork_authorization(parent, requested)`:有父 → 父档位,无父 → 解析请求值
  (未知 → `FORK_AUTHORIZATION_UNKNOWN`);创建事务里把血缘解析挪到授权裁决之前,新行写裁决结果。
- **无 schema / 无契约形状变化**:`GameDistributionCreateGameRequest.forkAuthorization` 保留(非 Option +
  `serde(default)` 未动 ⇒ 幂等摘要不变);表列、client record、快照均无字段增删。
- **文档**:技术方案 §2.3(授权模式 + 时序图两条继承边)/§2.4/§3.2.1/§3.4 `POST /games` 行/§3.9 补充/新增 §5.3
  实施证据/§7 第 2 条(待拍板 → 已定口径并注明收窄不做);数据契约 `game_distribution_game` 授权条;共创授权与
  血缘里程碑(依赖决策/验收第 1 条/实施记录);decision-log 新增 2026-10-06 决策条。
- **测试**:spacetime-module +7(继承矩阵:父 full/nonCommercial × 请求 forbid/nonCommercial/full/空串 一律落
  父档位;母版按请求值;未知档位失败关闭;以及「血缘解析返回父档位 + 裁决排在解析之后且写库之前」的结构断言)。
  Rust 侧原本**没有**断言「衍生默认 forbidden」的用例(已 grep 核对),因此没有为了让测试过而弱化任何断言。

门禁:`SPACETIME_SCHEMA_BASE_REF=9f4c7d76 npm run check:spacetime-schema` 0(98 表);`cargo check --all-targets` 0;
`cargo test -p module-game-distribution` 119 passed;`cargo test -p spacetime-module` **301 passed / 1 ignored**;
`cargo test -p api-server game_distribution` 104 passed;DTO parity 0(62 组 / 17 构建器 / 15 手拼类型);
`check:encoding` 0(5535 files);`cargo fmt --all --manifest-path server-rs/Cargo.toml -- --check` 0;`git diff --check` 0。

**待你拍板(只报不改)**:继承是「创建时快照 + 等值」,而 PUT 只限制方向不限制对象 ⇒ 衍生作品作者仍可把继承来的
档位再往上提,得到比祖先更宽的子作品,「不可放宽」会被绕过。选项:① 保持现状(PUT 对衍生作品也生效);
② 禁止对衍生作品 PUT 提升(档位只由继承决定;需新增「该 game 无血缘行」判定 + 稳定错误码,并同步文档与前端入口)。

**需其它 owner 同步**(我未改,属其文件):`scripts/check-game-distribution-lineage-e2e.mjs`(richB1/richC1/richD
从 `forbidden` 提升的前置假设已不成立)、`scripts/capture-game-lineage-visual.mjs`(固定
`expectedForkAuthorization: 'forbidden'` 的造树与断言)。
2026-10-06 17:39:35 +08:00
suzmii d0176f48b7 feat(游戏共创): 衍生作品发布必填「本次核心改动说明」(版本级存储 + 可达错误码)
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
按需求文档 revision 1554「发布设置页 → 二创信息区(必填项)」:衍生作品(有血缘行)发布新版本时**必须**
提供「本次核心改动说明」;母版(0 代)不需要——提供了也忽略、不校验、不落库。

- **存储**:`game_distribution_version` **表尾追加** `change_summary: Option<String>`(`#[default(None)]`);
  列序属 wire format,`game_distribution_version_type` / `_version_snapshot_type` / `_create_version_input_type`
  三个绑定同步重生成(仓外临时 out-dir,只回写受影响文件)。
- **请求**:`GameDistributionCreateVersionRequest.change_summary`(`#[serde(default, skip_serializing_if)]`:
  缺省不序列化 `null`,保住旧客户端的幂等摘要)。
- **校验**:纯函数 `game_distribution_change_summary_violation(value, is_derivative)`,trim 后按**字符**计
  **20..=500** —— 20 是「能写清改了什么」的下限,500 约 1 KiB 上限,兼顾详情页/族谱展示与存储;
  超限或缺失**失败关闭**,错误码 `FORK_CHANGE_SUMMARY_REQUIRED` / `FORK_CHANGE_SUMMARY_INVALID`(均 **400**),
  已登记进 api-server 的 `FORK_` 映射表并纳入「FORK 码由模块真实文案可达」的枚举测试(防上次那种不可达码)。
- **公开投影**:`currentVersion.changeSummary`(衍生为字符串、母版 `null`,发键不发值),版本负载键集合
  逐字钉死为 id/version/entryUrl/sha256/publishedAt/controls/changeSummary,不带对象键/素材 id/审核字段。
- **契约与登记**:Rust DTO + TS 镜像 + parity(`version_summary_payload` 加 `mustEmit: ['changeSummary']`)。
- **文档**:技术方案 `§3.4`(请求增量 + 长度口径与理由 + 两个错误码 + 幂等摘要口径 + 公开投影)、数据契约
  文档的版本表小节(表尾追加列)。
- **测试**:纯函数 5 条(衍生缺失/超短(ASCII 与汉字)/超长(ASCII 与汉字)/区间内 trim 边界/母版忽略)+
  事务 4 条 + 接口 3 条(含公开负载键集合与母版 null)。

门禁:`SPACETIME_SCHEMA_BASE_REF=9f4c7d76 npm run check:spacetime-schema` 0(98 表);`cargo check --all-targets` 0;
`cargo test -p module-game-distribution` **119 passed**;`cargo test -p api-server game_distribution` **104 passed**;
DTO parity 0(62 组 / 17 构建器 / 15 手拼类型);`check:encoding` 0(5535 files);
`cargo fmt --all --manifest-path server-rs/Cargo.toml -- --check` 0;`git diff --check` 0。

注:本块**未提交** `scripts/check-game-distribution-lineage-e2e.mjs` / `check-game-distribution-theme-e2e.mjs` /
`capture-game-lineage-visual.mjs` 的配套改动(属别的 session 的文件,工作区里保留未提交,需其 owner 决定:
衍生作品发布若不传 `changeSummary` 现在会 400,那三个脚本需要同步补字段)。
2026-10-06 17:24:42 +08:00
suzmii 172bc22404 fix(游戏共创): 合并后修正 game_distribution_game 列顺序(master 的 price_mud_points 回到第 26 位)
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
CI(Backend tests 与 Repository checks)在 `check:spacetime-schema` 红:
「SpacetimeDB 表 game_distribution_game 的第 26 个字段从 price_mud_points 变为 fork_authorization,疑似字段顺序被调整」。

根因:本次合并把两侧各自「在表尾追加」的列并成了「我们的列在 master 的列之前」——schema guard 对表的字段
相对顺序是按 index 逐位比对的(只允许在结构体末尾追加)。

- `game_distribution_game` 表:`price_mud_points`(master 先追加,第 26 位)回到原位,本分支的
  `fork_authorization` 追加在它**之后**(表尾);
- `GameDistributionGameSnapshot` 按同一纪律排(同一 game 行的 RPC 形状,避免表与快照两套顺序);
- 重新生成绑定:`module_bindings/game_distribution_game_type.rs`、`..._game_snapshot_type.rs`
  (列顺序属 wire format,客户端绑定必须与模块同步);
- 两处结构体注释写明该纪律(master 的列保持 index、我们的列追加在后),避免下一次合并再踩;
- 文档:`docs/project-memory/shared-memory/pitfalls.md` 增一条「合并 master 后 schema guard 的基线盲区」——
  本地守卫默认基线是 `git merge-base HEAD origin/master`,**merge 提交尚未建立时看不见**这类重排,
  因此合并后必须用 `SPACETIME_SCHEMA_BASE_REF=<PR base>` 复跑。

门禁:`SPACETIME_SCHEMA_BASE_REF=9f4c7d76 npm run check:spacetime-schema` 0(98 表);wasm build 0;
`cargo check --all-targets` 0;`cargo test -p module-game-distribution` 113 passed;`cargo test -p api-server
game_distribution` 101 passed;`cargo test -p module-runtime` 0;`cargo test -p spacetime-client` 43 passed;
`cargo test -p spacetime-module` 294 passed / 1 ignored;DTO parity 0(62 组 / 17 构建器 / 15 手拼类型);
`check:project-bundle-policy-parity` OK;`check:production-ops` OK;`check:doc-index` OK(261 份);`check:encoding`
0(5525 files);`cargo fmt --all --manifest-path server-rs/Cargo.toml -- --check` 0;`git diff --check` 0。
2026-10-06 16:47:38 +08:00
suzmii eeb101458a Merge remote-tracking branch 'origin/master' into feat/game-fork
Project CI / Backend tests (pull_request) Failing after 34s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m27s
Project CI / Native shell tests (pull_request) Failing after 2m46s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m58s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m23s
Project CI / AI game creator shell web tests (pull_request) Failing after 45s
Project CI / Frontend tests (pull_request) Successful in 2m24s
Project CI / Repository checks (pull_request) Failing after 1m1s
# Conflicts:
#	apps/ai-game-creator-shell/src-tauri/src/game_distribution_publish.rs
#	apps/ai-game-creator-shell/src/components/game-distribution/GameDistributionPublishPanel.tsx
#	apps/ai-game-creator-shell/tests/gameDistributionPublishPanel.test.tsx
#	docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md
#	package.json
#	packages/shared/src/contracts/gameDistribution.ts
#	scripts/check-game-distribution-dto-parity.mjs
#	server-rs/crates/api-server/src/modules/game_distribution.rs
#	server-rs/crates/module-game-distribution/src/errors.rs
#	server-rs/crates/module-game-distribution/src/lib.rs
#	server-rs/crates/shared-contracts/src/game_distribution.rs
#	server-rs/crates/spacetime-client/src/active.rs
#	server-rs/crates/spacetime-client/src/active/mapper.rs
#	server-rs/crates/spacetime-client/src/active/mapper/game_distribution.rs
#	server-rs/crates/spacetime-client/src/game_distribution.rs
#	server-rs/crates/spacetime-client/src/module_bindings.rs
#	server-rs/crates/spacetime-client/src/module_bindings/game_distribution_game_snapshot_type.rs
#	server-rs/crates/spacetime-client/src/module_bindings/game_distribution_game_type.rs
#	server-rs/crates/spacetime-module/src/game_distribution.rs
#	server-rs/crates/spacetime-module/src/migration.rs
#	src/components/game-distribution/GameDetailPage.tsx
#	src/components/game-distribution/GameDistributionPages.test.tsx
#	src/components/game-distribution/GamePlayPage.tsx
#	src/components/platform-entry/PlatformEntryActiveFlowShell.tsx
#	src/services/gameDistributionClient.test.ts
#	src/services/gameDistributionClient.ts
2026-10-06 16:10:52 +08:00
suzmii d2e05dbeb7 Merge remote-tracking branch 'origin/master' into fix/agc-composer-layout
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m3s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m24s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m14s
Project CI / Frontend tests (pull_request) Successful in 3m48s
Project CI / Backend tests (pull_request) Successful in 8m5s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m0s
Project CI / Repository checks (pull_request) Successful in 7m30s
Project CI / Native shell tests (pull_request) Successful in 9m44s
合并 master be9f74f42(付费游玩泥点付费规范 #635 等):保留双方条目/内容
- 唯一冲突:`docs/project-memory/shared-memory/pitfalls.md` —— 本分支 2 条(2026-10-05「PR #607 复核修复」+「模型菜单的观感是组件自带的共享样式面」)在前,master 新增 2 条(「给 shared-contracts 请求 DTO 加字段」+「付费游戏播放会话前缀落在 /api/*」)紧随其后,**两侧 4 条都保留**(grep 逐条命中 1)
- 其余 286 个文件自动合并(master 侧含 server-rs / admin-web / 主站 / vite.config.ts 等,与本分支不重叠;`styles.css` 也是自动合并、无冲突)
- 门禁(本轮只合并、未改内容):`vitest run appSurface + chatDialogFrameLayout + conversationModelSelect` **258 passed / 9 skipped**;`npm run agc:typecheck` pass 3 / fail 0;`npm run check:encoding` 5418 files;`git diff --check` rc=0;prettier 已对合并后的 pitfalls 重新折行
2026-10-06 15:19:31 +08:00
suzmii 54e05d5e84 lineage viz polish 2: dual-axis fit, readable floor, fixed axis layer, edge contrast
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
2026-10-06 14:47:51 +08:00
suzmii f0cad9dddc 合并 origin/master(52c83cc2a,248 个提交)到 feat/game-purchase
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m28s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m26s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m41s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m56s
Project CI / Backend tests (pull_request) Successful in 9m4s
Project CI / Repository checks (pull_request) Successful in 7m13s
Project CI / Native shell tests (pull_request) Successful in 10m16s
Project CI / Frontend tests (pull_request) Successful in 2m26s
- 同步 master 侧 248 个提交:会员与泥点计费(PR #588 / #603)、创作者主页与关注粉丝(PR #638)、运行页刷新真重载(PR #640)、AGC 模板 templateVersion 递增(PR #643)等;确认 master 未触碰发行网关与 `api-server/src/modules/game_distribution.rs`。
- 冲突 1(server-rs/crates/module-runtime/src/domain.rs:1157-1162)`RuntimeProfileWalletLedgerSourceType` 两侧各自在末尾追加变体:保留 master 的 `MembershipUpgradeGrant` 为索引 16(线上已落库口径),本分支 `GamePurchase` 顺延为索引 17,并保留其「每账号每游戏一次扣费」注释。
- 冲突 2(server-rs/crates/module-runtime/src/domain.rs:1184-1188)`as_str()` 同时保留 `membership_upgrade_grant` 与 `game_purchase` 两个分支。
- 冲突 3(server-rs/crates/spacetime-client/src/active/mapper/runtime_profile.rs:95-101)bindings→领域枚举映射同时保留 `MembershipUpgradeGrant` 与 `GamePurchase` 两支,按新索引顺序排列。
- 冲突 4(server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_source_type_type.rs:43-47)生成枚举按模块源码顺序合并为 …`MembershipUpgradeGrant`、`GamePurchase`;随后 `npm run spacetime:generate` 复核该文件与生成结果逐字节一致。
- 冲突 5(server-rs/crates/api-server/src/admin.rs:4849-4853)sats 索引映射改为 `16 => membership_upgrade_grant` 与 `17 => game_purchase` 两条并存。
- 冲突 6(server-rs/crates/api-server/src/admin.rs:6368-6461)索引断言并入 master 的 `[16] => membership_upgrade_grant`,并把 master 的「17 尚未映射」占位断言替换为 `[17] => game_purchase`;本分支的后台消耗统计两个用例原样保留。
- 冲突 7(server-rs/crates/api-server/src/runtime_profile.rs:219-226)来源文案格式化同时保留 `MembershipUpgradeGrant` 与 `GamePurchase` 两支,注释随 `GamePurchase` 保留。
- 冲突 8(docs/project-memory/shared-memory/decision-log.md:3-24)两条决策记录并列保留:本分支 2026-10-05「播放会话前缀在三处入口清空 Cookie」在前,master 2026-10-03「每日免费发放额为 0 时前端隐藏该池」在后。
- 保住 master 侧:发行响应 ETag/304/gzip(`release_asset_response_with_cache` 五参形态与 `release_asset_etag` / `if_none_match_matches` / `accepts_gzip_encoding` / `gzip_release_asset` / `release_asset_not_modified_response`)、共享加载面 `PlatformGameLoadingSurface` 及其使用方、三池钱包与会员档位目录改造。
- 保住本分支侧:付费作品 404 守卫(`price_mud_points > 0` 且位于 `load_package` 之前)、购买与播放会话网关路由、nginx×3 / Pingora / Vite 的播放会话 Cookie 清空与 `nginx-route-parity.matrix.json` 登记、viewer 感知公开详情、后台审核价格、`PlatformGamePricingField` 共享定价组件与两端接入、AGC 项目版本只读 + 平台派发下一版本号、schema 与迁移白名单、钱包来源 `game_purchase`。
- 验证:`git merge-base --is-ancestor origin/master HEAD` 返回 0;`check:encoding`、`check:doc-index`、`check:spacetime-schema`、`check:server-rs-ddd`、`check:rustfmt`、`check:npm-workspaces`、`check:game-distribution-dto-parity`、`check:game-distribution-price-limit-parity`、`check:pingora-route-parity`、`check:nginx-spa-routes`、根/admin-web/AGC typecheck、`git diff --check` 全绿。
- 测试:`cargo test -p module-game-distribution` 30 passed,`cargo test -p api-server game_distribution` 61 passed,`cargo test -p spacetime-module game_distribution` 7 passed;定向 vitest 28 个文件 252 个用例全通过。
- `npm run spacetime:generate` 除 11 个 procedure 文件的纯空白格式差异外无任何语义改动(`git diff -w` 为空),已保留 master 的生成产物形态,提交内无 schema/绑定语义变化。
2026-10-06 13:12:32 +08:00
suzmii 2a04f293b1 Merge remote-tracking branch 'origin/master' into feat/game-fork
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m25s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m18s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m31s
Project CI / Frontend tests (pull_request) Successful in 2m38s
Project CI / Native shell tests (pull_request) Failing after 2m52s
Project CI / AI game creator shell web tests (pull_request) Failing after 1m29s
Project CI / Backend tests (pull_request) Successful in 7m44s
Project CI / Repository checks (pull_request) Successful in 5m37s
2026-10-06 12:24:10 +08:00
suzmii 811efc102c Merge remote-tracking branch 'origin/master' into fix/agc-composer-layout
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
合并 master 76166b08c(模型目录不可用项 / 管理端等):保留双方条目
- apps/ai-game-creator-shell/src/services/clientApi.ts:取 master 的 typed 目录读取(`ClientLlmModelCatalog` 已含 unavailableModels,不再手写 agentMode 映射),但保留本分支的文案「模型服务不可用」(本 PR 的口径,master 那侧还是旧的「本地…」)
- ConversationModelSelect.tsx:import 取并集(`Lock` + `ReactNode`),渲染结构保留本分支的「强度区外壳」(`strengthSection ? <shell>{strengthSection}{modelMenu}</shell> : modelMenu`)——master 把菜单内联展开、并加了不可用项列表,那段已自动合并进 `modelMenu` 变量里,两边语义都在
- tests/conversationModelSelect.test.tsx:取 master 的新文案「所选模型已下线,已切换为默认模型」,保留本分支的异步查询(`await screen.findByText`,文案走 portal toast)
- docs/project-memory/shared-memory/pitfalls.md:两侧条目都保留(本分支在前,master 新增在后)
- 校验:typecheck pass 3 / fail 0;`appSurface + chatDialogFrameLayout + conversationModelSelect` 257 passed / 9 skipped
2026-10-06 11:00:40 +08:00
suzmii 7e036a7199 润色钮挪到发送钮左边(右组相邻成组)
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
- 口径:AI 润色 / 恢复原文与发送钮同为圆角矩形按钮,放一起更协调 → 从「左组 `@` `+` 之后」挪到**右组最末、发送钮左侧**,最终顺序 `@` `+` | 模型 麦克风 润色 发送(`space-between` 左右分组不变)
- 实现:portal 挂点搬进右组(`DirectProjectComposer` 里把 `.project-chat-composer-controls-actions` 移到 `-controls-right` 内、发送钮之前),`actionsPortalTarget` 的「可选 prop、不传则行为不变」契约保持;用显式槽位而不是 CSS `order`,因为 DOM 顺序即 Tab 与读屏顺序(现在就是 模型 → 麦克风 → 润色 → 发送,与视觉一致)
- 注释/文档同步:composer 与 styles.css 里「与 `@` / `+` 同组、排在左组最后一个」那类旧口径全部改成新口径(「与发送同为圆角矩形按钮、相邻成组」),pitfalls 同段一并更新;全仓 grep `输入类动作` / `生成类动作` / `排在左组` / `左组最后一个` 命中 0
- 测试:`chat-composer.suite.ts` 的 DOM 断言改成新挂点——润色钮必须在 `.project-chat-composer-controls` 内、父链是 `-controls-right`、**`slot.nextElementSibling` 就是发送钮**、且 `compareDocumentPosition` 证明润色在发送之前;`chatDialogFrameLayout.test.ts` 的源码顺序断言改成「挂点在 `-controls-right` 之后、`{canStopTurn` 之前」;空态「工具条之外无第二个按钮」计数仍为 6;七宽度单行/不相交用例不变(含新位置)
- min-width 复核(无头 Chromium 夹具,240/280/296/320/360/438/900 七档):控件排仍 **252px** 所需、外壳仍 **278px**;自然宽度 290.4(438/900 档)→ 算式不变;七档 `topSpread ≤ 1px`、控件两两相交 **0** 处、`outsideControlsRow` 空、润色钮与发送钮间距固定 **8px**(同一行、同一组)
- 截图:240px 改前→改后 + 438px 改后 + 438px toast 已换新(正文引用与附件 1:1:12 = 12,未引用的旧图已删)

Refs #600, PR #607
2026-10-06 10:57:19 +08:00
k88936 796cf9843c Merge remote-tracking branch 'origin/master' into feat/pricing-plan
Project CI / AI game creator shell Rust crates (pull_request) Successful in 6m0s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m43s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m42s
Project CI / Frontend tests (pull_request) Failing after 1m16s
Project CI / Backend tests (pull_request) Successful in 8m51s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m34s
Project CI / Repository checks (pull_request) Successful in 5m34s
Project CI / Native shell tests (pull_request) Successful in 7m18s
# Conflicts:
#	docs/project-memory/shared-memory/decision-log.md
2026-10-06 10:14:15 +08:00
k88936 febbdd59d5 Merge branch 'feat/pricing-plan-fix' into feat/pricing-plan 2026-10-06 10:12:41 +08:00
suzmii 0d0166c2d9 feat(游戏共创): 后台读取主题成员名单(含草稿/归档主题与不可见成员 + 可见性列)
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 / 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 Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
缺口:后台原先只能借**公开投影** `GET /api/game-distribution/themes/{themeId}` 列成员,而公开投影只服务
`published` 主题 ⇒ **草稿 / 已归档主题在后台看不到成员名单**,运营没法在发布前核对。

新增 `GET /admin/api/game-distribution/themes/{theme_id}/members?limit=&cursor=`:

- **鉴权照既有两层**:路由挂既有 admin 支的 `route_layer(require_admin_auth)`,handler 取
  `Extension<AuthenticatedAdmin>`(未登录/失效 → 401 `UNAUTHORIZED`、非 admin → 403,同组同码同形);
  模块侧 procedure 先跑 `require_editor_generation_runtime_service_identity`(照 `033e3aa79` 五条写接口)。
- **返回全部成员行,不套公开可见性过滤**,且**不要求主题已发布**(`draft` / `archived` 照常可读;
  只有主题真的不存在才 404 `THEME_NOT_FOUND`)。响应:
  `{ themeId, totalMembers, members: [{ rootGameId, title, sortOrder, createdAt, visible, visibility }], nextCursor }`。
- **两个可见性字段刻意独立**:
  · `visible` = 「公开侧此刻会不会出现」,**复用** `game_distribution_theme_member_visible`(未删 + 已公开
    + 有当前公开版本),不另写第二套判定;
  · `visibility` = 更细状态(新纯函数):游戏行不存在 → `missing`(优先于 `deleted`),软删除行 → `deleted`,
    否则原样透传游戏行 `visibility`(`published` / `unpublished` / `suspended`)。
    因此 `visibility == "published"` 但无当前公开版本时 `visible = false` ——运营能看出「公开了但没公开版本」;
    三处钉住这个组合(纯函数单测、api-server payload 单测、事务结构断言)。
- **排序与分页照既有口径**:复用 `sort_theme_members`(`sort_order` 升序 + 成员 id 兜底)+ 新增
  `page_admin_theme_members`;`limit` 缺省 20 / 上限 50 / `0` 取默认 / 超界截断(同一归一化);
  游标 `"{sortOrder}:{memberId}"`,解析**只委托** `parse_game_distribution_theme_cursor` ⇒ 非法游标仍是
  上一轮刚修好的**可达** `THEME_INVALID_CURSOR`(不另造一个不可达码);`totalMembers` 是成员**行**总数,
  切页前算,不受分页影响。
- **契约与登记**:`packages/shared/src/contracts/gameDistribution.ts` 新增
  `GameDistributionAdminThemeMemberRow` / `…ListResponse` / `…MemberVisibility`;parity 登记
  `TS_ONLY_TYPES` +3、`RESPONSE_BUILDERS` +2(列表响应与单条成员各一条,条目形状有独立证据);api-server
  用命名构建器(不内联 `json!`)。
- **测试**:module-game-distribution +5 条纯函数(`missing` 优先于 `deleted`、三类不可见各一条并断言
  `visible`/`visibility` 组合、`published` 无公开版本 ⇒ `visible=false`、游标委托共享实现、翻页不重不漏、
  末页 null、复用共享比较器与同一归一化);spacetime-module +1 并扩 2(结构断言:走主题索引、不套公开可见性
  过滤、不复用「只取可见成员」的助手、不自写排序、不删行、`totalMembers` 在切页前取);spacetime-client +1
  mapper(行总数与游标透传、两个可见性字段不互相推导、空名单是正常结果);api-server 例(401/403、草稿主题
  可读、含不可见成员仍返回、`totalMembers` 不受分页影响、limit 缺省与截断、非法游标 → 400 `THEME_INVALID_CURSOR`、
  主题不存在 → 404)。
- **文档**:技术方案 `§3.10.8`(新行 + `visible`/`visibility` 语义 + 「草稿也能读」的理由)与 `§3.4` 后台接口表;
  里程碑(后台路由清单、实施清单、验收与测试清单,原「只能借公开投影」的留白项标记为已落地)。
- **生成绑定**:新增 4 个 `admin_theme_member_list*` / `list_admin_…_procedure` 生成文件 + `module_bindings.rs`
  入口;wire format 有新增(新 procedure/结果类型)⇒ 部署需重新 publish 模块。

门禁:wasm build 0;`cargo check --all-targets` 0;`cargo test -p api-server game_distribution` **89 passed**;
`cargo test -p module-game-distribution` **106 passed**;`cargo test -p spacetime-module` **287 passed** / 1 ignored;
`cargo test -p spacetime-client` 39 passed;DTO parity 0(58 组 / **17** 构建器 / **15** 手拼类型);
`check:spacetime-schema` 0(96 tables);`check:encoding` 0(5424 files);`cargo fmt --all -- --check` 0;
`git diff --check` 0。

不在本提交内(属另一个 session 的文件,工作区里由我的子代理顺带做了**纯新增性**改动,未提交):
`apps/admin-web/src/api/adminGameThemeTypes.ts` 增加了三个指向共享契约新类型的别名 + 一段注释 —— 与该 session
「登记好之后改回引用共享契约」的计划一致,交由其 review / 提交(或直接删掉其本地重复定义)。
2026-10-06 04:28:39 +08:00
suzmii ce614d59c1 feat(游戏共创): 主题详情 rootsTruncated 信号(memberCount 报真实可见成员数)
Project CI / AI game creator shell Rust crates (pull_request) Successful in 6m1s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 7m10s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m58s
Project CI / Backend tests (pull_request) Successful in 9m10s
Project CI / Frontend tests (pull_request) Successful in 2m58s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m32s
Project CI / Native shell tests (pull_request) Successful in 6m37s
Project CI / Repository checks (pull_request) Successful in 4m55s
裁定(与族谱 `truncated` 同约定):`memberCount` = **真实可见成员数**(不受展示上限污染),新增布尔
`rootsTruncated`,**仅当 `roots` 被 50 上限截断时为 true**。此前两个数被同一个 50 上限截断 ⇒ 可见成员
> 50 时静默截断,客户端既看不到全部树、也拿不到任何信号。

- 纯函数:`game_distribution_theme_roots_truncated(visible_member_count, returned_root_count)`
  (相等 / 回传更多 ⇒ false;后者是防御性口径:两组数字不同源时不得凭空报「还有更多」)。
- 契约:`GameDistributionThemeDetail` 加 `roots_truncated`(serde camelCase ⇒ `rootsTruncated`),
  TS 镜像同步;parity `public_theme_detail_payload.mustEmit` 6 键 → **7 键**。
- 事务:`member_count` 走可见成员清单的 `len()`(**不再**经 `page_theme_members` 与上限),`roots` 仍是
  同一清单排序后取前 50,`rootsTruncated` 由纯函数算出(不写死「>50 就 true」——阈值与上限是两个
  独立事实);列表入口共用同一计数函数 ⇒ 同一主题在列表与详情里不会报出两个 `memberCount`。
- api-server:`public_theme_detail_payload` 增加 `rootsTruncated`;形状单测 6 → 7 键,并加
  `memberCount=120 / roots=1 / rootsTruncated=true` 用例,证明两个键口径独立。
- 结构断言同步修正:列表侧原「成员数与 roots 共用同一上限」改为「成员数数的是全部可见成员(断言
  源码里不含切页函数与上限常量)」;详情侧改为「必须调用共享纯函数 + 不得再恒等 `roots.len()` +
  该字段必须进入返回值」。
- 生成绑定:`module_bindings/game_distribution_theme_detail_result_type.rs` 手改后用临时 out-dir 重跑
  `spacetime generate --lang rust` 逐字节校对一致。**wire format 变更 ⇒ 部署需重新 publish 模块**
  (客户端绑定已同步)。
- 文档:技术方案 §3.4 / §3.10.6 / §3.10.9(原「已知限制·三个备选待拍板」→ 已定口径)、里程碑
  (依赖、接口表、验收标准、纯函数表、测试清单、待确认项)、以及数据契约文档里那句「主题详情的
  roots 与列表的 memberCount 永远一致」(本改动已使其为假)。

门禁:wasm build 0;`cargo check --all-targets` 0;`cargo test -p api-server game_distribution` 86 passed;
`cargo test -p module-game-distribution` **101 passed**;`cargo test -p spacetime-module` 286 passed /
1 ignored;DTO parity 0(58 组 / **15** 构建器 / 12 手拼类型);`check:spacetime-schema` 0(96 tables);
`check:encoding` 0(5420 files);`cargo fmt --all -- --check` 0;`git diff --check` 0。

遗留(不在本仓可改范围,需前端 session 跟进):`src/services/gameDistributionClient.ts` 有自己一份主题
详情本地类型与 normalize,会丢弃 `rootsTruncated`(约 3 行小改),因此网页主题页暂时拿不到截断信号;
admin-web 走共享契约类型,后台侧即时生效。
2026-10-06 04:09:45 +08:00
suzmii 09a1cf5497 docs(游戏共创): 共创主题文档回填(§3.4 接口表 / §3.10 实现状态 / 里程碑 Status 与验收)
Project CI / AI game creator shell Rust crates (pull_request) Successful in 5m57s
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
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 / Native shell tests (pull_request) Has been cancelled
服务端三块(`2fa201e0d` 模型与纯函数、`742723a58` 公开读、`033e3aa79` 后台写)已落地,本次把文档从「只落设计」补齐到「服务端已实现」,并写死一条已知限制。

- **技术方案 `§3.4`**:新增 5 条接口行(真实路由/鉴权/错误码/字段名均以 `git show` 核对代码为准,非猜测)——公开 `GET /api/game-distribution/themes`(匿名 + `no-store`;只含 `published`;limit 缺省 20 / 上限 50 / 超界截断;游标 `"{createdAtMicros}:{themeId}"`;非法游标 400;末页 `nextCursor: null`;`memberCount` = 公开可见成员数)、`GET /api/game-distribution/themes/{themeId}`(顶层扁平 `{themeId,name,summary,badge,memberCount,roots}`;`roots` 复用公开目录同一份投影;不存在/draft/archived → 404 不返回空壳;已发布空成员 → 200 + 空 `roots`),以及 `GET /games/{gameId}` 的 `themes` 增量(匿名与登录都发、空数组恒发;先取根再按根反查 ⇒ 第 N 代作品也能跳主题页);后台 5 条(`require_admin_auth` + `AuthenticatedAdmin`,未登录/失效 401 `UNAUTHORIZED`、非 admin 403;创建与编辑要求 `Idempotency-Key`,同键重放 `replayed: true`、同键换请求 409 `THEME_IDEMPOTENCY_CONFLICT`;成员增删**不要求**幂等键(确定性主键天然幂等,删不存在也 200);非根成员 409 `THEME_MEMBER_NOT_ROOT`;后台列表含 draft/archived、limit 缺省与上限 200、无游标;`theme_id` 服务端生成 `theme-{uuid}`)。
- **`§3.10`**:各小节「本轮实现 / 留白」标注更新为现状(服务端已实现;公开前端与后台 UI 仍留白);`§3.10.6`/`§3.10.9` 明确写下**已知限制**——主题详情 `roots` 沿用页上限 **50** 且 `memberCount == roots.len()`,可见成员 > 50 时会**静默截断且没有「还有更多」标志**,三个备选(去上限 / 给成员加游标 / `memberCount` 报真实可见数)待拍板,本轮不改契约。
- **`§7`**:第 3 条(共创主题)改为「设计已采纳 + 服务端已实现」,仍待拍板收敛为两条:① 主题级排序口径(公开列表当前按 `created_at` 倒序 + `themeId` 兜底;若要按运营 `sort_order` 展示需改游标格式并同步前端);② 上述 `roots` 50 上限行为。
- **里程碑文件**:`Status` 由 `proposed` → 「服务端已实现(附四个提交号);公开前端与后台管理 UI 待做」,Version 1.0 → 1.1,新增「已落地提交」行;实施清单 A–F 标注已落地提交、G 标未做(待前端)、H 分「已落地层 / 未做层」、I 补执行状态;**验收标准勾 17/19**(第 17 条公开前端、第 18 条 SPA 路由门禁留空并注「等前端」);文末写明「dev 栈端到端整链未跑(`scripts/check-game-distribution-theme-e2e.mjs` 未创建),依赖真实库存的运行时分支目前只到单元/结构/映射层」。
- **数据契约文档**:两张主题表小节的「写入路径属后续里程碑」改为现状(读/写 procedure 与事务名),表结构描述未动。
- **门禁**:`check:doc-index` 0(252 份 Markdown,current=121 / historical=15 / review=1);`check:encoding` 0(5414 files);`git diff --check` 0。
- **环境限制(标注,非绿)**:`check:generated-bindings` 本机 `EXIT=1`,原因是 `apps/ai-game-creator-shell/src-tauri/build.rs:167` 校验随包资源时缺 `bin/win-x64/agc_godot_editor.dll`(需先跑随包资源准备步骤)——纯环境前置,与本次只改 `docs/**` 无关;该检查的 AGC 段本地从来跑不了(CI 绿)。
2026-10-06 03:38:11 +08:00
suzmii d18998b712 文档:修正买断制合同章的定价预填口径、AGC 定价证据与后台落点
Project CI / AI game creator shell Rust lane 1/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
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
- docs/【玩法创作】平台入口与玩法链路-2026-05-15.md:583 入口预填规则由「预填当前价格与模式」改为「最新版本冻结价优先、缺失或为 0 时回落作品行当前价、都取不到按免费(0)」
- 同文件:595 定价与冻结段写明实际预填口径(最新版本冻结价可能是 pending_review/rejected 版本价)并补实现落点:AGC 壳 game_distribution_publish.rs:811、网页 GamePublishPage.tsx:164、后端 version_detail_payload
- 同文件:638 补 game_purchase 后台文案落点:api-server/src/admin.rs(wallet_ledger_source_type_to_string 与后台统计消耗白名单)已补齐,接口侧文案见 runtime_profile.rs,钱包消耗口径落在 spacetime-module runtime profile 统计
- 同文件:648 AGC 定价证据由「待补」改为已覆盖:发布面板 Vitest :333/342/802/819、请求层 Vitest :180/197、预填口径 Rust 单测 :1715;未覆盖项为 AGC 真实栈手点一次发布付费版本
- 同文件:658 运行时证据改为稳定口径:最近一次人工运行 76 PASS / 0 FAIL / 1 WARN 及唯一 WARN 说明,去掉 exit 0 / 耗时 / teardown 等易变且无留痕的表述
- 核对后确认无需改动:里程碑 front-matter Status 已是 implemented-awaiting-runtime-acceptance,AGC 定价 checkbox 保持未勾选且已列未覆盖原因;docs/README.md 由前一提交改好
2026-10-06 02:04:27 +08:00
suzmii 2fa201e0dc feat(游戏共创): 共创主题(一)数据模型与领域纯函数
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m30s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m12s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m44s
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
按 `docs/【技术方案】游戏共创与作品Fork-2026-10-03.md §3.10` 与里程碑《共创主题与作品树-2026-10-06》的清单 A/B/F 落地(本块**不含** procedure / 路由)。

- **表**:`game_distribution_theme`(`theme_id` 主键、`name`/`summary`/`badge`/`sort_order`/`status ∈ draft|published|archived`/`created_by_user_id`/`created_at`/`updated_at`)+ `game_distribution_theme_member`(确定性主键 `member_id = "{theme_id}:{root_game_id}"`,`theme_id`、`root_game_id` 各具名 btree 索引,`sort_order`、`created_at`);归档 / 下架只改公开投影,不删成员行。`migration.rs` 白名单登记两张表(随迁移导出/导入)。
- **生成绑定**:4 个 `game_distribution_theme*` 生成文件 + `module_bindings.rs` 入口(纯追加)。生成时**不覆盖工作树**(本仓共享工作树禁止 git 写命令):先 `spacetime generate --lang rust --out-dir <仓外临时目录>`,rustfmt 后只拷回本次相关文件,避免上一轮踩过的「rustfmt 漂移把别人文件一起改」。
- **领域纯函数**(`module-game-distribution/src/theme.rs`,风格照同目录 `collection.rs`):状态合法/公开可见判定、`game_distribution_theme_member_id`、成员可见性(**委托** `collection.rs` 的判定,不复制第二套)、`game_distribution_theme_root_acceptable(has_lineage_row)`、页大小(缺省 20 / 上限 50 / 0 取默认 / 超界截断)、游标编解码(`"{createdAtMicros}:{themeId}"`,Err 文案「主题列表游标格式无效」,已核对不含 404/409 关键词)、`sort_public_themes`(`created_at` 倒序 + `theme_id` 兜底)、`page_public_themes`(排序 → retain 游标之后 → 多取一条判 has_more;**先过滤再切页**的顺序语义写进文档注释)、`sort_theme_members`(`sort_order` 升序 + `member_id` 兜底)与 `page_theme_members`。
- **契约**:`shared-contracts` 新增 `GameDistributionThemeStatus` / `GameDistributionThemeReference` / `GameDistributionThemeSummary` / `GameDistributionThemeListResponse` / `GameDistributionThemeDetail` / `GameDistributionCreateThemeRequest` / `GameDistributionUpdateThemeRequest` / `GameDistributionUpsertThemeMemberRequest`,`GameDistributionGameSummary` 追加可选 `themes`(按 `collected` 先例只在详情路径下发);TS 镜像同步;parity 登记 **58 组**(响应构建器待路由落地后再登记,parity 要求函数真实存在)。
- **数据契约表目录**:补两张表小节,94 → **96**。
- **测试**:`theme.rs` 16 个单测(成员 id 确定性、状态三态与公开可见、成员可见性逐格与收藏判定等价、根判定、页大小边界、游标往返与非法输入、排序稳定性与同 `sort_order` 兜底、分页不重不漏)。
- **门禁**:wasm build 0;`cargo check --all-targets` 0;`cargo test -p module-game-distribution` **97 passed**;`cargo test -p spacetime-module` 274 passed / 1 ignored;DTO parity **58 组**;`check:spacetime-schema` 0(**96** tables);`check:server-rs-ddd` 0;`check:encoding` 0(5388 files);`cargo fmt --all -- --check` 0;`git diff --check` 0(8 个改动文件 0 删除行)。
2026-10-06 01:46:23 +08:00
suzmii 063c04a1b3 docs(游戏共创): 共创主题设计定稿(§3.10 + 里程碑《共创主题与作品树-2026-10-06》)
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
需求形态(飞书):共创 Tab 下有多个「共创主题」,点进去是一棵(或一组)作品树;**主题由平台/运营命名,不由根作品决定**;作品在游戏 Tab 里仍作为独立作品展示,详情页有 Fork 入口并能看到 / 跳到对应主题页。本轮只落设计(不写业务代码),实施清单见里程碑文件。

设计要点与理由(详见 §3.10):
- 实体:`game_distribution_theme`(`theme_id` 主键、三态 `draft|published|archived`、`sort_order`、`badge`、`created_by_user_id`)+ `game_distribution_theme_member`(确定性 `member_id = "{theme_id}:{root_game_id}"`,`theme_id` / `root_game_id` 各具名 btree 索引)。
- **成员只允许根作品**:树查询 `/games/{id}/lineage` 按根聚合,否则同一棵树会在主题页里出现多次(去重/高亮打架);代价=要挂就挂它所属的根。跳到某一代节点属 UI 层(族谱页已有 `from` 高亮)。
- **允许跨主题多归属**:主题是运营叙事,「平台精选」「双人合作」会同时收录同一个根;确定性主键只保证**同一主题内**不重复。代价=作品详情要返回多值、运营需知悉。
- **树直接复用 `/games/{id}/lineage`**,主题侧**不重建**任何树查询/树整形(没有第二套可见性/排序可漂移);主题详情只返回成员根清单(N+1 本轮接受,批量树端点留白)。
- 可见性:公开侧只见 `published` 主题;成员只出现公开未删且有当前公开版本的根(**投影跳过但不删行**,重新公开自动回来);主题不存在/未发布 → **404**;已发布但可见成员为空 → **200 + 空成员列表**。
- 公开三接口:`GET /themes`(游标分页沿用默认 20/上限 50/非法 400/末页 null)、`GET /themes/{theme_id}`(+ `roots`)、作品详情 `themes` 增量(**先取该作品的根、再按根反查**,因此第 N 代作品也能跳到主题页)。
- 后台五接口(创建/编辑/增删成员/后台列表,均幂等),鉴权**复用既有 `require_admin_auth` + `AuthenticatedAdmin`**,不自造;后台 UI 不在本轮。
- 留白 5 项(各写不做理由与将来接法):主题封面图、slug/URL 别名、埋点统计、跳到某一代的高亮、批量树端点。
- 同步收敛:§6 里程碑表 M4 行指向新里程碑;§7 第 3 条「共创主题」从**待拍板**改为**已拍板采纳**,并把「主题级排序口径」留作唯一待产品确认项。

门禁:`check:doc-index` 0(252 份 md;新里程碑在 `plans/` 下免分类);`check:encoding` 0(5383 files);`git diff --check` 0。

注:§3.10 的前约 200 行因共享工作树/索引,被上一提交 `f703bc49d`(注释修正)一并带上;本提交补齐其余章节 + 里程碑文件。
2026-10-06 01:35:56 +08:00
suzmii f703bc49d4 docs(游戏共创): 修正收藏幂等注释与实现不符之处(换用户不是 409)
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
端到端实测(`scripts/check-game-distribution-collection-e2e.mjs`)发现注释与实现不一致,**行为本身无缺陷,改的是注释**:

- `api-server/src/modules/game_distribution.rs:1389-1396`(`collection_request_digest` 文档注释):原写「同一个 key 撞到不同作品 / 不同用户」都被判成同键不同请求(409)。实际只有**换作品**是 409;**换用户**不会命中彼此收据(收据键 `(user_id, action, idempotency_key)` 本身含 `user_id`),两个用户各走各自的新请求、正常 200。已改写为「换作品 → 409;换用户 → 200 各自成功」,并注明这条注释曾写错。
- `api-server/src/modules/game_distribution.rs:1404-1408`(`collect_game` handler 幂等说明):同上(原文「同键不同请求(换作品 / 换用户)是 409」)。
- `api-server/src/modules/game_distribution.rs:7896-7897`(测试 `collection_request_digest_binds_user_and_game` 的描述):补上「换作品 → 409 / 换用户不会(收据按用户隔离)」;**断言未改**(它只断言摘要对两维度敏感,本来就与实现一致)。
- `docs/【技术方案】游戏共创与作品Fork-2026-10-03.md:339`(`§3.4` 接口表同一句话):同一口径修正。
- `module-game-distribution/src/collection.rs:173`:把易被误读为「客户端 Idempotency-Key」的注释改为明确的「主键派生必须对两个维度都敏感」,并说明与幂等收据的键无关。

`spacetime-module/src/game_distribution.rs:4717-4719` 的注释本来就与实测一致(「不同用户 / 不同作品即使共用同一个 Idempotency-Key 也不会互相命中」),未改。

门禁:`cargo check -p api-server --all-targets` 0(仅既有 1 warning);`cargo test -p api-server collection` 7 passed;`cargo fmt --all -- --check` 0;`check:encoding` 0(5382 files);`git diff --check` 0。

遗留(非本人文件,未改):`scripts/check-game-distribution-collection-e2e.mjs:32-34,537` 的说明文字仍在描述「api-server 注释与实测不一致」,现已一致,需该脚本作者同步(归另一会话)。
2026-10-06 01:34:35 +08:00
suzmii f09607d903 feat(游戏共创): 收录(收藏)列表补真分页(cursor + limit)
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
- 纯函数(`module-game-distribution/src/collection.rs`,与收藏另两条规则同文件):`encode/parse_game_distribution_collection_cursor`(`"{created_at_micros}:{collection_id}"`,复用仓库既有 `"{micros}:{id}"` 惯例;非法 → Err「收藏列表游标格式无效」→ 400)、`game_distribution_collection_page_limit`(0/缺省 → 20,超界 → 50)、`game_distribution_collection_page`(稳定全序排序 → 跳过游标之前 → 取 limit → 多取一条判 has_more,只对页内最后一条编码下一游标)
- 排序与顺序语义:`created_at` 倒序 + `collection_id` 升序兜底(主键、同用户内唯一 ⇒ 全序,翻页不重不漏);**先按可见性过滤、再排序切页**——游标位置必须落在已过滤序列上,否则被过滤的行会让下一页漏项(推理写进 tx 与纯函数注释);snapshot 只对最终页成员计算
- 模块:list 的 input 增 `limit` / `cursor`,result 增 `next_cursor`;api-server `my-collections` 加 `Query<MyCollectionsQuery>`,默认 20 / 上限 50(网格一屏 vs 单响应体积;与后台列表的 200 口径不必相等,理由写进注释),超界**截断**不报错,非法游标 400 透传不吞,日志带 `has_more`
- 契约:Rust DTO 增 `next_cursor`、TS 镜像同步、parity 登记(50 组一致)
- 文档:§3.4 的 `my-collections` 行补分页语义(默认/上限/游标格式/非法 400/末页 null/排序口径)
- 测试 13 条:纯函数 8(不足一页 → None;恰好整页不产生空游标;5 条 limit=2 连翻 3 页不重不漏;同 `created_at` 用 `collection_id` 兜底;limit=0 与超界;游标往返 + 7 种非法输入)、模块事务结构 2、api-server 3(默认与截断、`nextCursor` 透传、非法游标 → 400)
- 门禁:wasm build 0;`cargo check --all-targets` 0;`cargo test -p module-game-distribution` **81 passed**;`cargo test -p api-server game_distribution` **73 passed**;`cargo test -p spacetime-module` 274 passed / 1 ignored;DTO parity **50 组**;`check:spacetime-schema` 0(94 tables);`check:encoding` 0(5382 files);`cargo fmt --all -- --check` 0;`git diff --check` 0
2026-10-06 01:31:09 +08:00
suzmii 4b1f24a8fc feat(游戏共创): 收录(收藏)契约与文档同步(块 3/3)
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 1/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 / Repository checks (pull_request) Has been cancelled
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
- `shared-contracts`:新增 `GameDistributionCollectionState { collected, replayed: Option<bool> }` 承载 PUT/DELETE 共用形状(PUT 才发 `replayed`);既有 `GameDistributionGameSummary` 增 `collected: Option<bool>`(公开详情登录时才带)——该类型只被 api-server 测试与 `GameDistributionListResponse` 引用,加字段不影响任何现有发送方
- `packages/shared` TS 镜像同步(`{ collected: boolean; replayed?: boolean }` 与 `GameDistributionGame.collected?: boolean`),并按既有约定登记进 `scripts/check-game-distribution-dto-parity.mjs`(PAIRS + 手拼响应构建器);注意 `json!` 字面量里不插注释行(parity 脚本抓顶层键时不剥注释,这个坑今天踩过一次)
- 技术方案:`§2.4` 入口矩阵补「收藏按钮 / 我的收藏(登录)与我的作品页同行风格」;`§3.4` 接口表补三条路由(含 404/409 语义、PUT 要求幂等键而 DELETE 不要求及理由、`my-collections` 只含公开作品且不删行)与公开详情 `collected` 的可见性口径;`§7` 把「收录/收藏」从范围外移除并标注已纳入落地
- 数据契约表目录:新增 `game_distribution_collection` 小节(主键确定性、两个索引、为什么不删行、为什么不建唯一索引),供 `check:spacetime-schema` 守卫通过(94 tables)
- 门禁:DTO parity 0(**49 组** Rust/TS 一致,较本轮前 +7);`check:spacetime-schema` 0(94 tables,对照新 merge-base `51cb05f4`);`check:encoding` 0;`git diff --check` 0
2026-10-06 01:14:05 +08:00
suzmii 57ae4d5251 Merge remote-tracking branch 'origin/master' into fix/agc-composer-layout
合并 master 51cb05f41(创作者主页 / 关注链路等):保留双方条目
- docs/project-memory/shared-memory/pitfalls.md 冲突:本分支 2 条(2026-10-05 PR #607 复核修复 / 模型菜单共享样式面)在前,master 新增 2 条(自定义作者插槽昵称降级 / 页面返回兜底不新增历史)紧随其后,其余各节原样保留
- 其余文件自动合并(master 侧的 CreatorControls / GameCard / creator 服务与本分支不重叠)
- 顺带修本分支行为:模型状态文案改走底部 toast 后,conversationModelSelect.test.tsx 两处同步 getByText 改成 await findByText(toast 是 portal 的异步更新,同步查询在慢机上会竞态)
2026-10-06 00:34:02 +08:00
suzmii 959ed4fd53 合并 origin/master(51cb05f41,22 个提交)到 feat/game-purchase
- 逐块合并 server-rs/crates/api-server/src/modules/game_distribution.rs:以 master 的 ReleaseAssetResponseInput / 5 参 release_asset_response_with_cache / ETag / 304 / gzip 结构为准,并在其上保留本分支的付费 404 守卫(price_mud_points > 0 仍在 release_package_bytes 读包之前返回);播放会话资源响应改用同一结构(etag None、cache_control no-store、沿用 accept-encoding 协商)。
- 合并 src/components/game-distribution/GamePlayPage.tsx:接入 master 的共享 PlatformGameLoadingSurface 与 PLATFORM_GAME_LOADING_TIMEOUT_MS,删除本地重复常量 GAME_PLAY_STARTUP_TIMEOUT_MS 与裸 div,买断制播放会话准备态改由共享加载面承载。
- 合并 src/components/game-distribution/GameDetailPage.tsx:同时保留 master 的 onOpenCreator 作者插槽与本分支的买断制购买弹窗、onOpenRecharge 充值入口。
- 合并 vite.config.ts:保留 master 的 /api/creators 代理,并保留 play-sessions 前缀清 Cookie 规则(顺序仍在通用 /api/game-distribution 之前)。
- 合并 deploy/nginx/README.md:保留 master 的 SPA allowlist 门禁口径(含 /creators、/creators/connections)与本分支的播放会话前缀章节;三份 nginx 模板的 ^~ play-sessions location 与清 Cookie 原样保留。
- 合并 apps/admin-web/src/pages/AdminGameDistributionReviewPage.test.tsx:保留 master 的加载面/超时用例与本分支的审核价格(冻结价优先、历史按 0)用例。
- 合并 src/components/game-distribution/GameDistributionPages.test.tsx:保留双方 mock,并新增「付费作品在会话签发期间显示共享加载面」用例。
- 合并 docs/【玩法创作】平台入口与玩法链路-2026-05-15.md(保留买断制合同并回填 master 的创作者主页与关注粉丝合同)、decision-log.md、pitfalls.md:追加双方条目,不改写任一侧正文。
- 保留 master 侧新增能力:release_asset_etag / if_none_match_matches / accepts_gzip_encoding / gzip_release_asset / release_asset_not_modified_response、SPA 加载面、创作者主页与关注粉丝(user_follow 表、creator 查询与 author_id 过滤)。
2026-10-06 00:28:36 +08:00
suzmii bdcefe91d1 Merge remote-tracking branch 'origin/master' into feat/game-fork
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m31s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m20s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m3s
Project CI / Frontend tests (pull_request) Successful in 2m54s
Project CI / Backend tests (pull_request) Successful in 7m36s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m26s
Project CI / Repository checks (pull_request) Successful in 6m25s
Project CI / Native shell tests (pull_request) Successful in 9m34s
# Conflicts:
#	deploy/container/nginx.conf
#	deploy/nginx/genarrative-dev-http.conf
#	deploy/nginx/genarrative.conf
#	server-rs/crates/api-server/src/modules/game_distribution.rs
#	src/components/game-distribution/GameDetailPage.tsx
#	src/components/game-distribution/GameDistributionPages.test.tsx
#	src/components/platform-entry/PlatformEntryActiveFlowShell.tsx
2026-10-06 00:19:40 +08:00
suzmii 870d6457bc 输入区工具条改回唯一一行:润色钮并入工具条,nowrap + 实测 min-width
Project CI / Backend tests (pull_request) Failing after 26s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 5m45s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m30s
Project CI / Repository checks (pull_request) Failing after 14s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m4s
Project CI / Frontend tests (pull_request) Successful in 2m51s
Project CI / AI game creator shell web tests (pull_request) Failing after 4m12s
Project CI / Native shell tests (pull_request) Successful in 10m32s
- 口径:工具条只允许一行——`@` / `+` / 「AI 润色 / 恢复原文」/ 模型 / 语音 / 发送 六颗控件平铺,任何面板宽下都不换行、不堆叠、不重叠;宽度不够时按 `min-width` 横向溢出可见,发送钮仍在可视区内
- 换行来源(首轮为「避免重叠」加的 wrap):styles.css:11893 `.project-chat-composer-controls`(6 类)`flex-wrap: wrap`、styles.css:11933 `.project-chat-composer-controls-left` `flex-wrap: wrap`、styles.css:13747 `.conversation-model-select` `flex-wrap: wrap` → 三处都改 `nowrap`;左组补 `flex: 0 0 auto`(固定 28px 动作钮不参与收缩,否则槽位被压窄会把润色钮挤到模型钮上)
- 润色钮进工具条:`ResourceReferenceInput` 新增 `actionsPortalTarget`(portal 目标,不传时行为不变,策划面照旧),`DirectProjectComposer` 在左组 `+` 之后放挂点 `.project-chat-composer-controls-actions` 并传入 → 空输入态不再为它留一行;输入盒第二行只剩「润色状态」(无内容时 0 高,`gap` 的 row 分量 6→0、状态自带 `margin-top: 6px`)
- min-width 算式(落到两个元素):控件排 `.project-chat-composer-controls` = `@`28 + `+`28 + 润色28 + 模型钮 64(`min-width: 64px`,名字省略号)+ 语音28 + 发送28 = 204,加 5×8px 列间距 = 244,再留 8 余量 → **252px**;外壳 `form.project-chat-composer.is-direct-codex` = 252 + 左右内边距 12×2 + 边框 1×2 → **278px**。夹具实测:自然宽度 290.4、七档(240…900)控件 `top` 差值 ≤1px、两两相交 0 处、`outsideControlsRow` 空
- 低于 min-width:外壳保持 278px、**内容按自身宽度溢出可见**(面板与 composer 都不裁切,选它而不是给工具条 `overflow-x: auto` 是因为工具条里挂着模型菜单浮层,加滚动容器会把它裁掉——#600 的老问题);240px 实测发送钮 rect 仍在窗口内且 `elementFromPoint` 命中它
- 测试:`chatDialogFrameLayout.test.ts` 新增「工具条只有一行…」——七个宽度下 `flex-wrap` 必须 `nowrap`(右组本来就不换行)、控件排 `min-width: 252` / 外壳 `min-width: 278`、组件源码里润色钮渲染在控件排之后的挂点;最高高度算式按新结构更新为 222。**改前红已记录**:把三个源文件 stash 回旧实现后单跑,`240px 下工具条必须保持单行: expected 'wrap' to be 'nowrap'` 与 `expected 228 to be 222` 两条同时红
- 校验:`npx vitest run tests/appSurface.test.ts tests/chatDialogFrameLayout.test.ts` → **225 passed / 9 skipped**;`agc:typecheck` pass 3 / fail 0;eslint、prettier、encoding 5280 files、spacetime-schema 91 tables、`git diff --check` 全绿;对照图与 PR 正文已更新

Refs #600, PR #607
2026-10-06 00:19:17 +08:00
lhk229 51cb05f418 补充创作者主页与关注粉丝工程文档 (#638)
Project CI / AI game creator shell Rust crates (push) Successful in 5m56s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 6m36s
Project CI / AI game creator shell Rust lane 1/2 (push) Successful in 7m37s
Project CI / Backend tests (push) Successful in 9m22s
Project CI / Frontend tests (push) Successful in 4m40s
Project CI / AI game creator shell web tests (push) Successful in 3m50s
Project CI / Repository checks (push) Successful in 6m30s
Project CI / Native shell tests (push) Successful in 8m32s
本 PR 补齐创作者主页与关注粉丝功能的产品合同和工程设计,供后续按里程碑实施;本次只修改文档。

桌面导航第四项进入自己的创作者主页,“我的”移到第五项。游戏详情可进入作者主页并关注/取消关注;自己或他人的关注、粉丝列表均公开可查看,点击用户头像或昵称可进入其主页。本人支持取消/重新关注、回关和移除粉丝,并明确两个关注方向独立。

工程设计包含关系表与 DTO、认证和事务边界、跨页状态同步、共享组件、深链及验收要求,拆分关系查询和页面交互两个里程碑。按用户要求,游戏列表沿用最多 48 项的现有限制,不增加游戏目录分页改造。

验证:
- 已合入最新 origin/master(21c79f54a);共享决策记录冲突保留双方新增内容。
- npm run check:encoding 通过。
- npm run check:doc-index 通过。
- git diff --check 与暂存差异检查通过。
- 相对 master 仅六份文档发生变化;没有业务代码或 schema 修改,未执行业务测试或部署。

Reviewed-on: #638
Co-authored-by: Linghong <ink29535@proton.me>
Co-committed-by: Linghong <ink29535@proton.me>
2026-10-05 22:05:11 +08:00
suzmii 342cc75d20 Merge remote-tracking branch 'origin/master' into fix/agc-composer-layout
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m59s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m17s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m38s
Project CI / Frontend tests (pull_request) Successful in 3m1s
Project CI / Backend tests (pull_request) Successful in 7m16s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m15s
Project CI / Repository checks (pull_request) Successful in 5m19s
Project CI / Native shell tests (pull_request) Successful in 7m2s
合并 master 96859666f(AGC 运行画面点选 #624 等):保留双方条目
- docs/project-memory/shared-memory/pitfalls.md 冲突:本分支 2 条(2026-10-05 PR #607 复核修复 / 模型菜单共享样式面)在前,master 新增 6 条(运行画面点选 ×5、Phaser 4 ×2)紧随其后,其余各节原样保留
- 其余文件自动合并(master 侧改动与本分支不重叠)
2026-10-05 21:01:39 +08:00
suzmii 3204758f34 模型不可用与模型状态一律走组件自带的底部 toast:删掉宿主分支
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m40s
Project CI / Backend tests (pull_request) Failing after 21s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m34s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m52s
Project CI / Repository checks (pull_request) Failing after 29s
Project CI / Frontend tests (pull_request) Successful in 2m54s
Project CI / AI game creator shell web tests (pull_request) Failing after 4m1s
Project CI / Native shell tests (pull_request) Successful in 9m1s
- 现象:`errorPresentation` 默认 `inline`,只有工作台那只传 `toast` + 宿主回调;首页/策划/画布的输入区里「模型服务不可用」还是**常驻占位文本**,不是浮层——同一个组件在不同宿主表现不一致
- 改法:浮层收进组件内部。新增 `components/common/composerNotice.ts`(模块级单例:`publishComposerNotice` + `useComposerNoticeHost`)与 `components/common/ComposerNoticeToast.tsx`(portal 到底部居中、6s 自动收起);`ConversationModelSelect` 与 `ComposerReasoningEffortSelect` 自己在失败/状态出现时报一条(各自去重:同一条只弹一次、清空后可再弹),失败 `tone="error"`、状态 `tone="neutral"`
- 单宿主:同一输入区里两个调用点只有一个真正渲染(编号最小的那个),保证同一时刻只有一条浮层、不会互相叠;输入区整体卸载时把待显示的提示一并丢掉,不留给下一个宿主
- 删宿主分支:`errorPresentation` / `onUnavailable` / `onNotice` / `noticePresentation` 四个 prop 与工作台宿主的 toast state / `pushModelNotice` / `pushModelStatus` 一并删除(grep 命中 0);任何宿主的输入区子树里都不再有常驻 `role="alert"` / `role="status"` 行
- 语义不变:不可用时发送仍禁用(`!modelReady`);文案仍是「模型服务不可用」;档位持久化通道不变
- 测试:新增「首页模型不可用与状态也走组件自己的底部 toast(子树不留常驻行)」;`design-agent.suite` 的推理档保存失败改成断言底部 toast + 控件子树无 `role="status"`;`chat-composer.suite` 的失败去重用例改成断言 toast 节点(同一条不重复弹、清空后再出现换新节点)

Refs #600, PR #607
2026-10-05 20:22:41 +08:00
suzmii 93de2a0d6c 文档:AGC 发布面板补齐买断制定价口径
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
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 / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
- 主规范「入口与边界」改为网页与 AGC 两个发布入口一致支持定价,并写明给已上线作品发新版本的预填规则
- 主规范「定价与冻结」补充发布新版本必须预填并保持现有价格、不允许因默认免费静默改价,定价 UI 由 packages/shared 共享组件承载
- 主规范「契约与迁移」补记 AGC 版本请求 priceMudPoints 字段与 #[serde(default)] 仅作旧客户端兼容的口径
- 主规范验收表新增「定价(AGC 入口)」行,AGC 侧证据标注待补及其来源
- 里程碑范围补上 AGC 发布面板定价,删除「不在范围内」的 AGC 后续切片条目
- 里程碑验收标准新增 AGC 入口复选框(保持未勾选并注明等待实现证据)
- 排障记录 pitfalls 把 AGC 按免费提交改为历史口径 + 现行口径,保留「改请求 DTO 必须同时编译 AGC 壳」的排障经验
- docs/README.md 合同/里程碑条目同步为两个入口一致并标注 AGC 证据待补
2026-10-05 20:04:43 +08:00
suzmii 8d8e74ca60 修复 AGC 壳版本请求缺少买断制价格字段导致的编译失败
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
apps/ai-game-creator-shell/src-tauri/src/game_distribution_publish.rs:构造 GameDistributionCreateVersionRequest 时补 price_mud_points: 0;AGC 发布面板没有买断制定价入口,显式按免费提交,与升级前行为一致。
docs/project-memory/shared-memory/pitfalls.md:新增排障记录——shared-contracts 请求 DTO 加字段后必须同时编译 AGC 壳(独立 cargo workspace),#[serde(default)] 不能救 Rust 结构体字面量,并写明正确的本地检查命令与既有的 CI lane。
2026-10-05 19:54:26 +08:00
k88936 a938a4ef9e 兼容(契约): 响应 DTO 新增字段一律可选默认
- ProfileMudPointBalanceResponse.monthly_points 缺省为 0
- ProfileMembershipResponse 的 cycleIndex / cycleCount / cycleKind 缺省 1 / 1 / yearly
- ProfileMembershipPlanResponse 的 recommended / unlimitedConcurrency 缺省 false
- ProfileRechargeCenterResponse.membershipPlans 缺省空数组
- 补「旧服务端缺字段仍可整包解析」契约测试,身份与状态字段仍保持必填
- 后端架构文档新增 shared-contracts DTO 变更规则,并同步团队约定
2026-10-05 19:37:48 +08:00
suzmii 96859666ff Merge pull request 'AGC 运行画面点选:canvas 玩法上识别 Phaser 4 / three.js 的已登记素材(#612)' (#624) from feat/agc-runtime-picking-engines into master
Project CI / AI game creator shell Rust crates (push) Successful in 5m29s
Project CI / AI game creator shell Rust lane 1/2 (push) Successful in 7m5s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 6m28s
Project CI / Backend tests (push) Successful in 9m14s
Project CI / Frontend tests (push) Successful in 4m4s
Project CI / AI game creator shell web tests (push) Successful in 3m36s
Project CI / Repository checks (push) Successful in 7m37s
Project CI / Native shell tests (push) Successful in 10m32s
Reviewed-on: http://git.genarrative.world/git/GenarrativeAI/Genarrative/pulls/624
2026-10-05 19:16:03 +08:00
suzmii 7d73a0a3ce 文档:pitfalls 新增段落的措辞改成中性口径陈述(去掉引述)
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 6m42s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m49s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m22s
Project CI / Frontend tests (pull_request) Successful in 3m20s
Project CI / Backend tests (pull_request) Successful in 8m37s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m12s
Project CI / Native shell tests (pull_request) Successful in 9m38s
Project CI / Repository checks (pull_request) Successful in 7m0s
- 2026-10-05 两条与 2026-10-04 两条里「用户口径是…」这类引述改成直接陈述(删点、视觉口径、首页强度区分两步收敛)
- 只改措辞与一处顺序说明,技术结论与实测数字不变

Refs #600, PR #607
2026-10-05 18:56:41 +08:00
suzmii df221f4eb9 收口评审 P2:点选条款限定引擎档、对象名上限入边界、素材 id 格式写入 skill
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m29s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m6s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m50s
Project CI / Frontend tests (pull_request) Successful in 3m26s
Project CI / Backend tests (pull_request) Successful in 7m48s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m3s
Project CI / Repository checks (pull_request) Successful in 7m15s
Project CI / Native shell tests (pull_request) Successful in 9m30s
- 功能说明第 8 条「命中区域裁剪在画布内」限定为引擎档,并说明 DOM 档仍是元素矩形;证据表对应行同步对齐
- 功能说明「边界与非目标」新增一条:引擎档对象名超过 40 字符按取不到处理(有意保留),宿主侧标签上限另为 120
- SKILL.md「运行画面点选契约」第 3 条补一句:素材 id 不含空白与路径分隔符(localAssetId 由客户端生成)
- skill-pack 指纹同步(agc-web-game-development version 2026-08-26.42 与 sha256)
2026-10-05 18:31:59 +08:00
suzmii 3145ef472e 合并 origin/master(21c79f54a)到 feat/game-purchase
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 2m28s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 3m52s
Project CI / AI game creator shell Rust crates (pull_request) Failing after 5m23s
Project CI / Repository checks (pull_request) Failing after 56s
Project CI / Frontend tests (pull_request) Successful in 3m7s
Project CI / Native shell tests (pull_request) Failing after 7m11s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m47s
Project CI / Backend tests (pull_request) Successful in 9m28s
- 冲突 docs/project-memory/shared-memory/decision-log.md:两侧都是在「# 决策记录」顶部新增条目,保留双份——本分支「2026-10-05 播放会话前缀在三处入口清空 Cookie」在前,master「2026-10-03 首页自动建项与 AI 项目命名解耦(Issue 599)」在后。
- 冲突 docs/project-memory/shared-memory/pitfalls.md:同为顶部新增条目,保留双份——本分支「2026-10-05 付费游戏播放会话前缀落在 /api/*」在前,master「2026-10-04 生成任务账本 taskType 维度与 v1 兼容」「2026-10-03 后台异步回填被进项目覆盖」在后。
- 其余逐处核对:master 本次只改了 apps/ai-game-creator-shell 与 docs(首页建项与 AI 命名解耦、AGC 标题栏项目标签、相关计划/记忆文档),与买断制付费功能文件无交集,全部吸收;master 未触碰 SpacetimeDB schema、钱包流水来源类型、游戏分发契约、边缘路由与生成绑定。
- 合并后回归核对:GameDistributionGame.price_mud_points 仍在结构体末尾且带默认值 0;migration 白名单仍含 game_distribution_purchase;RuntimeProfileWalletLedgerSourceType::GamePurchase(game_purchase)仍在。
2026-10-05 18:28:13 +08:00
suzmii 364b1aa342 Merge remote-tracking branch 'origin/master' into feat/agc-runtime-picking-engines
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
- 冲突解决(3 处):
  - agc-game-production-workflow/SKILL.md:双方都保留——第 4 条用本分支版本(含「运行画面点选契约」指针),第 5 条用 master 的新构建验证口径
  - agc-skills/manifest.json:先取 master 侧,再用 `agc:skill-pack:sync` 按合并后内容重新生成 version 与指纹(2026-08-26.41),`skill-pack:check` 通过
  - pitfalls.md:两侧新增条目全部保留(按日期倒序:本分支 10-05 / 10-04 条目在前,master 的 10-04 / 10-03 条目紧随,未改动任一方内容)
- 无冲突但人工核对:`agc-web-game-development/SKILL.md`(本分支「运行画面点选契约」小节 + master 内容都在)、
  `index.tsx`(我们的 `handleRuntimeInspectSelection` 回调体逐字不变,master 新增内容都在)
- 桥脚本 sha256 未变(9513020cfffa79128fb6355d44cdaabe666eefecbd96b7e807b15d2c4601bf76),真机证据对应字节不变
2026-10-05 18:25:49 +08:00
suzmii c32097ab18 回写游戏买断制泥点付费真实栈验收证据并删除实施计划
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
主规范合同章「验收标准与证据」表逐行回写真实本地栈 E2E 与单元/组件门禁结果,缺证据的覆盖边界如实标注未覆盖
主规范合同章补充说明运行时证据来自人工验收脚本 check:game-distribution-purchase-e2e(76 PASS / 0 FAIL / 1 WARN),不在 CI 自动门禁内
主规范合同章「实现约束与已知风险」新增 E2E 人工脚本不在 CI 覆盖、上线前私有桶 E2E_REQUIRE_PRIVATE_BUCKET 复核两条
主规范合同章表头删除已废弃的实施计划链接
里程碑验收复选框勾选已满足项并补证据说明,新增「未覆盖边界」保持未勾选(管理员安全下架会话失效、多账号/多游戏混合并发)并注明原因
里程碑「证据要求」补充已执行的人工验收结果与唯一 WARN 说明,Status 保持 implemented-awaiting-runtime-acceptance
删除 docs/project-memory/plans/【实施计划】游戏买断制泥点付费与播放鉴权-2026-10-05.md 并同步 docs/README.md 条目为已实现、E2E 76 PASS、待用户验收、未部署
2026-10-05 18:19:36 +08:00
suzmii f7d3652878 同步游戏买断制泥点付费与播放鉴权文档闭环
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
主规范路由表新增 POST /games/{gameId}/purchase 行,写明幂等键、请求体与余额不足/作者自购/管理员令牌/价格变化错误口径
主规范路由表新增 POST /games/{gameId}/play-session 行,写明付费需登录、免费回公开入口与 { playUrl, expiresAt } 响应
主规范路由表新增 GET /game-distribution/play-sessions/{token}[/{assetPath}] 行,写明凭令牌、不读 Cookie、no-store、失效一律 404
主规范路由表更新 GET /games/{gameId} 行,补充 priceMudPoints 与 purchased,付费未购买时 currentVersion.entryUrl 为 null
主规范路由表更新发行网关行,当前公开版本 price_mud_points > 0 时统一 404
主规范合同 Status 由 proposed 改为 implemented(本地验证通过,待用户验收;未部署)
主规范收口价格上限 1_000_000 与免购买范围(作者本人 + 后台管理员令牌),删除正文悬置措辞并注明日期
主规范补充播放会话进程内会话、始终解析当前公开版本两条实现约束,记录后台待审预览前缀未清 Cookie 的同类风险
里程碑 Status 由 proposed 改为 implemented-awaiting-runtime-acceptance
docs/README.md 该合同/里程碑/实施计划条目描述改为已实现、本机真实栈 E2E 通过、待用户验收、未部署
2026-10-05 18:12:10 +08:00
suzmii 9c350eeda5 删掉强度滑块的档位圆点;pointercancel 与「松手」同口径提交预览
- 用户口径:「你干脆把圆点删了吧,很丑…要做就做成几乎透明的」→ 按第一选择**删除**(不做半透明备选)
- 标记:`.project-chat-composer-strength-slider` 里那组 `<span class="project-chat-composer-strength-stops">` + 5 个点整体删除
- CSS:`space-between` 排布、`z-index: 2` 抬层、`.is-active{opacity:0}`、点的 `color-mix` 底色、以及只服务点对齐的 `padding: 0 7px` 一并删除;强度区横向内边距 `4px 6px 2px` → `4px 0 2px`(滑块直接铺满卡片内容宽度,填充段与圆钮两端与轨道贴齐,不再留多余空白);滑块容器去掉已无用的 `position: relative`
- 保留:圆钮(实心暖白 + 柔影 + 2px 间隙焦点环)、filled 段铺满轨道高度 6px、`--strength-ratio`、`当前:X`、`aria-valuetext`、←/→/Home/End、点轨道跳档、拖动连续跟手(预览 / 松手提交)
- pointercancel:触屏取消时与「松手」同口径提交当前预览(否则预览值会滞留到下一次提交或卸载 flush)
- 测试:`chatDialogFrameLayout.test.ts` 原来那组「点」断言整段换成**反向守卫**(样式表里不再有 `.project-chat-composer-strength-stops` 规则、组件源码也不再渲染该类名;滑块契约:宽 100% / 高 26 / 圆钮 20×20、强度区左右内边距 0);`home.suite.ts` 首页用例补一条「菜单里不再有那组点」
- 文档:pitfalls 的 D1 条改为现行口径(圆点已删、原因与判据;历史成因「被 6px 轨道盖住 / 与圆钮错位 ±12.2px」只留一句、由 Git 追溯)

Refs #600, PR #607
2026-10-05 18:11:13 +08:00
suzmii d7c4f82d7d 修复自查发现的门禁与体验问题:格式、超时态语义、压缩 CPU 边界
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m48s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m3s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m33s
Project CI / Frontend tests (pull_request) Successful in 3m24s
Project CI / Backend tests (pull_request) Successful in 7m29s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m55s
Project CI / Repository checks (pull_request) Successful in 6m33s
Project CI / Native shell tests (pull_request) Successful in 9m0s
- 新增 Rust 测试补齐 cargo fmt;ESLint 按仓库约定收口:常量与解析函数拆到 platformGameLoadingSurfaceModel.ts,删除 GAME_PLAY_STARTUP_TIMEOUT_MS 常量别名(测试直接用共享常量)
- 共享加载面新增 stalled:宿主判定等待不再推进时停掉进度动画并把 aria-busy 置回 false(去掉与 role=status 重复的 aria-live)
- 后台试玩超时时传入 stalled,避免「一边转圈一边说超时」
- Accept-Encoding 权重参数名改为大小写不敏感(RFC 9110 §12.5.3),GZIP;Q=0 视为拒绝并补用例
- 发行资源压缩分级:≥2 MiB 改用 level 1(zlib 端实测约 1/3 耗时、压缩比差约 3%),小文件仍用 level 6
- 文档:主规范补压缩与条件请求契约(并写明 60 秒窗口与撤销窗口不放宽)、nginx README 修正 Pingora 压缩关闭时的口径、pitfalls 补 CPU 边界与措辞修正
2026-10-05 18:02:48 +08:00
k88936 6738cf1aa9 Merge remote-tracking branch 'origin/master' into feat/pricing-plan
# Conflicts:
#	docs/project-memory/shared-memory/decision-log.md
2026-10-05 18:00:09 +08:00
suzmii d1bfe4c08b 修复游戏买断制付费的作者豁免、价格口径与契约可空性
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
- H1:购买事务在扣费前判定 `game.owner_user_id == user_id` 并失败关闭,领域 `resolve_game_purchase_decision` 新增 `is_owner` 标记返回 `OwnerCannotPurchase`(文案「作者本人无需购买」);api-server `map_purchase_error` 映射为 400 `GAME_PURCHASE_OWNER_EXEMPT`;购买路由按角色显式拒绝管理员令牌(403 `GAME_PURCHASE_ADMIN_NOT_ALLOWED`),管理员免购买不扣费。

- M1:`version_detail_payload` 的历史版本价格改为 `frozen_version_price_mud_points(version).unwrap_or(0)`,与待审列表及审核通过后生效的游戏行价格统一;同步把既有断言改为「历史版本缺 `priceMudPoints` 按免费(0)」。

- M2:`shared-contracts::GameDistributionVersionSummary.entry_url` 改为 `#[serde(default)] Option<String>`,与公开投影对未购买者下发的 `entryUrl: null` 一致。

- M3/L5:SpacetimeDB 购买事务改为复用 `module_game_distribution::resolve_game_purchase_decision`(新增 `game_distribution_visibility` 与 `resolve_game_distribution_purchase_decision` 包装),可购买性口径统一为「活动版本存在且 `status = published`」(复用 `public_game_distribution_version`),删除事务内联判定。

- 测试:内存领域作者自购拒绝;SpacetimeDB 购买判定五分支(免费 / 未公开 / 版本未公开 / 已拥有 / 作者自购)、事务源扫描(先判定后扣费、公开投影口径)、审核通过时历史版本价格生效为 0;api-server 管理员令牌 403、公开投影 `entryUrl: null` 可被 Rust DTO 解析、错误映射补作者豁免。

- `scripts/check-game-distribution-dto-parity.mjs` 增加可空性一致性比对(TS `| null` ⟺ Rust `Option`,允许 `?` 表示可省略),已用负例验证能拦住同类漂移。

- 同步更新 docs/【后端架构】server-rs与SpacetimeDB数据契约:登记作者豁免 / 管理员 403 / 可玩性口径 / 历史价格按 0;顺带修复 `module-game-distribution` 与 `spacetime-module` 既有未格式化行。
2026-10-05 18:00:03 +08:00
suzmii d40df89e2c 修复付费游戏播放会话在边缘转发 Cookie 导致 403 不可玩
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
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
- nginx:三份模板在通用 /api location 之前新增 location ^~ /api/game-distribution/play-sessions/,代理头与通用 /api 一致并清空 Cookie
- nginx:^~ 保证该前缀不被正则 location ~ ^/api(?:/|$) 抢先;只匹配带尾斜杠的前缀,创建会话端点继续走通用 /api 并保留 Cookie
- pingora:新增 RouteDecision::PlaySessionGateway,走 api 上游并同样套用 api 限流分组、大小上限与维护闸
- pingora:抽出 route_clears_cookie,发行入口 ReleaseGateway 与播放会话入口在上游代理阶段统一清空 Cookie
- pingora:classify_path 在通用 /api 分支之前命中播放会话前缀,并新增播放会话路由、Cookie 清除与保护等级用例
- 路由矩阵:新增 play_sessions_gateway 用例,声明清空 Cookie 与 protectionClass api
- 门禁 check:nginx-spa-routes:新增播放会话前缀断言——三份模板存在 ^~ location、块内清空 Cookie、代理头齐全且排在通用 /api location 之前
- 门禁 check:pingora-route-parity:新增断言——平台内容网关用例必须清空 Cookie 且不得复用通用 /api location,Rust 播放会话分支必须排在通用 /api 之前并由 route_clears_cookie 清理
- 门禁 check:pingora-gateway-smoke:新增真实网关用例——播放会话前缀转发到 api 上游并清空 Cookie、创建会话端点保留 Cookie
- dev:vite.config.ts 在 /api/game-distribution 规则之前新增同名前缀代理并清除 Cookie
- 文档:同步 Pingora 试点文档、本地开发运维文档、deploy/nginx/README 与 shared-memory 决策/踩坑记录
2026-10-05 17:53:51 +08:00
suzmii 05cf5b9547 docs(游戏共创): 修掉 §3.5.2 里那处嵌套加粗
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
- `docs/【技术方案】游戏共创与作品Fork-2026-10-03.md:362`:`- **服务端复核(已落地,**不信任客户端**)**:` → `- **服务端复核(已落地、不信任客户端)**:`(去掉内层多出的一对 `**`)
- 之前改不掉的原因搞清楚了:edit 工具的模糊匹配按**整行**比对,我先前传的是该行前缀(该行还有 300+ 字符),相似度自然只有六七成;这次把**整行**(429 字符)作为 old_string 即一次命中。渲染上本来就是连续加粗,本次只是源码观感与「别让人以为漏了个闭合标记」
- 门禁:check:doc-index 248 份 OK;check:encoding 5305 files OK;git diff --check 0
2026-10-05 17:44:56 +08:00
suzmii 3ae0d129ef test(游戏共创): 一致性门禁把内容嗅探与 magic bytes 纳入比对(补最后一处规则空白)
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
- `scripts/check-project-bundle-policy-parity.mjs` 新增第 4 维:**凭据内容嗅探与嵌套包 magic bytes**。复核指出这两套「换名字也拦得住」的规则只靠常量表表达,过去门禁对 `sniff|PEM|AKIA|magic|secret` 零命中(只有看得见的规则才有守卫),本次补齐:
  · `SECRET_CONTENT_TEXT_EXTENSIONS` / `SECRET_CONTENT_SIGNATURES`(字符串数组集合相等)、`SECRET_CONTENT_MAX_SNIFF_BYTES` / `NESTED_ARCHIVE_SNIFF_BYTES`(整数相等)、`SECRET_AWS_ACCESS_KEY_PREFIX` / `PEM_PRIVATE_KEY_LINE_PREFIX` / `PEM_PRIVATE_KEY_MARKER`(字符串逐字相等)——新增 `rustStringConst` helper 抓 `&str` 常量
  · `nested_archive_format` 里的 `b"..."` magic 字面量按「服务端 ⊆ 客户端」比对(客户端可以先拦、不能漏拦),并用新的 `byteStringLiterals` helper 抽取;两侧空集合一律 throw
- **「故意改一侧会红」已验证(两处,均已原样恢复)**:① 从客户端 `BUNDLE_FORBIDDEN_PATH_CHARS` 去掉 `'?'`/`'*'` → 报两条「路径段禁止字符…客户端没有」;② 从客户端 `SECRET_CONTENT_SIGNATURES` 去掉 `ghp_` → 报「嗅探规则不一致:服务端 …=ghp_|github_pat_|…,客户端 …=github_pat_|…」
- 文档 §3.5.2 与 §5.2 同步门禁的四个覆盖维度(目录/前缀/后缀/全名 + 上限、路径形状、内容嗅探特征表、magic bytes),并把 §5.2 的门禁行从「P1-a」扩为「P1-a + 嗅探维度」
- 门禁:`check-project-bundle-policy-parity` 0(服务端 51 条规则全被客户端覆盖;嗅探:`ghp_/github_pat_/xoxa-/xoxb-/xoxp-` + `AKIA` + PEM 标记;magic:7z / PK / Rar! / gzip / ustar;窗口 512 字节两侧一致);`check:doc-index` 248 份 OK;`check:encoding` 5305 files OK;`git diff --check` 0
2026-10-05 17:42:46 +08:00
suzmii 15024dab0a docs(游戏共创): M2b 证据表与里程碑改为冻结点的实测数字(含补强证据与已知留白)
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
- 技术方案 §5.2 三处过期数字按**自己去代码里数一遍**的结果改:校验器单测 16 → **19**(`project_bundle::tests`)、模块总测 69 → **73**、e2e 由「46 项 46 PASS」改为「**51 个 `check(` 调用点**」(复核另按 72 条断言计,差值来自同一 `check` 内的多条子断言);「`package.rs` 零改动」改为「已同批补强(读取层按声明封顶 + 压缩比分母改为条目压缩字节,+70/−4)」;客户端行补「打包器 **24 条单测**、上传前按 `max_archive_bytes` 预检、定向 `cargo test -- project_bundle` **24 passed**」
- 技术方案 §5.2 新增四行:**校验器对抗性补强(P0-a/b/c)**(凭据目录/前缀/后缀/全名 + 小文本内容嗅探、嵌套包扩展名并集 + magic 嗅探、读取层封顶、新错误变体 `CredentialDirectoryNotAllowed` / `SecretContentDetected`)、**执行级交叉证据(P1-b)**(dev-dependency 交叉测试)、**一致性门禁路径形状维度(P1-a)**(含「故意破坏会红」实测)、**已知留白**
- 里程碑:`前置依赖 ②` 里「客户端预检属待办」改为**已完成**并给出代码位置(`write_project_bundle_zip` 内 `bytes.len() > limits.max_archive_bytes` 失败关闭);证据行与验收项重数、并补齐补强后的新增规则;新增「已知留白」条目(`.bz2`/`.xz`/`.zst`、`*.db`/`*.sql`、`.gcloud`/`.azure`/`.password-store`、CP437 条目名与 `external_attributes == 0`、峰值内存未量测、内容嗅探误报率无实测)
- 本块在 rebase 之后完成,基线为新的 merge-base `21c79f54a`
- 门禁:`check:doc-index` 248 份 OK;`check:encoding` 5305 files OK;`git diff --check` 0
2026-10-05 17:41:11 +08:00
suzmii c732a3f851 实现游戏买断制泥点付费的 api-server HTTP 层、公开投影与播放鉴权
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
- server-rs/crates/api-server/src/runtime_profile.rs:钱包流水来源类型补 GamePurchase 分支并导入 game_purchase 常量,修复 non-exhaustive match 编译错误。
- server-rs/crates/api-server/src/modules/game_distribution.rs:创建版本接受并校验 priceMudPoints(复用 normalize_game_price_mud_points,越界 400),随版本冻结资料一起落库。
- server-rs/crates/api-server/src/modules/game_distribution.rs:新增 POST /api/game-distribution/games/{gameId}/purchase(require_bearer_auth + 必填 Idempotency-Key,请求体 { expectedPriceMudPoints }),经 facade 原子扣费并返回 GameDistributionPurchaseResponse。
- server-rs/crates/api-server/src/modules/game_distribution.rs:购买错误映射——余额不足 400 INSUFFICIENT_MUD_POINTS、价格已变化 409、免费游戏 400、游戏未公开或不存在 404、缺幂等键 400。
- server-rs/crates/api-server/src/modules/game_distribution.rs:新增 POST /api/game-distribution/games/{gameId}/play-session;免费作品直接回既有公开入口,付费作品接受管理员令牌(沿用现有 admin 鉴权,免购买)与用户令牌,校验已购买 / 作者本人,未登录 401、未购买 403,签发绑定 gameId + userId 的 2 小时会话。
- server-rs/crates/api-server/src/modules/game_distribution.rs:新增 GET /api/game-distribution/play-sessions/{token}[/{assetPath}] 网关,无登录中间件、凭令牌读取,能解析平台刷新会话 Cookie 时 403,令牌过期 / 不存在、游戏下架或封禁、缺少有效公开版本一律 404,复用发行包读取与 CSP/MIME/nosniff/CORP 并全程 no-store。
- server-rs/crates/api-server/src/modules/game_distribution.rs:公开发行网关 releases/{gameId} 在当前公开版本 price_mud_points > 0 时返回 404,付费作品只能走播放会话路径。
- server-rs/crates/api-server/src/modules/game_distribution.rs:game_payload 发出 priceMudPoints 与 purchased 默认值;public_game_payload 按查看者解析 purchased,并对未购买且非作者 / 非管理员的付费作品把 currentVersion.entryUrl 置 null;公开详情接口可选鉴权读取当前用户,坏令牌按匿名、购买态读取失败按未购买。
- server-rs/crates/api-server/src/modules/game_distribution.rs:private_version_payload 发出该版本冻结价(历史缺字段为 0);作者 / 管理员版本详情的 game payload 按「冻结价优先、否则游戏行价」。
- server-rs/crates/api-server/src/state.rs:新增付费游戏播放会话的进程内存储与读写方法,读取时清理过期会话。
- server-rs/crates/api-server/src/admin.rs:抽出 resolve_admin_session,新增 try_authenticate_admin_from_headers 供同时接受管理员 / 用户令牌的端点复用,require_admin_auth 的校验与鉴权行为不变。
- server-rs/crates/spacetime-client/src/active.rs:补出 GameDistributionPurchaseRecordInput 的 re-export。
- docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md:登记购买、播放会话、公开详情入口隐藏与公开发行网关的 HTTP 契约。
- 补齐 api-server game_distribution 定向测试:价格校验 400、公开投影入口门禁(未购买 / 已购买 / 作者 / 管理员 / 免费)、冻结价回读、购买错误映射、购买路由鉴权与幂等键、播放会话网关 Cookie / 未知与过期令牌 / 路由挂载。
2026-10-05 17:32:40 +08:00
suzmii 88368d0418 test(游戏共创): 一致性门禁补「路径形状」维度,并同步校验器文档
- `scripts/check-project-bundle-policy-parity.mjs` 新增第 3 维:服务端 `normalize_archive_path` 的拒绝形状必须被客户端打包器的三个常量逐 token 覆盖——**哨兵段**(`.` / `..`)与**路径段结尾字符**(空格 / 点)分别用 `rustStringArray` / `rustCharArray` 抽取,**路径段禁止字符**同时抓 `.contains('x')` 与 `matches!(expr, 'a' | 'b')` 两种写法;再单独钉「两侧都必须显式拒 `/` 开头与 `\`」两条独立分支(它们靠常量表覆盖不到)。**空集合一律 throw**,沿用既有「抽不到不许当绿灯」的写法
- 修掉我自己在第一版里写错的两处(由补强过程中的实测发现,并已用临时副本验证修法):① `BUNDLE_FORBIDDEN_PATH_SEGMENTS` 是 `&[&str]` 而非 `&[char]`,须用 `rustStringArray`(`".."` 也无法用 char 字面量表达);② 反斜杠分支的正则写成了 4 个字面反斜杠,而源码是 `contains('\\')`(2 个),已改为 `/contains\('\\\\'\)/u`
- **「故意破坏会红」已验证**:临时从客户端 `BUNDLE_FORBIDDEN_PATH_CHARS` 去掉 `'?'` 与 `'*'` → 门禁立即报两条「路径段禁止字符:服务端有「?」/「*」,客户端没有」,随后已原样恢复
- 文档 `§3.5.2/§3.2.3`:校验器清单同步到新规则(新增目录/前缀/后缀/全名 + 内容嗅探及其取舍理由、嵌套包扩展名并集与 magic 嗅探、读取层封顶与压缩比口径更正、路径形状维度),并新增**产品口径「知情同意」**一条——清单是黑名单,`docs/`、`*.pdf`、`notes.txt`、截图等不在任何拒绝集内会原样外发,发布面板必须写明「整个项目目录(除少数排除项)会原样公开」
- 门禁:policy parity 0(服务端 51 条全被客户端覆盖 + 路径形状维度 OK);`check:doc-index` 248 份 OK;`check:encoding` OK;`git diff --check` 0
2026-10-05 17:30:50 +08:00
suzmii 779bbd1157 docs(游戏共创): M2b 文档回填两处实现偏差 + 状态改已实现(含 M2b 证据表)
- 技术方案 §3.4:上行路由行按端到端实测补两条按实现为准的细节——① **非作者上传返回 404 而不是 403**(`load_owner_version_or_404` 把 owner 不匹配按「版本不存在」处理,与发行包上行族同口径,不泄露版本存在性、响应不含对象键);② **阶段门先判「已存在」再判档位**(`ensure_project_bundle_uploadable`:`project_bundle_bytes > 0` → 409 `PROJECT_BUNDLE_ALREADY_EXISTS`,再看 `status` → 409 `PROJECT_BUNDLE_UPLOAD_NOT_ALLOWED`),因此「已公开且已有工程包」返回 `ALREADY_EXISTS`,「已公开但无工程包」才返回 `UPLOAD_NOT_ALLOWED`。证据:`check-game-distribution-project-bundle-e2e` 的 A5 / A5b / A6 及其 NOTE
- 技术方案 §3.5.2:AGC 侧「上传」「下载与建项」由「接线待做」改为**已落地**(发布时上传且失败不阻断、按 `source` 分支建项、来源记录 v2 兼容 v1、取件提示按形态措辞),并写明两端规则由 `npm run check-project-bundle-policy-parity` 机器门禁钉住一致
- 技术方案 §3.5.4:路线 B 由「服务端已实现、客户端接线待做」改为**两端均已落地**
- 技术方案 §3.7:补 M2b 口径——共创写入仍复用 `game-distribution:publish`(未新增灰度键);内容下发与工程包上传当前只有 `tracing` 日志,三个结构化埋点事件**仍未接**(待产品定事件口径)
- 技术方案新增 §5.2「M2b(工程源包)实施证据」表:三列与契约、校验器(16 条单测 / 上限镜像)、上行路由族(api-server 60 passed)、下行优先与缓存不串味、端到端 `check:game-distribution-project-bundle-e2e` **46/46**、两端规则 parity 门禁、客户端 vitest 1961 passed 与定向 cargo test 17+16;并显式登记「backfill 明确不做」「真实极端边界与结构化埋点待补」
- 里程碑「作品工程源包与一键改造」:Status → `implemented-local`;新增「实现进展(2026-10-05)」列出两端提交 SHA 与证据命令、以及四条未做项及原因;验收标准改为 ✅/⏳/⏭ 三段并有证据指向(阶段门顺序、非作者 404、半包清理等按实测更新);证据要求补上已落地的命令清单与「真机建项链路仍未跑」的括注
- 门禁:`check:doc-index` 248 份 OK;`check:encoding` 5304 files OK;`git diff --check` 0
2026-10-05 17:30:49 +08:00