将退款 outbox 主路径迁入 SpacetimeDB #204

Merged
kdletters merged 11 commits from codex/auth-refine into master 2026-08-27 22:04:50 +08:00
Member

变更内容

  • 新增 profile_wallet_refund_outbox 表与 enqueue/process procedure,退款主路径进入 SpacetimeDB。
  • 外部生成失败事务、inline 资产失败和跨节点 worker 统一使用库内 outbox,按 ledger 幂等并在事务内完成退款与删除。
  • SpacetimeDB 完全不可达时才写本机 emergency spool,恢复时重新入库;兼容旧 spool 文件并保留 attempt 追踪。
  • 更新 SpacetimeDB migration、生成 bindings、架构文档、运维恢复说明和项目决策记录。

验证

  • cargo check -p spacetime-module -p spacetime-client -p api-server --manifest-path server-rs/Cargo.toml
  • api-server / spacetime-client / spacetime-module / module-runtime 定向测试
  • npm run check:spacetime-schema
  • npm run check:spacetime-runtime-access
  • npm run check:server-rs-ddd
  • npm run check:encoding
  • git diff --check
## 变更内容 - 新增 `profile_wallet_refund_outbox` 表与 enqueue/process procedure,退款主路径进入 SpacetimeDB。 - 外部生成失败事务、inline 资产失败和跨节点 worker 统一使用库内 outbox,按 ledger 幂等并在事务内完成退款与删除。 - SpacetimeDB 完全不可达时才写本机 emergency spool,恢复时重新入库;兼容旧 spool 文件并保留 attempt 追踪。 - 更新 SpacetimeDB migration、生成 bindings、架构文档、运维恢复说明和项目决策记录。 ## 验证 - `cargo check -p spacetime-module -p spacetime-client -p api-server --manifest-path server-rs/Cargo.toml` - api-server / spacetime-client / spacetime-module / module-runtime 定向测试 - `npm run check:spacetime-schema` - `npm run check:spacetime-runtime-access` - `npm run check:server-rs-ddd` - `npm run check:encoding` - `git diff --check`
kdletters added 4 commits 2026-08-27 17:12:25 +08:00
生产 Bearer 鉴权改用 SpacetimeDB 会话校验 procedure

为认证整包投影增加单调水位保护

新增鉴权客户端 facade 与生成 bindings

补齐 tracking 与钱包退款 outbox 启动恢复

同步后端架构、运维和项目决策文档
绑定认证工作集投影版本并在 SpacetimeDB 内执行 CAS

为认证 procedure 增加 runtime service identity 校验

防止退款 outbox 跨进程覆盖并校验临时文件事实

更新后端契约与项目决策记录
新增 profile_wallet_refund_outbox 表与事务处理 procedure

失败任务事务写库内 pending 记录,API 节点跨实例处理并重试

SpacetimeDB 不可达时保留本机 emergency spool 与 attempt 追踪

同步 runtime bindings、架构文档、运维恢复和项目决策记录
修复退款 outbox 幂等恢复
Project CI / Native shell tests (pull_request) Successful in 14m19s
Project CI / Repository checks (pull_request) Failing after 9s
Project CI / Backend tests (pull_request) Failing after 9s
Project CI / Frontend tests (pull_request) Successful in 3m34s
a0bf2ba374
允许同一退款 ledger 在不同恢复路径使用不同诊断 reason

兼容旧本机 spool 文件推断缺失的外部生成 attempt

补充跨路径幂等与历史文件恢复测试
kdletters added 1 commit 2026-08-27 17:18:12 +08:00
同步 master 解决 PR 冲突
Project CI / Repository checks (pull_request) Successful in 2m54s
Project CI / Backend tests (pull_request) Successful in 5m28s
Project CI / Frontend tests (pull_request) Successful in 3m7s
Project CI / Native shell tests (pull_request) Successful in 15m43s
6da1eecbb6
合并最新 master 的 SpacetimeDB 2.8.3 与项目 skill 变更

保留退款 outbox 架构决策记录并消除 PR 冲突
kdletters added 2 commits 2026-08-27 19:35:45 +08:00
将短信验证码与微信 OAuth state 纳入 SpacetimeDB typed projection 并支持 CAS 只读刷新

为退款 emergency spool 增加 overflow 文件与崩溃恢复,避免容量上限静默丢失

为 API 与 external worker 配置独立 tracking/refund 持久卷

使用 profile refund outbox 的 status/available_at 索引扫描并同步架构运维文档
修复跨节点短信冷却与微信状态膨胀
Project CI / Repository checks (pull_request) Successful in 2m43s
Project CI / Frontend tests (pull_request) Successful in 4m28s
Project CI / Backend tests (pull_request) Successful in 5m54s
Project CI / Native shell tests (pull_request) Successful in 13m36s
874aa09b9a
发码前通过占位验证码与投影 CAS 原子占用冷却窗口

限制活动微信 OAuth state 数量并在创建前清理过期状态

补充认证架构、运维决策和回归测试
kdletters added 1 commit 2026-08-27 20:48:59 +08:00
修复鉴权跨节点投影恢复
Project CI / Native shell tests (pull_request) Successful in 17m1s
Project CI / Frontend tests (pull_request) Successful in 4m51s
Project CI / Repository checks (pull_request) Successful in 5m55s
Project CI / Backend tests (pull_request) Successful in 6m28s
2b8d44b369
刷新登录、会话、密码与微信认证主链路的正式投影

补齐支付查单、过期补偿和订阅消息的跨节点身份读取

修复同步失败后的 pending 状态恢复并更新鉴权运维文档
kdletters added 1 commit 2026-08-27 20:57:46 +08:00
修复后台用户目标跨节点读取
Project CI / Backend tests (pull_request) Successful in 10m20s
Project CI / Repository checks (pull_request) Successful in 2m35s
Project CI / Frontend tests (pull_request) Successful in 5m5s
Project CI / Native shell tests (pull_request) Successful in 16m57s
347eca2056
后台充值与钱包操作先刷新用户认证正式投影

避免目标用户仅存在于其他 API 节点时被误判不存在
kdletters added 1 commit 2026-08-27 21:09:06 +08:00
统一受保护请求认证投影刷新
Project CI / Frontend tests (pull_request) Successful in 3m36s
Project CI / Repository checks (pull_request) Successful in 3m43s
Project CI / Backend tests (pull_request) Successful in 8m20s
Project CI / Native shell tests (pull_request) Successful in 14m34s
061f8f32d3
将 Bearer 路由刷新收口到鉴权中间件

补齐后台素材筛选跨节点用户解析并同步决策记录
kdletters added 1 commit 2026-08-27 22:00:15 +08:00
合并 master 并解决鉴权与生成任务冲突
Project CI / Frontend tests (pull_request) Successful in 3m50s
Project CI / Repository checks (pull_request) Successful in 3m0s
Project CI / Native shell tests (pull_request) Successful in 16m31s
Project CI / Backend tests (pull_request) Successful in 19m35s
0441a9ada9
合并 master 的外部生成历史清理、任务内存上限和备份 OOM 兜底
保留退款 outbox 与短期认证 typed projection/CAS 及容量清理
合并 SpacetimeDB 生成 bindings、架构文档和决策记录
补齐认证投影容量测试字段并通过定向门禁
kdletters merged commit 458371a73d into master 2026-08-27 22:04:50 +08:00
kdletters deleted branch codex/auth-refine 2026-08-27 22:04:50 +08:00
Sign in to join this conversation.