You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Campaign: Structure-first Deep Modules v2 & Subscription Providers.
Label: campaign:deep-modules-2.
Successor to the structural track of #441 (Gateway deep modules & Codex↔Chat). #441's Track 0 (0.1.9 closeout) and WP7 (Chat release gate) remain owned by #441; this map owns everything structural that #441's WP1–WP3 extraction did not finish, plus the subscription-provider work that rides on it.
Why a v2
The #413/#414 extraction moved code out but left three constraints that pin the monolith:
Test surface pins the facade — test_routing.py (30,372 lines) calls CodexProxyHandler private methods; the handler cannot change shape while a third of the test corpus does this.
Frozen re-export surface pins module boundaries — FROZEN_CODEX_PROXY_NAMES forces extracted modules to re-export through codex_proxy, with a late-import cycle workaround (~line 9704).
Rust side untouched — gateway.rs at 15,279 lines; only telemetry extracted; ADR-0004 cites it by line number.
Ordering principle: release the constraints, migrate the test surface, then slim the handler. Subscription providers are not a separate campaign: the credential seam lands during handler slimming, and XAI OAuth is its second adapter (the proof the seam is real).
Hard gates
Stage 1 → Stage 2 → Stage 3 are strictly serial (constraints must be released before migration; migration before slimming).
Anthropic Messages upstream (Implement and qualify Anthropic Messages as a Gateway upstream protocol #246) is out of this campaign and remains an independent ticket. Anthropic subscription OAuth is permanently out of product scope (ToS). Cursor is parked (ToS; only legit surface is an agent harness, conflicting with Gateway identity) — a note in the AgentProvider roadmap doc, no ticket.
Acceptance for "campaign done"
codex_proxy.py is a process entry only (≤ ~1k lines); deletion test passes (removing the facade scatters no complexity back to callers).
No module imports codex_proxy; FROZEN_CODEX_PROXY_NAMES is empty and its contract test deleted.
Tests cross public interfaces only; test_routing.py no longer exists (fully migrated).
gateway.rs decomposed so no ADR needs line-number references.
Adding a Provider/credential type = adding one adapter; no enum-branch edits (XAI is the acceptance case).
CI note: GitHub Actions is disabled (verification-policy.md); "Linux parity" means the local verification matrix gains Linux full-suite commands, not a hosted CI job.
Notes
Campaign: Structure-first Deep Modules v2 & Subscription Providers.
Label:
campaign:deep-modules-2.Successor to the structural track of #441 (Gateway deep modules & Codex↔Chat). #441's Track 0 (0.1.9 closeout) and WP7 (Chat release gate) remain owned by #441; this map owns everything structural that #441's WP1–WP3 extraction did not finish, plus the subscription-provider work that rides on it.
Why a v2
The #413/#414 extraction moved code out but left three constraints that pin the monolith:
test_routing.py(30,372 lines) callsCodexProxyHandlerprivate methods; the handler cannot change shape while a third of the test corpus does this.FROZEN_CODEX_PROXY_NAMESforces extracted modules to re-export throughcodex_proxy, with a late-import cycle workaround (~line 9704).gateway.rsat 15,279 lines; onlytelemetryextracted; ADR-0004 cites it by line number.Ordering principle: release the constraints, migrate the test surface, then slim the handler. Subscription providers are not a separate campaign: the credential seam lands during handler slimming, and XAI OAuth is its second adapter (the proof the seam is real).
Hard gates
deferred_coreis bypassed by runtime tool planning and expands namespace children #425).codex_proxy.pystays the process entry. Extracted modules must not import it. Official passthrough unchanged. No hidden fallback (per Campaign map: Gateway deep modules & Codex↔Chat #441 / ADR-0002).Acceptance for "campaign done"
codex_proxy.pyis a process entry only (≤ ~1k lines); deletion test passes (removing the facade scatters no complexity back to callers).codex_proxy;FROZEN_CODEX_PROXY_NAMESis empty and its contract test deleted.test_routing.pyno longer exists (fully migrated).gateway.rsdecomposed so no ADR needs line-number references.Decisions-so-far
mainatbd23c2e(integration/deep-modules-2). Repair list: catalog auth binds throughprovider_auth_mode(noprovider_id == "xai"branch); xAI session is file-authoritative;tests/test_seam_discipline.pygatescodex_proxy._*/CodexProxyHandler.__new__; tool_compatibility is bundled. Follow-ups: Adapterize remaining codex_auth identity-header branch in gateway transport #457 (codex_auth identity-header adapterization), Clear Linux-host Rust test failures and split config.rs past 3k lines #458 (Linux Rust host failures + config.rs size + clippy unused Windows items), Qualify live SuperGrok / xAI OAuth through the Gateway #459 (live SuperGrok qualification).89fe17d: XaiOauthAdapter is credential seam Fix Gateway client default model fallback ordering #2; xai provider + device-code UI; live SuperGrok CLI qualification still pending.c8033b0:test_routing.pyand the frozen facade pin are deleted.24b9dca: ADR-0005 +subscription_credentialregistry;codex_authis adapter Add Windows auto-update support #1;upstream_headersdispatches throughcredential_for().55eb3ed:tool_compatibility/isolates V1 repair from V2 adaptation; package files stay under 2k lines.bfea444:codex_proxy.pyis 242-line HTTP dispatch; admission ingateway_admission.py; lateroute_planimport removed. Python core 2003 passed / 109 skipped.3376735:gateway.rsis nowgateway/mod.rsplus inject/backup/isolated/tests; no gateway file exceeds 3k.SubscriptionCredentialinterface = access_token() / account headers / refresh() / persistence.codex_authbecomes adapter Add Windows auto-update support #1, XAI OAuth adapter Fix Gateway client default model fallback ordering #2. New ADR required.XAI_API_KEYfallback path.FROZEN_CODEX_PROXY_NAMESin the same PR.Fog
test_routing.pymigration surfaces behavior that only exists via private-method setup (would need harness extensions).proxy.rsplatform layering lands in this campaign or is deferred to a Linux-hardening follow-up.Work packages
Stage 1 — release the constraints
deferred_coreis bypassed by runtime tool planning and expands namespace children #425deferred_corebypass fix (existing P1 bug; ADR-0002 baseline)Stage 2 — test-surface migration + frozen-surface shrink
test_routing.pyto seam-level tests; shrinkFROZEN_CODEX_PROXY_NAMESin lockstepStage 3 — handler slimming + credential seam (XAI rides here)
CodexProxyHandler→ thin dispatch; late-import cycle removedSubscriptionCredentialseam + ADR;codex_authas adapter Add Windows auto-update support #1Stage 4 — Rust decomposition (parallel to 2–3)
gateway.rssplit along injection-descriptor seams (Declarative per-client injection descriptor (managed-client adapter seam) #432 direction)Stage 5 — closeout
runtime_tool_compatibility.pysplit: dispositions core / V1 / V2 / contract tablesChild tickets
deferred_coreis bypassed by runtime tool planning and expands namespace children #425 (existing)Native blocked-by edges: #451←#449, #452←#451, #453←#451, #454←#453, #456←#425.
#246 was removed from this campaign on 2026-08-23 and remains independently open.