文档:修正买断制合同章的定价预填口径、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
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 由前一提交改好
This commit is contained in:
@@ -580,7 +580,7 @@
|
||||
### 入口与边界
|
||||
|
||||
- 作者入口:网页 `/games/publish`(新建与更新模式)与 AGC 发布面板;两个发布入口一致支持「付费方式:免费 / 买断制」与「买断价(泥点)」,共用同一份前端校验与服务端口径,非法值阻止提交。
|
||||
- 预填规则:给已上线作品发新版本时,面板预填当前价格与模式;作者不改则价格不变,避免审核通过后静默改价。
|
||||
- 预填规则:给已上线作品发新版本时,面板按「最新版本冻结价优先、缺失或为 `0` 时回落作品行当前价、两条来源都取不到按免费(`0`)」预填价格与模式;作者不改则价格不变,避免审核通过后静默改价。
|
||||
- 玩家入口:`/games`、`/games/detail`、`/games/play`。
|
||||
- 审核入口:后台 `#game-distribution` 审核页(详情与待审列表)。
|
||||
- 正式状态来源:SpacetimeDB 的游戏价格、购买记录与钱包余额/流水;前端只负责表现与请求编排。
|
||||
@@ -592,7 +592,7 @@
|
||||
- 价格是版本冻结资料的一部分:作者提交新版本时携带价格,与封面/截图一样在审核通过时整体生效到游戏行;未通过审核的价格不改变当前公开价格。
|
||||
- 价格是整数泥点数,`0` 表示免费,取值域由服务端约束为 `0..=1_000_000`(上限于 2026-10-05 定稿);免费与付费共用同一条发布与审核链路。
|
||||
- 展示资料编辑(`PATCH /my-games/{gameId}`)不得直接变更公开价格;调整价格必须走新版本审核。
|
||||
- 发布新版本必须预填并保持现有价格:面板预填当前价格与模式,作者不改则价格不变;不允许因默认免费而静默改价。
|
||||
- 发布新版本必须预填并保持现有价格:预填取该作品**最新版本的冻结价**(该版本可能仍处于 `pending_review` / `rejected`,因此预填值未必已生效),仅当该冻结价缺失或为 `0` 时才回落作品行当前价,两条来源都取不到才按免费(`0`);作者不改则价格不变,不允许因默认免费而静默改价。实现落点:AGC 壳 `resolve_publication_prefill_price`(`apps/ai-game-creator-shell/src-tauri/src/game_distribution_publish.rs:811`)、网页 `src/components/game-distribution/GamePublishPage.tsx:164`(`detail.version.priceMudPoints ?? detail.game.priceMudPoints ?? 0`),后端 `version_detail_payload`(`server-rs/crates/api-server/src/modules/game_distribution.rs:3797`)已把版本详情的 `game.priceMudPoints` 归一为同一冻结价口径(历史无价格版本按 `0`,不回退游戏行旧价)。
|
||||
- 定价 UI 已抽取为 `packages/shared` 共享组件(`PlatformGamePricingField`),网页与 AGC 两个发布入口共用同一实现,不再保留两份。
|
||||
|
||||
#### 购买与所有权
|
||||
@@ -635,7 +635,7 @@
|
||||
### 契约与迁移
|
||||
|
||||
- SpacetimeDB:`game_distribution_game` 末尾追加 `price_mud_points: u64`(明确默认 0);新增私有 `game_distribution_purchase`(`purchase_id` 主键,含 `game_id`、`user_id`、成交价快照、钱包流水 ID 与创建时间,`(user_id, game_id)` 唯一);同步 `migration.rs`、后端表目录与生成绑定,并运行 `npm run check:spacetime-schema`。
|
||||
- 泥点流水新增来源类型 `game_purchase`(`RuntimeProfileWalletLedgerSourceType`),同步 Rust `shared-contracts`、`packages/shared`、前端与后台文案。
|
||||
- 泥点流水新增来源类型 `game_purchase`(`RuntimeProfileWalletLedgerSourceType`,Rust 常量 `PROFILE_WALLET_LEDGER_SOURCE_TYPE_GAME_PURCHASE` 见 `server-rs/crates/shared-contracts/src/runtime.rs`),同步 Rust `shared-contracts`、`packages/shared`、前端与后台文案;接口侧来源文案由 `server-rs/crates/api-server/src/runtime_profile.rs` 的 `format_profile_wallet_ledger_source_type` 输出,后台落点为本轮已补齐的 `server-rs/crates/api-server/src/admin.rs`(流水来源映射 `wallet_ledger_source_type_to_string` 与后台统计消耗白名单),钱包消耗口径的 `game_purchase` 一并纳入 `server-rs/crates/spacetime-module/src/runtime/` 的 profile 消耗统计。
|
||||
- 游戏 DTO 增加 `priceMudPoints` 与购买态;新增购买与播放会话 DTO。免费游戏必须能忽略这些新字段而不改变行为。
|
||||
- AGC 版本请求携带 `priceMudPoints`(Rust DTO `GameDistributionCreateVersionRequest.price_mud_points`,`#[serde(default)]`);字段仅用于向后兼容不传该字段的旧客户端(按免费处理),新客户端从发布面板透传作者选择的价格。
|
||||
- 不修改已有表字段的类型或顺序;新增字段一律末尾追加并带明确默认值。
|
||||
@@ -645,7 +645,7 @@
|
||||
| 条款 | 验收方式 | 证据 |
|
||||
| --- | --- | --- |
|
||||
| 定价 | 网页发布可选「免费/买断制」并拦截非法值,前后端口径一致 | 真实本地栈 E2E:价格 `1000001` → 400 且不落版本,`0` 与 `1000000` → 200;`cargo test -p module-game-distribution` 29 passed(`normalize_game_price_mud_points` 上限)、`cargo test -p api-server game_distribution` 53 passed(`validate_version_declaration` 定价校验);网页发布表单定价定向 Vitest |
|
||||
| 定价(AGC 入口) | AGC 发布面板与网页一致可选「免费/买断制」并拦截非法值;给已上线作品发新版本时预填当前价格与模式,作者不改则价格不变 | 待补(由实现 worker 提供:AGC 发布面板定价定向 Vitest、AGC 壳 `cargo check` 编译与真实本地栈 E2E 发布付费版本);定价 UI 与网页共用 `packages/shared` 共享组件 `PlatformGamePricingField` |
|
||||
| 定价(AGC 入口) | AGC 发布面板与网页一致可选「免费/买断制」并拦截非法值;给已上线作品发新版本时按「最新版本冻结价优先、缺失或为 0 时回落作品行当前价」预填价格与模式,作者不改则价格不变 | AGC 定价前端已覆盖:发布面板定价定向 Vitest `apps/ai-game-creator-shell/tests/gameDistributionPublishPanel.test.tsx:333/342/802/819`(默认免费提交 `0`;买断制空值与 `1000001` 本地拦截、`120` 随版本提交;历史响应无价格按免费预填;更新模式预填线上买断价 `240` 且作者不改仍按 `240` 提交),请求层定向 Vitest `apps/ai-game-creator-shell/tests/gameDistributionPublish.test.ts:180/197`(透传 `priceMudPoints=240`;`1000001` / `1.5` 在 native command 之前失败关闭);预填口径 Rust 单测 `apps/ai-game-creator-shell/src-tauri/src/game_distribution_publish.rs:1715`。**未覆盖**:AGC 真实栈手点一次发布付费版本。定价 UI 与网页共用 `packages/shared` 共享组件 `PlatformGamePricingField` |
|
||||
| 后台可见 | 审核详情与待审列表显示该版本价格 | `cargo test -p api-server game_distribution` 53 passed(`private_version_payload` / `version_detail_payload` 输出 `priceMudPoints`,历史无价格版本按 0,不回退游戏行当前价);admin-web 审核价格展示定向 Vitest |
|
||||
| 审核试玩 | 审核员不限次试玩待审付费版本,不校验购买、不扣泥点 | 真实本地栈 E2E:审核员两次试玩待审付费版本均 200、两次包内字节一致,作者与审核员余额/流水均不变 |
|
||||
| 购买 | 余额不足失败且不变更;成功扣 N、账单出现 `game_purchase` 流水、购买记录唯一 | 真实本地栈 E2E:余额不足 400 `INSUFFICIENT_MUD_POINTS` 且余额与流水不变;成功购买扣 30(120→90),`game_purchase` 流水与购买行各 1 条;同 key 重放与换 key 重复购买都不再扣费 |
|
||||
@@ -655,7 +655,7 @@
|
||||
| 免费回归 | 免费游戏发布/详情/游玩/计数无行为变化 | 真实本地栈 E2E:免费游戏详情保留入口、发行网关 200、匿名创建会话 200 且不签发令牌;`cargo test -p api-server game_distribution` 免费详情 `priceMudPoints=0` / `purchased=false` / 入口保持 |
|
||||
| 工程门禁 | schema/绑定、两端类型、定向测试、编码与 diff 检查通过 | `cargo test -p api-server game_distribution` 53 passed、`cargo test -p module-game-distribution` 29 passed、`cargo test -p spacetime-module game_distribution` 7 passed、`cargo test -p pingora-gateway` 42 passed;`check:game-distribution-dto-parity`、`check:pingora-route-parity`、`check:nginx-spa-routes`、`check:pingora-gateway-smoke`、`check:spacetime-schema`、`check:server-rs-ddd`、两端 typecheck 与定向 Vitest、`check:encoding`、`git diff --check` 全绿 |
|
||||
|
||||
上表运行时证据来自人工验收脚本 `scripts/check-game-distribution-purchase-e2e.mjs`(`npm run check:game-distribution-purchase-e2e`):本机真实 SpacetimeDB / api-server / OSS 一次跑通 76 PASS / 0 FAIL / 1 WARN,exit 0,24.1s,teardown 无残留。该脚本不在 CI 自动门禁内,CI 绿不代表该链路已验证;本表结论最高到“本机真实栈验证通过,待用户验收,未部署”。
|
||||
上表运行时证据来自人工验收脚本 `scripts/check-game-distribution-purchase-e2e.mjs`(`npm run check:game-distribution-purchase-e2e`):最近一次人工运行 **76 PASS / 0 FAIL / 1 WARN**,唯一 WARN 为「管理员令牌购买分支在现役登录链路下不可达(先被判 401)」。该脚本不在 CI 自动门禁内,CI 绿不代表该链路已验证;本表结论最高到“本机真实栈验证通过,待用户验收,未部署”。
|
||||
|
||||
### 已收口决策(2026-10-05)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user