0dbd279dfc
Project CI / AI game creator shell Rust crates (push) Successful in 1m22s
Project CI / AI game creator shell Rust smoke (push) Successful in 2m1s
Project CI / Backend tests (push) Successful in 5m16s
Project CI / AI game creator shell Rust lane 1/2 (push) Failing after 6m42s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 8m21s
Project CI / Native shell tests (push) Successful in 6m43s
Project CI / Frontend tests (push) Successful in 2m22s
Project CI / Repository checks (push) Successful in 2m45s
Project CI / AI game creator shell web tests (push) Successful in 2m7s
- consumedMudPoints 改为净额:按北京时间业务日先抵当日消耗,不足再回溯抵扣最近仍有净额的业务日,抵扣不完的丢弃,每日净额非负且区间合计严格等于「消耗 − 退还」 - 退还口径并入 asset_operation_refund 正向流水(生成失败退还、精选审核返还)与 llm_router_consume 正向冲正流水;充值退款追回、余额重置、赠送和 hold 仍不计入 - 契约新增 refundedMudPoints,后端新增「退还泥点」趋势图,后台时段数据并列「退还泥点数」卡,毛消耗可由「消耗 + 退还」核出 - 新增 4 条净额单测(同日对冲 / 回溯抵扣 / 超额归零 / 无退还保原值)与 Dashboard 用例断言 - 同步 Dashboard 运营看板方案指标口径与决策记录 - 验证:cargo test -p api-server --bin api-server admin(136 passed / 0 failed / 1 ignored)、npm run admin-web:typecheck、npx vitest run apps/admin-web/src(218 passed)、cargo fmt --all --check、npm run check:encoding、npm run check:doc-index、git diff --check 全部通过
shared-contracts 共享 crate 说明
日期:2026-04-21
1. crate 职责
shared-contracts 是前后端兼容 contract 共享 crate,后续负责:
- HTTP 请求与响应 DTO
- SSE 事件结构与事件名约定
- response envelope、错误结构、兼容头部契约
- 各模块对外暴露的共享协议类型
2. 当前阶段说明
当前阶段已完成 Stage1 最小真实落地:
- 统一 response envelope / 头部常量
auth/login-optionsauth/meauth/sessionsruntime/settings
当前阶段继续补齐的 Stage2 鉴权 DTO:
auth/entryauth/refreshauth/logoutauth/logout-allauth/phone/send-codeauth/phone/loginauth/wechat/startauth/wechat/callbackauth/wechat/bind-phoneauth/wechat/miniprogram-login
当前阶段继续补齐的 Stage3 公开请求 DTO:
assets/direct-upload-ticketsassets/read-urlassets/objects/confirmassets/objects/bindstory-sessions/beginstory-sessions/continue
当前阶段继续补齐的 Stage4 显式成功响应 DTO:
assets/direct-upload-ticketsassets/read-urlassets/objects/confirmassets/objects/bindstory-sessions/beginstory-sessions/continue
当前阶段新增 Stage6 character visual 兼容 DTO:
assets/character-visual/generateassets/character-visual/jobs/:taskIdassets/character-visual/publish
当前阶段新增 Stage7 character animation 模板与导入兼容 DTO:
assets/character-animation/templatesassets/character-animation/import-video
当前阶段新增 Stage8 character workflow cache 第一批兼容 DTO:
assets/character-workflow-cacheassets/character-workflow-cache/:characterId
当前阶段新增 Stage9 character animation 主链兼容 DTO:
assets/character-animation/generateassets/character-animation/jobs/:taskIdassets/character-animation/publish
当前阶段新增 Stage5 story session scoped runtime story 写读 DTO:
BeginStoryRuntimeSessionRequestResolveStoryRuntimeActionRequestStoryRuntimeProjectionResponseStoryRuntimeMutationResponseStoryRuntimeSnapshotPayload仅用于 story session scoped 写侧持久化边界,不复用旧/api/runtime/story/*总入口 contract。
WP-DEL 已删除旧 runtime story HTTP DTO:RuntimeStoryStateResolveRequest、RuntimeStoryBootstrapRequest/Response、RuntimeStoryActionResponse 和旧 RuntimeStorySnapshotPayload。runtime_story 模块中仍保留的 RuntimeStoryViewModel、RuntimeStoryPresentation、RuntimeStoryPatch 与 battle presentation 是当前投影/表现构件,不作为旧 HTTP 写入口。
当前仍刻意未做:
- SSE 事件结构
- 自动代码生成或跨语言 contract 同步
- 其他尚未收口模块的 handler 响应体显式 DTO 化
3. 边界约束
shared-contracts只放协议类型与兼容结构,不承接业务规则、供应商适配或状态写入逻辑。- 各模块 crate 对外暴露的协议优先复用这里的共享定义,避免重复散落。
- 前端兼容契约一旦进入本 crate,就必须与任务清单和基线文档同步维护。
assets模块依赖platform-oss的稳定返回类型,默认通过oss-contractsfeature 给api-server使用;SpacetimeDB WASM 构建链路必须通过 workspace 依赖关闭默认 feature,避免把platform-oss/reqwest/wasm-bindgen带进spacetime-module。