mirror of
https://github.com/ranxianglei/billion-context.git
synced 2026-11-23 01:58:16 +08:00
Consolidates the #1301 served-surface gate and the #1302 kernel-export gate into one wire-contract suite and extends it per owner decision on #1304 (items 1+2+3, plus the 4-protocol scripted-client matrix phase): - tests/wire-contract-fakes.ts: WIRE_RULES ledger (WC-001..WC-006, each with production/doc provenance) + strictest-known validation for all four wires (anthropic /v1/messages, openai chat, responses, google v1beta) + four validation-parity fake upstreams on listen(0) with canned per-wire replies. - tests/wire-contract.test.ts: four layers — ledger self-check (every rule id has a live enforcement clause), A kernel exports, B bili-built surfaces, C plugin manifest (default + opt-in), D live proxy-mode forward of one client-shaped turn per protocol through the matching fake (asserts the forwarded tool set is exactly bili's intended surface and the fake's strictest validation accepts it). The anthropic lane reproduces #1299 end-to-end. Supersedes tests/kernel-pin-wire-schema.test.ts and tests/issue1299-anthropic-top-level.test.ts (all their assertions kept). - tests/wire-contract-golden.test.ts + tests/golden/wire-contract/*.json: byte-equal golden snapshots of every advertised tool schema at both layers (kernel exports, bili surfaces, plugin manifest default+opt-in); manifest version normalized to <VERSION> so release commits don't churn it. - scripts/update-wire-contract-goldens.ts: explicit regeneration path. - AGENTS.md §7.3: institutional rule — every upstream rejection/validation constraint becomes a permanent wire-contract rule inside the fixing PR; the ledger only grows.