Commit Graph

89 Commits

Author SHA1 Message Date
iomgaa a06761917e fix: address M2.5 verifier findings before merge
AIMD ceiling now respects per-source max_concurrency and the pacer is
assembled explicitly in the client; MIN_CALLS parses as strict int;
acceptance doc corrects source-5 attempt count to 549; design and
migration notes aligned with implemented 429/stall/suppression
semantics and AIMD constants documented.
2026-07-21 21:10:02 -04:00
iomgaa 69968f2e8b feat: exempt 429 pushback from retry budget with stall ceiling
Round 6 hit account-level rate throttling the concurrency AIMD cannot
absorb: at 26 req/min the gateway still returned 16% 429s and each one
burned a third of the retry budget. Retry-After-guided 429s now back
off without consuming attempts (gRPC pushback semantics); the retry
loop gains a per-call ceiling using the same dual-condition stall
verdict as quota-wait (local window exceeded AND no global progress).
2026-07-21 13:19:16 -04:00
iomgaa 6b98a89bb3 feat: default two structured re-asks and sharper AIMD cut
Round 5 left three residual failure classes; ladder exhaustion (3.2%
of structured calls with a single re-ask) and 429 leakage (5.8%, AIMD
oscillating above the sustainable point) are addressable: re-ask
default goes 1 to 2 (conservative vs instructor's 3) and the AIMD cut
factor drops to 0.5.
2026-07-21 12:52:32 -04:00
iomgaa dcd386d4aa fix: insert demoted source after credible alternatives, not at tail
Round 4 showed tail placement routes the third attempt to junk sources
whenever the credible alternative is gate-skipped (tight-RPM source
admitted as credible, then skipped by the limiter, falling through to
the flapping watchdog source). Demoted sources now sit between credible
and non-credible candidates.
2026-07-21 12:08:37 -04:00
iomgaa 0e17f71482 feat: gate in-call demotion on credible alternative health
Round 3 showed unconditional yield-after-two-failures pushes the third
attempt onto known-bad sources in heterogeneous pools (83% vs 10%
expected success). OutcomeAwareSelector now exposes health(); a failed
source only yields when some untried candidate scores at least half its
health. Health-blind selectors keep the unconditional rule.
2026-07-21 11:24:52 -04:00
iomgaa 58061c7536 feat: add AIMD adaptive concurrency pacing per source
P6 round 2 showed routing convergence turns account-level 429s into
the binding constraint (62% throttle rate at full concurrency). Each
source now carries a local AIMD limit: multiplicative cut on 429,
additive growth on success. Over-limit picks queue via the existing
quota-wait poll instead of burning retry budget or tripping the
circuit-open verdict.
2026-07-21 10:38:48 -04:00
iomgaa 4c2a148db9 feat: feed selector health and demote in-call failed sources
RetryMW keeps a per-call failure map (local, never instance state):
a source failing twice in one call yields to the next candidate.
Attempt outcomes feed OutcomeAwareSelector behind a swallow-and-warn
guard; ResultInvalid and provider-rejected paths record success with
count_attempt=False so the breaker window stays clean. Same accounting
applied in EmbeddingClient.
2026-07-21 09:55:08 -04:00
iomgaa e69dc05fd5 feat: add health-aware P2C selector as default
Score is success-rate EWMA over (1 + inflight) with a 0.05 exploration
floor so quarantined sources can prove recovery; EWMA climb doubles as
slow-start. New optional OutcomeAwareSelector port feeds attempt
outcomes.
2026-07-21 09:22:37 -04:00
iomgaa e1678e4ff5 style: format M2.5 breaker changes 2026-07-21 09:11:56 -04:00
iomgaa 72b25724d8 feat: add rate-channel breaker config and health_aware default
Threshold auto-raise now uses per-source concurrency only (the M2
global-concurrency formula neutered the breaker at scale). Four new
optional keys: MIN_CALLS, FAIL_RATE, WINDOW_S, MAX_COOLDOWN_S.
2026-07-21 08:49:36 -04:00
iomgaa 5dfd88c4d6 fix: make RPM jitter exemption side-aware with one-shot room
Verifier adversarial cases showed pooled-room exemption could hide real
breaches: edge rows may only borrow from the neighbor on their own side,
and neighbor room is consumed globally so two windows cannot claim the
same slot. Also parse SQLite created_at as UTC, guard the dispatch
semaphore on progress-callback failure, and print a caveat that rescore
live checks reflect current db3 state.
2026-07-21 07:42:54 -04:00
iomgaa 56defc88fb fix: align soak scoreboard metrics with limiter semantics
RPM invariant now buckets by admit time on the Redis server clock,
exempts +/-2s boundary jitter, and excludes cache-hit rows that never
consumed a limiter slot. RSS sampling reports current ps RSS instead of
the monotonic ru_maxrss peak. Dispatch is paced by the concurrency
semaphore so --max-hours stays live and memory stays bounded. Add
--rescore RUN_ID to re-judge a finished run offline.
2026-07-21 07:22:34 -04:00
iomgaa aecc5fa216 fix: assert global error presence for fault-mixed soak scenarios 2026-07-21 04:22:04 -04:00
iomgaa 326dd24dd1 fix: address M2 verifier findings in soak harness 2026-07-21 02:05:49 -04:00
iomgaa 724dc3c328 docs: backfill env template and migration notes for M2 2026-07-21 01:28:33 -04:00
iomgaa 9aa97a61ae feat: add soak runner with budget guards and invariant scoreboard 2026-07-21 01:23:40 -04:00
iomgaa cca7071dbd feat: add soak corpus loaders and scenario generators 2026-07-21 01:17:46 -04:00
iomgaa 5e01dc738f feat: add governed embedding client with batching 2026-07-21 01:11:48 -04:00
iomgaa 193d67da93 feat: add embedding types, port and openai-compat transport 2026-07-21 01:00:55 -04:00
iomgaa d66299210b feat: add pricing table and cost calculation in telemetry emitter 2026-07-21 00:54:10 -04:00
iomgaa abb65c2324 feat: add postgres telemetry recorder with two-tier degradation 2026-07-21 00:50:33 -04:00
iomgaa 0e22fcf433 feat: add dual-condition stall detection and quiet accounting degradation 2026-07-21 00:43:39 -04:00
iomgaa aae739cebe feat: add redis six-gate rate limiter backend 2026-07-21 00:27:16 -04:00
iomgaa acc1bcc18a feat: unlock redis/postgres backend config with assembly guards 2026-07-21 00:18:42 -04:00
iomgaa 0b8460b6d5 fix: address independent verification findings
Classify empty completions as transient per human ruling (fixes flaky
real-gateway smoke and prevents caching empty responses), rename the
factory injection parameter gate to breaker per the frozen design,
rewrite the probe-entry cleanup without except BaseException, declare
python-dotenv explicitly, add a mid-backoff cancellation test, and
record all implementation errata in the design and architecture docs.
2026-07-20 22:01:26 -04:00
iomgaa 0f4ae5ee8b feat: register minimax baseline provider profile 2026-07-20 21:33:24 -04:00
iomgaa 7b9815f4bc feat: add gateway client with env-driven assembly
Includes config aggregation for multi-source env keys, from_env and
from_settings factories with explicit shared-backend injection,
gather_bounded, top-level exports, tightened import-linter layers with
the gate removed from the Makefile, and the finalized .env.example.
2026-07-20 07:47:05 -04:00
iomgaa 936895919c feat: add structured output ladder with bounded feedback retries 2026-07-20 07:22:03 -04:00
iomgaa 7608958d0e feat: add sqlite telemetry with single-emitter discipline 2026-07-20 07:16:49 -04:00
iomgaa 6286086551 feat: add response cache middleware with poisoning-safe keys 2026-07-20 07:10:42 -04:00
iomgaa c3d5079d39 feat: add retry middleware with per-attempt governance orchestration 2026-07-20 07:05:42 -04:00
iomgaa f4853bf688 feat: add source selectors and cooldown memo 2026-07-20 06:56:14 -04:00
iomgaa 4a176b6220 feat: add in-memory limiter and breaker satisfying backend contracts 2026-07-20 06:54:07 -04:00
iomgaa 454a8b5e0f feat: add openai-compatible transport with sse parsing and error translation 2026-07-20 06:45:55 -04:00
iomgaa 315142ceb1 feat: add explicit provider profile registry 2026-07-20 06:40:55 -04:00
iomgaa 5634216f91 feat: port three-layer stream liveness watchdog 2026-07-20 06:37:35 -04:00
iomgaa b46a62a8ae feat: freeze all port protocols and gate snapshots 2026-07-20 06:35:11 -04:00
iomgaa 9f177d6d64 feat: add frozen core types and error taxonomy 2026-07-20 06:32:14 -04:00
iomgaa 3058f4c744 chore: bootstrap project scaffolding
Add architecture doc (research-wiki/ARCHITECTURE.md), CLAUDE.md with
tiered SOP for Fable 5, adapted .claude skills/hooks/settings, package
skeleton (src/polygateway), pyproject with import-linter contracts,
Makefile, .env.example and smoke test.
2026-07-20 00:49:10 -04:00