Repository navigation
[PR] fix(preflight): defer doom probe to post-fold judgment (#7261) - #7667
ranxianglei wants to merge 1 commit into
Conversation
The doom probe rejected oversized payloads by UTF-8 byte count BEFORE preflightCompress was ever attempted. The control experiment (same payload on a matching route -> 200, foldable) proved the brick is entirely from the probe's route-anchored ordering, not the payload's compressibility. Now the doom probe defers: it records the would-be rejection and lets preflightCompress run first. After the fold, the doom threshold is re-checked on the compressed result. If the fold cannot bring the payload under the threshold, the rejection still fires — but now it is a true 'truly doomed' verdict, not a 'we never tried' one. Behavior change: a payload that is over the doom threshold but foldable now gets a 200 (compression succeeds) instead of a 413. A payload that is over the doom threshold and NOT foldable still gets a 413, but the message now comes from the failFast path (compression attempted but insufficient) rather than the old doom-probe byte-math wording. Fixes #7261 (Finding A — the death chain).
查重: 同失败域但被取代——本 PR 与 master 上的 #7537 同属「preflight doom 探针本地拒绝」这一失败域,但 #7537(owner 2026-11-22 裁定,晚于本 PR 分叉 2 天才落地 master)已用「转发、以上游自己的裁决为准」取代「本地估计拒绝」。所以这不是简单重复,而是方向冲突 / 被 #7537 取代(superseded)。 Review conclusion: do not merge. Two independent blockers, the second being decisive: 1. Stale base + merge conflicts. Forked from 2. Semantically contradicted by #7537 (owner ruling 2026-11-22). #7537 removed all local-estimation-based 413 rejections from preflight and made the doom probe forward the payload so the upstream's own verdict is authoritative. This PR re-introduces exactly that removed behavior — a local estimate-based 413 — merely deferred to post-fold. The contradiction is visible in the very test this PR edits. For the identical scenario (a multi-MB core-text payload past both doom bars):
Same input, opposite expected status. Merging the PR (resolving the textual conflict in the PR's favor) would flip master's 八问:
建议(待 owner 拍板):
CI 状态: PR 创建约 15 分钟,CI 尚未运行(check-runs total 0,镜像无缓存)。鉴于上述结论,CI 绿红不影响「不应合并」的判断。 测试有效性: PR 只把两个测试的断言正则从旧 doom-probe 措辞改成通用 failFast 的 "could not bring it under",没有新增覆盖 PR 新加的 post-fold doom 判定分支( |
ranxianglei
left a comment
There was a problem hiding this comment.
Review: superseded by #7537 — do not merge; recommend closing as superseded.
Verified against v0.1.216 (6a641f37) and master (23841dab):
-
The fix already exists on master through a different design. Issue #7537 (owner ruling 2026-11-22, two days before this incident was reported) removed the entire "local estimate-refusal" class: PR #7548 (merge
9236576c1, commits7b3a17193/033c679db) turned the pre-fold doom probe into a forward instead of a 413. On current master the probe branch logs "forwarding per #7537 (no local estimate-refusal); the upstream's own size verdict is authoritative" and returns the prepared payload — there is no local 413 left in that path. #7261 Finding A (the death chain: probe rejects before any fold is attempted) no longer exists on master. -
This PR would re-introduce exactly what #7537 removed. The
doomProbeDeferredpost-fold gate returns a local byte-math 413 afterpreflightCompress— the same refusal class the owner ruling deliberately abolished ("keep only EVIDENCE-based size refusals"). Merging would put the local estimate-refusal back, contradicting the ruling. -
Branch is v0.1.216-based and CONFLICTING — master's
src/server.tsmoved ~532 lines past the tag, concentrated in this very function.
Local verification of the branch as-is: its two test files pass 10/10, the adjacent preflight/probe suites (issue2313-probe-forward, preflight-fail-fast, issue4079-egress-window-fuse, issue3846-local-refusal-evidence) pass 25/25, tsc --noEmit clean. The code is not wrong on its own base — the design it implements is superseded.
For the #7261 thread: the actual fix ships with the next release (latest tag is still v0.1.216, so nobody has #7537 yet). Findings B and C remain open — B is #7668 and C is #7669 (the earlier "8 questions" comment cross-referenced B as #7669 and cited #7670; that number does not exist).
|
Closing as superseded: #7537 (owner ruling 2026-11-22) removed the local estimate-refusal class and is already merged on master (PR #7548, merge 9236576). The pre-fold doom 413 this PR defers no longer exists there, and this PR's post-fold byte-math 413 would re-introduce exactly the refusal the ruling abolished. The fix ships with the next release (latest tag is still v0.1.216). |
Summary
The doom probe rejected oversized payloads by UTF-8 byte count BEFORE preflightCompress was ever attempted. The control experiment (same payload on a matching route → 200, foldable) proved the brick is entirely from the probe's route-anchored ordering, not the payload's compressibility.
Now the doom probe defers: it records the would-be rejection and lets preflightCompress run first. After the fold, the doom threshold is re-checked on the compressed result. If the fold cannot bring the payload under the threshold, the rejection still fires — but now it is a true "truly doomed" verdict, not a "we never tried" one.
Behavior change
Tests
tests/issue2490-ledger-floor-doomed-probe.test.tsandtests/issue2847-doomed-nonretryable-status.test.tsto match the new failFast message.issue2490-ledger-floor-doomed-probe.test.tspass.issue2847-doomed-nonretryable-status.test.tspasses.Remaining work (separate PRs / kernel change requests)
stillPresentcheck inkernel/src/sync.ts:186-193uses ANY-match, so a single surviving id keeps the whole block active. Needs a kernel change request.pendingFoldUsagelatch is intentionally NOT restored on cold load (src/persist.ts:4308-4313). Needs a decision on whether to persist it.Closes #7261