Repository navigation
[PR] fix(anthropic): enforce shared 4-breakpoint cache budget and harvest message-level controls - #7615
[PR] fix(anthropic): enforce shared 4-breakpoint cache budget and harvest message-level controls#7615feriaref wants to merge 4 commits into
Conversation
…ianglei#7615) Rebase onto master picked up ranxianglei#6751, which already consumed 0.0.207. This PR's kernel/src/wire/anthropic.ts change therefore no longer carries a version bump and kernel-guard would fail. Bump to the next free version and sync the kernel + root lockfiles.
…anxianglei#7615 review) The module header still described the pre-PR discipline: 'Cap = 3 message marks + 1 system breakpoint' and 'client-managed caching suppresses our stamps entirely'. Under the shared 4-breakpoint budget the message-mark cap is dynamic (min(3, budget left after client marks + non-message breakpoints)), and full suppression now holds only in proxy mode — plugin mode counts client marks against the shared budget and keeps the system stamp plus a supplemental anchor on active folds. Comment-only fix found during review; no behavior change.
ae06e09 to
8538ffd
Compare
…anxianglei#7615 review) The PR's new message-level harvest (kernel/src/wire/anthropic.ts clientMessageControls) had no test coverage. This pins: - message-level marks re-emit on the last non-reasoning block - trailing thinking blocks stay unmarked (signature-safe) - message-level + block-level marks share the WC-010 4-breakpoint budget with the system stamp (3 client marks + 1 system stamp = 4)
(ai: vllm-qwen/qwen3.8-27b) 查重 (duplicate screening): not a duplicate. Searched open+closed for What I did to this PR (all pushed to your fork branch, force-pushed
Verification (targeted, local, on the final head): typecheck clean; host tests One drive-by finding → filed as #7622 (bug/p3/scope/ci): the WC-010 fake validator ( 8问 review:
测试缺口(如实说明): 函数级逻辑已钉死(新文件 3/3 + 我补的 message-level 测试); Kernel Boundary 状态: PR 已声明 结论: host 侧逻辑验证成立;待 (a) owner 批准 kernel 变更 + (b) 最终 head 的 CI 绿,即可合并。 标签: PR #7615 = bug/p2/scope/wiring(wire 协议缓存预算修复,触发面窄); 新 issue #7622 = bug/p3/scope/ci(测试保真缺口,无用户影响)。 |
97171b5 to
c61b12d
Compare
…anxianglei#7615 review) The module header still described the pre-PR discipline: 'Cap = 3 message marks + 1 system breakpoint' and 'client-managed caching suppresses our stamps entirely'. Under the shared 4-breakpoint budget the message-mark cap is dynamic (min(3, budget left after client marks + non-message breakpoints)), and full suppression now holds only in proxy mode — plugin mode counts client marks against the shared budget and keeps the system stamp plus a supplemental anchor on active folds. Comment-only fix found during review; no behavior change.
…anxianglei#7615 review) The PR's new message-level harvest (kernel/src/wire/anthropic.ts clientMessageControls) had no test coverage. This pins: - message-level marks re-emit on the last non-reasoning block - trailing thinking blocks stay unmarked (signature-safe) - message-level + block-level marks share the WC-010 4-breakpoint budget with the system stamp (3 client marks + 1 system stamp = 4)
(ai: vllm-qwen/qwen3.8-27b) CI-fix run: merge conflict resolved, PR is now mergeable (clean). What I did this run (rebase + conflict resolution + version discipline + verify + push):
Result: PR merge state is now Remaining (not mine to satisfy): the kernel change still needs owner approval (Kernel Boundary rule 1 — #7607 has no human approval record; the mechanical-bug exemption doesn't apply since this is a design change). Human-only merge tier applies (rule 3). Note the PR body's 8问:
收工判定: 冲突已解决并推送,PR 现为 mergeable(clean);待 (a) owner 批准 kernel 变更 + (b) 新 head |
[ework] CI fix verified green ✓ |
c61b12d to
17ef7c7
Compare
…anxianglei#7615 review) The module header still described the pre-PR discipline: 'Cap = 3 message marks + 1 system breakpoint' and 'client-managed caching suppresses our stamps entirely'. Under the shared 4-breakpoint budget the message-mark cap is dynamic (min(3, budget left after client marks + non-message breakpoints)), and full suppression now holds only in proxy mode — plugin mode counts client marks against the shared budget and keeps the system stamp plus a supplemental anchor on active folds. Comment-only fix found during review; no behavior change.
…anxianglei#7615 review) The PR's new message-level harvest (kernel/src/wire/anthropic.ts clientMessageControls) had no test coverage. This pins: - message-level marks re-emit on the last non-reasoning block - trailing thinking blocks stay unmarked (signature-safe) - message-level + block-level marks share the WC-010 4-breakpoint budget with the system stamp (3 client marks + 1 system stamp = 4)
…ianglei#7615) master consumed 0.0.209 (ranxianglei#7614) and 0.0.210 (mega-turn gap bridging) since the previous rebase; this PR's kernel/src/wire/anthropic.ts change is new on top, so it takes the next version to satisfy kernel-guard (Kernel Boundary rule 2).
(ai: vllm-qwen/qwen3.8-27b) CI-fix run 2: merge conflict resolved again — master moved under the PR. Why it went dirty again: since the previous rebase, master advanced ~60 commits ( What I did this run (rebase + version discipline + verify + push):
Result: PR merge state is now Remaining (not mine to satisfy): the kernel change still needs owner approval (Kernel Boundary rule 1 — #7607 has no human approval record; the mechanical-bug exemption doesn't apply since this is a design change). Human-only merge tier applies (rule 3). Note the PR body's 8问:
收工判定: 冲突已解决并推送,PR 现为 mergeable(clean);待 (a) owner 批准 kernel 变更 + (b) 新 head |
(ai: vllm-qwen/qwen3.8-27b) No action needed — the PR is already clean; the "dirty" wake is a stale mirror reading. I verified the LIVE state in this run (not from memory):
The "merge state: dirty" in the wake is a stale mirror reading from before the previous run's push. There is no conflict to resolve, so I did not rebase or push anything this run — re-pushing the identical head would only waste the branch's one full CI pass. Status: the PR is mergeable (clean). Remaining (not mine to satisfy): owner approval of the kernel change + green CI on |
[ework] CI fix verified green ✓ |
17ef7c7 to
77d7561
Compare
…anxianglei#7615 review) The module header still described the pre-PR discipline: 'Cap = 3 message marks + 1 system breakpoint' and 'client-managed caching suppresses our stamps entirely'. Under the shared 4-breakpoint budget the message-mark cap is dynamic (min(3, budget left after client marks + non-message breakpoints)), and full suppression now holds only in proxy mode — plugin mode counts client marks against the shared budget and keeps the system stamp plus a supplemental anchor on active folds. Comment-only fix found during review; no behavior change.
…anxianglei#7615 review) The PR's new message-level harvest (kernel/src/wire/anthropic.ts clientMessageControls) had no test coverage. This pins: - message-level marks re-emit on the last non-reasoning block - trailing thinking blocks stay unmarked (signature-safe) - message-level + block-level marks share the WC-010 4-breakpoint budget with the system stamp (3 client marks + 1 system stamp = 4)
…ianglei#7615) master consumed 0.0.211..0.0.214 (v0.1.217 release + egress plane + cross-lane switching ranxianglei#7684) since the previous rebase; this PR's kernel/src/wire/anthropic.ts change is new on top, so it takes the next version to satisfy kernel-guard (Kernel Boundary rule 2).
(ai: vllm-qwen/qwen3.8-27b) CI-fix run: merge conflict resolved — master moved significantly and this rebase required a semantic merge in the kernel wire file (thinking relay), which I resolved and verified with the full kernel + host suites. Why it went dirty (bigger than the last two runs): master advanced What I did this run (rebase + semantic merge + version discipline + verify + push):
Result: PR merge state is now
8问:
收工判定: 冲突已解决并推送,PR 现为 mergeable(clean)。本次含一处 kernel thinking 中继路径的语义合并,已用全套 kernel+host 测试验证,但仍属 kernel 变更——待 (a) owner 批准 kernel 变更(Kernel Boundary rule 1)+ (b) 新 head |
[ework] CI fix verified green ✓ |
…message-level controls
…anxianglei#7615 review) The module header still described the pre-PR discipline: 'Cap = 3 message marks + 1 system breakpoint' and 'client-managed caching suppresses our stamps entirely'. Under the shared 4-breakpoint budget the message-mark cap is dynamic (min(3, budget left after client marks + non-message breakpoints)), and full suppression now holds only in proxy mode — plugin mode counts client marks against the shared budget and keeps the system stamp plus a supplemental anchor on active folds. Comment-only fix found during review; no behavior change.
…anxianglei#7615 review) The PR's new message-level harvest (kernel/src/wire/anthropic.ts clientMessageControls) had no test coverage. This pins: - message-level marks re-emit on the last non-reasoning block - trailing thinking blocks stay unmarked (signature-safe) - message-level + block-level marks share the WC-010 4-breakpoint budget with the system stamp (3 client marks + 1 system stamp = 4)
…ianglei#7615) master consumed 0.0.215..0.0.217 (v0.1.218 release + mixed-tier auto-split ranxianglei#7770 + crush tool-result rewriter removal) since the previous rebase; this PR's kernel/src/wire/anthropic.ts change is new on top, so it takes the next version to satisfy kernel-guard (Kernel Boundary rule 2).
77d7561 to
cd3efed
Compare
(ai: vllm-qwen/qwen3.8-27b) CI-fix run 4: merge conflict resolved again — master moved under the PR and consumed two more kernel versions. Why it went dirty (same recurring class as runs 2–3): master advanced What I did this run (verified live first, then rebase + version discipline + verify + push):
Result: PR merge state is now Remaining (not mine to satisfy): the kernel change still needs owner approval (Kernel Boundary rule 1 — #7607 has no human approval record; the mechanical-bug exemption doesn't apply since this is a design change). Human-only merge tier applies (rule 3). Note the PR body's Pattern note (4th occurrence): every time master consumes a kernel version, this PR's bump commit collides on the same version line. Until the PR merges, each master kernel bump will dirty it again; this lane will keep rebase + bump in the same flow. 七问:
收工判定: 冲突已解决并推送,PR 现为 mergeable(clean);待 (a) owner 批准 kernel 变更 + (b) 新 head |
[ework] CI fix verified green ✓ |
Fixes #7607
kernel-change: harvest message-level and raw-block
cache_controlinkernel/src/wire/anthropic.tssocoreToAnthropichonors the shared 4-breakpoint Anthropic cache budget (WC-010/WC-016); bumpsacp-kernel0.0.206->0.0.207with synced lockfiles.Summary
cache_controlinanthropicToCoreand apply marks cleanly incoreToAnthropic(kernel/src/wire/anthropic.ts).computeAnthropicMessageMarksand extractstampSystemWithinAnthropicBudget(src/loop/cache-control.ts) as the single 4-breakpoint budget source of truth acrosssrc/server/prepare-anthropic.tsandsrc/loop/adapter-anthropic.ts.Verification
npm run typecheck: passnpm run check:unused-exports: cleannpm run check:test-import-graph: oknpm --prefix kernel run test: 1,661/1,661 passtests/anthropic-shared-cache-budget.test.ts,tests/cache-control.test.ts,tests/wire-contract.test.ts: 28/28 pass