Repository navigation
spec(queen): api_fleet -- the law of the free-model fleet - #12180
Conversation
The 2026-10-25 matrix as data (7 routes, 5 z.ai pool keys, dated probes); the rotation law (numeric order, wrap, then the 4.5<->4.7 fallback pair, bounded by key_failover's MAX_ATTEMPTS_PER_TURN, fails closed); the probe classification (401 refuses the ROUTE, never the key -- the 2026-10-25 lesson; transient answers leave the matrix UNPROBED and rewrite nothing); the meter (one CreditRow per gate pass, PAY_NORMAL at 1 mTRI, pool keys and failed gates earn nothing). Gate: t27c check OK; t27c test-report exit 0 -- 6/6 pass, 0 FAIL, 0 vacuous, 5223 runtime asserts, 5 invariants proved comptime.
Summary by t27-beesChecked by the t27 compilert27c parse, parse-complete and typecheck on each changed .t27 file at
Read by the modelThis spec codifies the fleet-level law for the free-model API fleet: a dated route matrix (7 routes as of 2026-10-25), key rotation with model-pair fallback bounded by Worth a look
Read: 1 files, +477 -0, the whole diff. Head |
Closes #12170.
What
specs/queen/api_fleet.t27-- the fleet-level law for the free-model API fleet, on top of the machinery that already exists (queen/key_failover.t27per-key failover,queen/key_credit.t27lease credit,tools/bees/reviewer.pyrotation):FleetRouterows (provider, model, price in/out, status ALIVE/REFUSED/DEAD/UNPROBED, probe date YYYYMMDD, key_mask of pool keys found alive). The z.ai pool is keys 1,2,3,5,6 (no key 4): all 5 ALIVE on glm-4.5-flash, keys 1/3/6 on glm-4.7-flash, highspeed REFUSED by the plan.next_key(numeric order, wrap, NO_FLEET_KEY after the last),fallback_model(the reviewer bee's glm-4.5-flash <-> glm-4.7-flash pair, NO_MODEL for everything else),rotate/rotate_step(next key -> fallback model -> RT_FAIL; bounded bykey_failover::MAX_ATTEMPTS_PER_TURN, fails closed).probe_resultclassifies (http_code, body_marker): plan-excluded marker refuses at any status; 200 ALIVE; 401/403 REFUSE THE ROUTE, never the key (the 2026-10-25 lesson: all five keys answered 401 on 4.7-flash and ALIVE on 4.5-flash the same hour); 402/quota DEAD; 429/529/5xx/overload UNPROBED.probe_updates: an inconclusive probe never rewrites a dated row.probe_retires_keyis false over the whole answer space -- keys leave only through the lease law.credit(job_id, route_id, owner, gate_passed, tokens_est)emits oneCreditRowper gate pass; PAY_NORMAL atKEY_CREDIT_MTRI==REWARD_PER_JOB_MTRI(1 mTRI per accepted job, the existing payout rail); a failed gate, an unknown route or an owned-by-nobody pool key earns nothing. Tokens recorded, never priced.Gate
t27c check specs/queen/api_fleet.t27-- Typecheck OK (0 errors, 0 warnings), exit 0t27c test-report specs/queen/api_fleet.t27-- exit 0: 6/6 tests pass, 0 FAIL, 0 vacuous passes, 5223 runtime asserts executed, 5 invariants proved comptimeNot here (the spec says so)
Network I/O (the host probes; the spec classifies), the wiring into trios and the bee (generated, never hand-written), and issue #12170's
tri fleet scansuccess criterion -- that needs the host-side scanner that consumes this law.