Repository navigation
Validate semantic escrow references and real legacy backup migration - #87
Merged
Merged
Conversation
Refs #65. Add explicit typed JSON reference contracts and reproducible pre-LedgerAccount backup tests. Follow-up connects the unchanged storage constructor to the staged implementation before publishing a repair branch.
Refs #65. Keep the existing constructor, advisory lock and enclosing transaction. The migration never rewrites ledger history or receipts. The combined change passed 28 Python 3.15/PostgreSQL migration, rollback, genuine legacy backup and network-isolation tests locally. Production acceptance remains separate; no deployment.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
LIghtJUNction
commented
Sep 27, 2026
LIghtJUNction
left a comment
Contributor
Author
There was a problem hiding this comment.
当前补丁自查,不冒充独立批准:已复核迁移阶段均使用原构造器事务和 schema advisory lock,无独立 commit;JSON 引用白名单与 schema 覆盖测试对应,普通历史数据不会作为身份授权;旧 ledger/receipt 字节、sequence 和 market/history 比对覆盖重复和并发初始化。真实旧代码 fixture 及其 source hashes 已进入 CI,原有 escrow 网络隔离测试未弱化。
当前 head 的完整 CI 36331960865 已成功,包含 Python 3.15/PostgreSQL/Valkey、核心测试、跨协议/tokenizer conformance 和构建。本地专项 28 项通过。只合并源码修复,不执行生产迁移;#65 的实际生产备份/preflight/迁移回滚证据仍须保留为未完成验收。
This was referenced Sep 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #65. This change fixes the code-level migration omission and adds actual old-version backup evidence. It does not deploy or claim acceptance of production data.
Fix
Split the LedgerAccount migration into stages on the existing PostgreSQL transaction/advisory lock. Inspect explicit typed JSON references alongside direct columns, refusing to retire an escrow identity still referenced as resource owner/author, Event actor, certificate subject/scope, or another authoritative identity. Unknown body-bearing tables fail closed. Ordinary historical names, Event.data, change notes and financial account references are not treated as authorization. No ledger row, sequence or signed receipt is rewritten.
Verification
Five focused regressions reproduced the JSON-reference omission before the fix. The final local Python 3.15/real PostgreSQL suite reports 28 passed, with no skips, covering:
ac083b3666b1b5268d90115129e2cc4e0dd11521, not a current schema with simulated FKs. Critical source hashes are pinned and required in CI.The uploaded migration and PostgreSQL blobs match the tested local files. Compilation and diff checks pass. Full current-head CI must still pass before merge.
Remaining gate
The actual production inventory, protected stored backup, preflight and separately authorized migration/rollback exercise are not available in this run. #65 therefore remains open, with
Refsrather than an automatic closing keyword. Seedocs/LEDGER_MIGRATION.mdfor the exact reference contract and reproduction procedure.