Repository navigation
WIP(A03): offline financial opening writer, strict replay and recovery - #884
LIghtJUNction merged 4 commits into
Conversation
Reject intermediate clearing balance overflow, mixed source bindings and counter ownership mismatches before producing opening material. Include the preflight helper in tool source hashes and add 17 synthetic tests. A03 partial delivery only: keep --apply disabled; no target database writes.
|
A05 / #879 的历史退款接口依赖:目前读到本 PR 的 请在 A03 冻结的版本合同中提供:原始来源与记录摘要、目标账户/所有者映射、原 provider/merchant/environment/transaction 绑定、币种与原支付整数金额、可证明的历史额度换算依据、已退款与剩余可退累计值,以及对应的最小 Rust 账本动作和幂等/UNKNOWN 结果。新旧支付必须对同一 provider 交易统一防重。 A05 需要同时取得正常、重复/冲突、缺少换算依据、累计上限、部分退款取整、零额度差额及账户资金不足的合成输入/预期。没有明确来源时保持不可退款,不按当前汇率倒推,不创建假充值 intent,不把 opening 余额重放成原充值 journal。该请求不要求在此公开原始资金材料或数据库凭据。 A05 现有 native 回执恢复与运行组件已在 #879 推进,Go 支付包及独立 PostgreSQL 测试已由 CI 通过;历史退款仍需本合同后才能连接,不会由 Go 直接读写 Core 数据库。 |
Bind original source files, exact target instance/catalog/owners, identity receipt and approved SQL. Commit opening balances, counters and immutable receipt atomically; strictly verify replay and resolve lost acknowledgments under the original session fence. Preserve unrelated tables and sequences. Keep the existing planner SELECT-only. Add 27 contract/driver tests and 10 isolated PostgreSQL scenarios through the core integration test entry. Local: 137 tests passed, PostgreSQL scenarios skipped (no local Docker). Real-source import, subscriptions and Key rights remain separate acceptance; no production operations, workflow changes, schema or runtime ACL changes.
…iles Treat unexpected errors after SQL submission as UNKNOWN, never REFUSED. Use type-sensitive source equality and compare snapshot boot instants rather than timestamp spelling. Exercise the complete frozen-export prepare path and private file gates with ten additional tests. Fix the real PostgreSQL fixture readiness race: wait for the final PID 1 server rather than the image bootstrap socket. Apply rustfmt output from CI. Local: 147 passed; ten isolated PostgreSQL scenarios await the next CI run. The first run's failed fixture setup and Rust formatting remain recorded.
|
补充当前实库证据:f18e552f 的 PostgreSQL 测试已实际执行,157 项中 5 项失败,共同错误为 financial_import.py 的 DO 块声明了 实际失败 job。这是当前代码/CI 核查,尚未独立运行修复;首次 apply 和 UNKNOWN 恢复仍不能标为验收通过。 |
…data Rename the PL/pgSQL payload variable that conflicted with JSON row aliases in five real PostgreSQL cases. Recheck transitive catalog/count evidence before submission and after transport completion, retaining UNKNOWN on post-submission changes. Include the previously unpushed metadata regressions and an isolated PostgreSQL backend-termination test covering table/sequence rollback, read-only resolution and explicit retry of the original material. Local Python 3.13.5: 151 passed; 11 PostgreSQL tests skipped without Docker. PostgreSQL execution remains for the existing CI; no production access.
|
本轮在固定 head A03 → A04 / A05 的后续建议先拆成两个明确交付,而不是继续把 opening writer 的局部测试扩写为全迁移通过:
另有共享验收工具的权限查询问题:runtime 未获得 core_migration schema USAGE,相关测试的名称查表断言会先报 namespace 权限错误。应由 S11 修正只读权限验证/查询方式,不能为使测试通过赋予迁移表写权限或 import 函数执行权限。这与 importer 的资金校验是两类问题,需分别记录,不互相抹掉。 Draft/未集成状态保持;没有生产导入、合并或部署。来源和支付交接继续在 #895 联合核验。 |
|
补齐 PR 正文里仍写“运行中”的 CI 结果:已读取 run 38239181552 / protocol job 的结束状态和日志。
建议将正文的 CI 状态更新为以上分层结果;现有 A04/A05 合同依赖、Draft 与未完成的组合验收继续保留。没有合并或部署。 |
0e37c99
into
wip/rust-core-go-extensions
开发主线交接(2026-10-12)
开发默认主线现为
wip/rust-core-go-extensions;旧单体main与traditional冻结于3948a0a1ee1cefdd016a7aa45a11851545bb4b85。分支交接不是发布、部署或验收通过。原问题、源码基线、测试与未完成项保留;旧单体路径仅作历史证据,后续先在微服务源码重新确认并按职责移植,不回灌旧数据库/权限/资金实现。主线/S11 跟踪:#895。Extore 商品同步:#894,未验收,禁止部署,尤其禁止合并/推送 Extore
main。本 PR 的候选实现和已有验证范围保持原样;不因主线交接自动合并或标记验收完成。
范围
继续 A03,目标
wip/rust-core-go-extensions。基线a28f06e88b7adf3701937f2a4018689bdc96ad85,最新提交13132f5b0abfc58908278d9e67789e0b283c7ed6。已实现离线开账 writer;完整 A03 尚未验收,保留 Draft。不代表真实历史资金已迁移。
实现
migrate-legacy-financial.py保持只读。新financial_import.py分为 prepare / apply / resolve,不靠删除拒绝开关开放原脚本。本轮修复 —
13132f5b基于
f18e552f正常推进原分支,仅三个 A03 文件,+158/-10。没有修改共享 schema、权限、入口、配置或.github。38211718340已进入实库,其中五项开账/重放/恢复测试在column reference "p" is ambiguous处失败。生成的 PL/pgSQL 同时把p用作过程变量和查询行别名;本轮只将过程变量改为v_payload,不删除校验。verify_source_files在提交前及成功传输后重查源 catalog 和行数基准的文件哈希。缺失、内容变化、不安全权限或符号链接拒绝新提交;提交后变化保持 UNKNOWN,保留原尝试。本地实际验证
Python 3.13.5:
python3 -B -m unittest discover -s scripts -p 'test*financial*.py' -vgit apply --check通过;实际应用后与测试源码逐字节一致。4597d9fb3809c695642ba0fbb33ca80e48cef9de;文件测试601c19fbc323c1598d9a794e375b25e5098a319a;PG 测试ae9cc35899aff0b490696ddc1c2d980703efff26。CI 核验
现有 Rust 集成测试入口在 GitHub CI 启用专属、无网络、资源受限的 PostgreSQL 容器,不访问工作流共享数据库;完整金融测试共 162 项,其中 11 项为真实 PostgreSQL 场景。
本轮 Microkernel implementation checks — 38239181552 对合并候选
1a870a74f082a177ce071496d1c44b5fba150ddd执行。目前仍在运行,尚未记录本轮实库通过结论。Lint workflows已失败,Rust/实库步骤按原工作流仍继续执行;整条 CI 不能因此标为通过。结果须以实际测试日志为准。保留此前失败记录:
f5398fd5的容器临时服务器就绪误判及 Rust 格式问题在f18e552f修复;f18e552f的五项 PostgreSQL SQL 歧义失败由本轮修复。此前 standalone Compose / native protobuf 问题未在本 PR 修改,也不借局部通过声称全部 CI 通过。尚不能标记完成的部分
本轮没有生产数据库访问、真实资金操作、合并、发布或部署。不得据此关闭完整 A03 或标记 MIGRATED。