Files
Genarrative/scripts
suzmii d0176f48b7
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
feat(游戏共创): 衍生作品发布必填「本次核心改动说明」(版本级存储 + 可达错误码)
按需求文档 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
..
2026-09-22 12:42:27 +08:00
2026-09-14 18:15:12 +08:00