Repository navigation
fix(payments): recover accepted inbox and receipts across Go process crashes (A05 WIP) - #879
LIghtJUNction wants to merge 3 commits into
Conversation
…nnel recovery Guard pending webhook resolution against missing adapters. Bind payment and refund operations to the original provider namespace, and avoid consuming attempts when the configured channel is unavailable. Add synthetic recovery regression tests. A05 partial change only; final host integration, legacy refund basis and multi-process recovery remain pending.
…runtime Keep Core-only receipt/proof recovery independent of Go provider availability while retaining original channel checks for external writes. Add a serial payment runtime with mandatory dependency probing, bounded HTTP admission, panic isolation and joined drain. 21 test functions pass in an explicit standard-library source subset with Go 1.23.2 and the race detector; runtime cases repeated 20 times and go vet passed. Four new settlement regressions fail against the prior worker and pass with this change. A05 remains partial: normal-host shared wiring, legacy payment basis, remaining provider parity and real PG/Rust/Go process recovery are not verified. No production operation or deployment.
… crashes Resolve durable inbox events against the original immutable order, rather than requiring the current Go provider adapter. Share binding checks with ingress, keep unsigned observations and external writes gated, and recover only existing Core proof acceptance. Add seven inbox regression tests and two PostgreSQL subprocess crash scenarios. The process test kills only its own child after inbox COMMIT or job persistence, then starts independent recovery/replay processes without adapters. Its Core remains explicitly simulated. Local standard-library source subset: 28 tests x5 with -race and go vet passed on Go 1.23.2. New PG process scenarios await repository CI; full Rust/Go recovery and A05 host/provider parity remain incomplete.
|
本轮固定核对 下一步明确收口在宿主接线,而不是重做包内 recovery:
联合验收仍需真实 Core 的能力/凭据/账本授权,以及 A03 的原付款/退款基准(不能用 opening balance 充当原支付)。现有 Go+PG 进程恢复证据的 Core/provider 是替身,不能扩写为整个支付链路已集成。 |
|
主线 79f8164 已移植本 PR 的六个持久证据/渠道/回执恢复文件,并通过 Go race、独立 PG 和真实 Go 子进程崩溃测试。但 runtime.go、runtime_test.go、HOST_RUNTIME.md 三项未接受,实际支付宿主仍未接线;进程测试使用合成 Core,真实 Rust 账本跨进程联合尚缺。因此本轮不把窄移植登记成整份 PR 合并,保留开放状态继续完成宿主合同和真实资金验收。未启用实际支付、未部署。 |
Current WIP payment host verification (2026-10-25)The current WIP already contains payment composition and host callback wiring; the old PR's missing This verifies current host configuration, callback isolation/drain and payment composition tests. It does not prove real Rust/Core cross-process financial recovery or provider checkout/refund acceptance, so this old PR remains Draft and is not merged as a whole. |
|
以 superseded / migrated 关闭此旧布局 PR。实现进入 原候选 完整接口与验收要求见 迁移合同,13 项待办已实际写入 #895。关联的未完成 issue 保持开放。保留本 PR 正文、原始候选与历史通过/失败证据;未将本 PR 源码直接合回配方项目。 |
开发主线交接(2026-10-12)
开发默认主线现为
wip/rust-core-go-extensions;旧单体main与traditional冻结于3948a0a1ee1cefdd016a7aa45a11851545bb4b85。分支交接不是发布、部署或验收通过。原问题、源码基线、测试与未完成项保留;旧单体路径仅作历史证据,后续先在微服务源码重新确认并按职责移植,不回灌旧数据库/权限/资金实现。主线/S11 跟踪:#895。Extore 商品同步:#894,未验收,禁止部署,尤其禁止合并/推送 Extore
main。本 PR 的候选实现和已有验证范围保持原样;不因主线交接自动合并或标记验收完成。
范围
A05 支付恢复与宿主运行组件,目标
wip/rust-core-go-extensions。最新提交cb3276d423bf2d81d4451180dd1e3ff18c1dd6df,继续使用原分支,不改写历史。支付包和 Go/PostgreSQL 真实进程恢复 CI 已通过。A05 整体尚未完成,保留 Draft;没有合并、部署或真实资金操作。
修改
本轮只修改
service.go、channel_recovery_test.go,新增inbox_recovery_test.go和pgtest/process_recovery_test.go。整个 PR 累计九个支付文件;未修改共享宿主、账本、schema、proto、配置和.github。最新仓库 CI:通过
mk10-payment-safety / run 38239431197,job
114778091975,success。已读取实际日志。测试对象是合并候选
fe5da457c4727e6864cf985e9a49aeb8fec4ce76。已核对其 Git parents:base7ab9ee2fdfae90aa4bf5d4ac6ed3d7ac58b50ed4+ 本 PR headcb3276d4,不是沿用旧 base 的测试记录。日志确认 Go 1.25.0、独立 PostgreSQL 16.15。在
services/extensions通过:go test -race -count=3 ./internal/modules/payments/... ./internal/coreclient ./internal/modules go vet ./internal/modules/payments/... ./internal/coreclient在
services/extensions/internal/modules/payments/pgtest通过:go test -race -count=1 -v ./...原 PostgreSQL 持久化、并发、隔离测试及六个子场景通过;新增两个真实 Go 进程中断场景也实际执行通过:
父测试只终止自己创建的子进程,并等待其退出。恢复进程不配置 Go 支付 adapter。测试读回 PostgreSQL,确认同一收据、单一结算任务及原证明字节保持不变。独立 helper 在父测试进程中跳过是预期行为;父测试确实启动了以上六个不同 PID。
这些场景是真实 Go 进程 + PostgreSQL,Core 和 provider 仍是明确的模拟对象。 不据此声称 Rust 验签、真实账本入账、Rust 进程重启或真实供应商验收完成。
本地补充证据
隔离源码子集使用 Go 1.23.2:新增七项 inbox 回归后,28 个顶层测试带
-race连续运行五轮通过(140 次);go vet通过。新测试对旧源码出现预期失败,修复后通过。四个提交文件的 Git blob SHA 与本地测试文件一致,补丁按原基线应用检查通过。本地
mise仍不可用(退出码 127)。上述本地结果只是标准库源码子集;完整支付包和数据库结果来自已经通过的 GitHub CI,不能混用工具链或模拟边界。尚未完成的 A05 项
f18e552f),但尚未提供所需的不可变LegacyPaymentBasis历史退款合同;不能把 opening 余额伪装成原充值。未访问生产数据库、未调用真实付费供应商、未改变共享工作区或其他任务文件。
Current independent review — remaining contract (2026-10-27 batch 2)
Independent current-base review keeps the full PR on HOLD. Six recovery source/test files were incorporated byte-for-byte in
79f8164e80f5698254e0ac4cc7e67a394e8114dd; subsequent mainline hardening must be retained. Normal payment host wiring and dispatch-bound Core refund release now exist, so older claims that they are entirely absent are historical. The three unincorporated Runtime files still carry payment-specific probe/first-success/readiness-expiry semantics that are neither accepted in the current composition lifecycle nor explicitly retired. Do not add a second unused Runtime or mark A05 complete from source presence. #895/A05 remains the owner of the unfinished readiness/dual-process recovery acceptance and original funds/UNKNOWN contracts. No new whole-A05 run or production acceptance is claimed.This disposition records current code review only. Original descriptions, failures and unmerged work are retained; no CI rerun, deployment or full-project acceptance is implied.