Repository navigation
test(#2653): pin the #2648 global-scope cache_control ordering constraint in the wire-contract ledger (WC-016) - #2655
Merged
Conversation
…straint as WC-016 in the wire-contract ledger
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2870-pr.2655.8532d8eThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2655.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Owner
Author
Owner
Author
[bot] 🏷 审查完成,判定:可合并。 新 head 审查要点
结构化八问
判定:可合并——分支基于当前 master,与 #2650 合并顺序无关(零文件重叠),head |
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.248-master.58c83db # this exact build
npm install -g billion-context@master # always the newest merged build
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2653
Background
The production 400 from #2648 revealed an upstream validation constraint on Anthropic
cache_control.scope:"global"breakpoints that was never recorded in the WIRE_RULES ledger — §7.3 "Wire-constraint ledger only grows" requires every constraint learned in production to become a permanent ledger entry (+ gate + validation-parity enforcement) INSIDE the fixing PR. PR #2650 added the e2e behavior test but no ledger entry; this closes that gap.Direction correction (vs issue body)
The issue's summary sentence ("a narrower scope must not appear after a global") is reversed relative to the API error quoted in #2648 itself. The rule as encoded by the API wording:
The validator encodes exactly this direction. Evidence for the strict reading of "unmarked = narrower": bili's injected tools carry no
cache_controlat all (mergeOwnedTools, src/server/inject.ts) and bili never stampsscope:"global"(src/loop/cache-control.ts) — yet #2648's request with six unmarked tools 400'd against a global system block.Changes (test-only, no src/ touched)
tests/wire-contract-fakes.tshasGlobalScopeSystemscans system blocks only; extending the predicate totools[]requires traffic evidence per KDD release v0.1.2 #9 — none observed).validateAnthropicBodygains a WC-016 clause placed before the tools early-return (the violating shape can have no tools array): walkstools[]→system[]→messages[].content[]in render order; a global breakpoint found after any unmarked or narrower-scope block → violation.tests/wire-contract.test.tsBehavior-change disclosure
None in product code —
src/untouched. CI strictness only: the anthropic validation-parity fake now rejects shapes the real API also 400s. No config surface added, no env vars, no persistence changes. Independent of PR #2650's merge order (zero file overlap).Verification
npm run typecheckcleannode --import tsx --test tests/wire-contract.test.ts— 17/17 pass (targeted; full suite left to CI per local-test discipline)