Task · CFO-0079.04

Per-class Cloudflare rate limits driven by response headers

Description

The process-wide shared 0.5 rps limiter delays polling across independent REST and GraphQL quotas. Replace it with configurable per-class quotas while respecting upstream signals; no fairness, packing, interval or collector changes.

Acceptance Criteria

Definition of Done

Implementation Plan

Loop22: based on landed R1 08a6c0eb, inspect config/client; authentic short-real-time fake upstream red on R1 then green per-class/header/budget tests; implement only frozen paths, full/race gates and CodeRabbit; hold candidate before push for independent security review. No packing/fairness/interval/new collector work.

Implementation Notes

Loop22 implementation1 plus one CodeRabbit-minor reproduce/correct cycle (conservative attempts2 of4): baseline publicclient reds for class isolation/header1second/budget, fivegreen witnesses including RetryAfter sibling pause and malformed-data budget. justcheck and racecount3 green; SecurityPASS diff777ff572; CodeRabbit all12files complete zero critical/major, soleminor fixed/redgreen. Landed15c7ef311107774105c1a4d44fdb4098888dcd96 tree d5e9f0427119167181fed560f7a5e1f09083645d hashes match review. ExactCI37301213397 success; M2-composed justcheck exit0. Intended updated tests TestProcessRateLimitRepeatedConfiguration and TestReviewSharedBudgetPublicBoundary exhaust fiveREST defaulttokens; TestReviewRedirectQueueOutsideNetworkTimeout now3rps, security/lifecycle assertions preserved. Full300s successful retry unexercised; real cancellation/pause-state/class isolation proved. Valid-long headers uncapped per contract; malformed mixed extensions outside valid envelope remains untested. Evidence /tmp/cf2otel-m2-evidence/acceptance-report.json.

Final Summary

Independent REST3rps/burst5 and GraphQL0.8rps/burst2 process budgets; compatible explicit legacy keys with one warning, nested env/validation, REST rate headers and GraphQL budget retry/cancellation. Authentic red/green, complete CodeRabbit/minorfix, security, full/repeatedrace, exactCI and composed gate green. No fairness, packing, interval/newcollectors or live calls.

View the source file on GitHub