Allocate fixed KV-cache pages for variable-length requests, free them safely, and expose capacity failures.
Required APIdef paged_kv_allocate(operations, block_size, capacity):
return {'maps': ..., 'free': ..., 'rejected': [...]} BehaviorThink through the mechanism first if you want the extra reasoning step. It never blocks the editor.
paged_kv_allocate([{'op': 'alloc', 'id': 'a', 'tokens': 5}], 4, 3)logical tokens map to explicit physical pages
paged_kv_allocate([{'op': 'alloc', 'id': 'a', 'tokens': 9}], 4, 2)['rejected']memory pressure becomes a controlled rejection
2 hidden edge tests run after the visible contract passes.
Run Tests to see the contract verdicts here.