Repository navigation
fix(report): fold payback verdict uses the full post-fold window (#2044) - #507
ranxianglei wants to merge 1 commit into
Conversation
paidBack compared turnsToNextFold (requests until the NEXT fold) against the breakeven horizon n*, while savedSoFar on the same row counts every post-fold request — a fold that paid back long ago read NOT PAID BACK purely because the next fold arrived in the same batch (k=0; 73% of NPB rows in the field sample, ~38% flip under the corrected window). - paidBack now evaluates requestsAfter >= n* (same window as savedSoFar; the last fold becomes evaluable instead of forever unobserved) - the original short-window verdict survives as cadenceOk (explicit interleave-cadence signal; guard-signal candidate for #1280) - summary explainer line updated to the full-window semantics - n* print precision 1→2 decimals so verdicts are recomputable from the printed value (rounding display quirk flagged in the issue)
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)In your adapter project: npm install acp-kernel@pr-507Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf acp-kernel-pr507.tgz
npm install ./packageThis comment is automatically updated on each push. |
Review 完成:实现与批准的设计逐点吻合,本地定向验证通过,CI 全绿,可合并。本轮只审查与验证,未改任何代码。 任务识别:这是 [PR] 唤醒——PR 已存在(分支 方向关(原 issue billion-context#2044):问题属实、方向正确——判定表达式
回归审查(diff 触碰路径的既有行为逐项):
测试有效性:PR 承诺的 6 个 case 全部以精确断言钉住(paidBack/cadenceOk 的 true/false/null 逐一验证 + economics 聚合计数);事故形态回归(k=1 且 requestsAfter=9 → 本地定向验证(head 6fa4eb1):typecheck clean · tests/cache-report.test.ts 22/22 通过(与 PR 描述一致)· format:check 绿。全量套件按纪律交给 CI。 CI:head commit 最新一轮全绿(test(22) / test(24) / build-artifact / pr-validation)。注:首次推送时 pr-validation 失败过一次,同 SHA 四分钟后的重跑即绿——瞬态,与代码无关。 结构化七问
行为变更披露(均有意、均在 PR 正文列明):① 后续(本轮不做,待发布后按跨仓顺序执行):此 PR 合入、release 发版且 npm live 后,billion-context 侧做 pin 精确版本 bump + 收工判定:可合并——方向正确、实现与批准设计一致、测试有牙、diff 干净(单 commit、2 文件、每行都与本 PR 目的相关)、CI 绿、与 master 无冲突。按 §7.4 这属产品决策(verdict 口径变更),需你人工合并:#507 |
Fixes the verdict-window mismatch reported in billion-context#2044 (owner approved: 全窗口口径 + cadenceOk 字段).
Problem
computeFoldEconomicsjudged payback withturnsToNextFold >= breakevenTurns(requests until the next fold) whilesavedSoFaron the same row counts every post-fold request. A fold that paid back long ago read NOT PAID BACK purely because the next fold arrived in the same batch (k=0 — 73% of NPB rows in the field sample; counterfactual ~38% of NPB flips to PB). The last fold was foreverunobserved. Git archaeology: the short window was an intentional cadence design from #800, mislabeled with payback vocabulary.Change
paidBackturnsToNextFold >= n*(cadence window)requestsAfter >= n*(full post-fold window, same assavedSoFar)cadenceOk(new)n*print precision 1→2 decimals (verdict recomputable from the printed value; the rounding display quirk flagged in the issue)Unchanged:
savedSoFar/grossSaved/repayCost/netTokens/ GRAND LEDGER (already full-window). Zero cache/wire/config impact — report math only.Tests (22/22 in tests/cache-report.test.ts; full suite 1236/1236)
paidBack: true+cadenceOk: falsewith requestsAfter=9 ≫ n*≈3.6, k=1unobserved → PAID BACK#359formula test extended with the k=0 variantFollow-up (billion-context side, after this releases)
pin bump +
tests/cache-ledger.test.tsexpectation flips for the new verdict distribution.