fix(code-runtime-python): bound the open-merge hold by the ledger budget

The review's critical: the open-merge branch accumulated the held fragment
before any ledger check, so a forged open flood could grow host memory without
touching logBudget. The held fragment is now bounded by the exact-cost walk
(jsonStringCostUpTo against the remaining budget; the closing frame's admit()
still bills the merged entry once), and the open field is registered in the
README wire-contract section and the fd-3 protocol note (en + zh). A forged
open-flood case asserts truncation to the marker under a 64-byte budget.
This commit is contained in:
Chinesezjc
2026-08-31 15:03:20 +08:00
committed by Tianyi Cui
parent 72691455e9
commit ea1d28a068
8 changed files with 45 additions and 11 deletions
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write packages/code-runtime/code-runtime-python/README.md
README.md: c6ab48b5ccd4e386f9ad416dee64b090500594f6
README.zh.md: 637de914212be9b7e6a3b63e443d7252c092acf2
README.md: 97a4b6d4ccf51cf999dcef237aac1480a532bce6
README.zh.md: 649ca8ddd4c1ad02f27b8131c60f22511801c1e9