Repository navigation
fix: protected-zone rejection carries acp_status guidance; leanPack ref-stability wording (#385) - #387
fix: protected-zone rejection carries acp_status guidance; leanPack ref-stability wording (#385)#387ranxianglei wants to merge 2 commits into
Conversation
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)In your adapter project: npm install acp-kernel@pr-387Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf acp-kernel-pr387.tgz
npm install ./packageThis comment is automatically updated on each push. |
29f409d to
a033a98
Compare
Full review done — verdict below. ① Original issue (#385) — direction check ② Regression review — existing behavior inventory & conclusions
③ Code review ④ Test validity ⑤ Diff cleanliness Maintenance performed (disclosure): master moved while this PR sat open (d3808d6 → 3616730 via #386, docs-only AGENTS.md +13, zero file overlap). I rebased the branch onto current master (new commits Ready for human merge: #387 中文摘要:审核了 #385 的两个文案修复(protected-zone 拒绝信息补上 acp_status 收敛指引、leanPack ref 措辞对齐 assignRefs 实际语义),逐项验证了根因、既有行为无回归、测试有牙、diff 干净;顺手把分支 rebase 到了最新 master(3616730) 并确认 CI 全绿,可以合并。 |
|
暂时搁置(维护者决定)。 理由:
查清后按根因修(比如服务端切分/收敛而不是让模型重试),文案指引只在真正的 last-resort 场景保留。 |
|
跟进搁置评论里的调查问题,结论:观察到的那批错误循环,其生产者在当前 master 上都已死,acp_status 指引确实是在给一条基本死掉的路打补丁。 生产复现(#1262, bili 0.1.55, 8/25-26)的完整因果链:
残留:当前 master 上这个拒绝只剩一种触发方式——模型完全无视 nudge 列出的 range、自己点名最新 ~5 条消息。若未来还高频出现,根治方向是把当前可压缩边界(最老可压 ref)直接嵌进拒绝文本,让错误自含收敛信息,而不是让模型多跑一趟 acp_status。维持搁置。 |
同意搁置,你的因果链我独立复核了一遍(当前 master 复核结果
对未来根治方向的精度修正:若把边界嵌进拒绝文本,有用的 ref 是带外的最新可压 ref(= 安全的最大 endId),不是最老可压 ref。措辞建议: 处置:PR 保持搁置不动(open,未合并)。注意 master 已越过它的 base( 中文摘要:独立复现证实维护者的搁置结论(refs 重编号与 opener-hash 两个陈旧 range 生产者在当前 master 均已死),并额外证明了时序偏斜也不可能让合规提交撞进保护带(保护带单调性),该拒绝现仅剩「模型自点最新几条」一种触发方式;建议未来根治时把带外最新可压 ref(最大安全 endId)直接嵌入拒绝文本,PR 维持搁置不合并。 |
Closes #385
Changes
1. Protected-zone whole-range rejection now carries convergent guidance (
src/compress.ts, single-range apply path)Old rejection tail:
New tail:
The four sibling stale-state rejections in the same module already carry this kind of convergent guidance ("Run acp_status, then call the compress tool again using only the refs it reports" / "CURRENT compressible ranges it reports"); the protected-zone path was the lone inconsistency. In production (ranxianglei/billion-context#1262) the bare message produced 3× identical-retry loops (observed 11× across 10 sessions in one day): the model proposes the last N tags it can see, gets "adjust to older messages", retries the same range, burns turns. Convergence previously depended on the model independently discovering
acp_status.2. leanPack (pi adapter) ref wording matches actual assignRefs semantics (
src/packs.ts) — the related minor observation in #385, same root cause (model-facing strings lagging the ref-semantics redesign).Old: "Refs may be renumbered after compression."
New: "Refs are stable per message content and never reissued within a session; numbering restarts from m00001 only after native compaction or an upstream/model switch."
Verified against
src/refs.ts:assignRefskeeps existingbyRawrefs and allocates monotonically fromnextIndex— refs are never reissued within a session. Numbering only restarts across generation switches / native-compaction resets, which already have dedicated error text.Behavior changes (disclosure)
Tests
tests/protect-recent.test.ts: the existing whole-range-rejection test now additionally asserts the error contains the acp_status/current-ranges pointer.tests/packs.test.ts: the acpTags test asserts the stability wording is present and the "may be renumbered" claim is gone.Both assertions fail against pre-fix code (string-pinned regression), pass post-fix.
Verification (rebased onto current origin/master d3808d6, v0.0.86)
npm run typecheck: cleannpm test: 1032/1032 passnpm run build: successformat:checkreports 119 pre-existing non-conformant files on master itself; this diff adds zero new violations)