Skip to content

Campaign map: structure-first deep modules v2 & subscription providers #448

Description

@NOirBRight

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:

  1. Test surface pins the facadetest_routing.py (30,372 lines) calls CodexProxyHandler private methods; the handler cannot change shape while a third of the test corpus does this.
  2. Frozen re-export surface pins module boundariesFROZEN_CODEX_PROXY_NAMES forces extracted modules to re-export through codex_proxy, with a late-import cycle workaround (~line 9704).
  3. Rust side untouchedgateway.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

  1. Stage 1 → Stage 2 → Stage 3 are strictly serial (constraints must be released before migration; migration before slimming).
  2. Stage 4 (Rust) may run parallel to Stages 2–3.
  3. Stage 5 is closeout only (Stage 5B: Split runtime_tool_compatibility.py into dispositions core / V1 / V2 / contract tables #456 tool-compatibility split), blocked by Stage 1A (deferred_core is bypassed by runtime tool planning and expands namespace children #425).
  4. codex_proxy.py stays 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).
  5. 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).

Decisions-so-far

Fog

  • Whether test_routing.py migration surfaces behavior that only exists via private-method setup (would need harness extensions).
  • Exact tranche boundaries for Stage 2 (by handler topic vs by seam module).
  • Whether proxy.rs platform layering lands in this campaign or is deferred to a Linux-hardening follow-up.
  • Version number that ships the XAI provider.

Work packages

Stage 1 — release the constraints

Stage 2 — test-surface migration + frozen-surface shrink

Stage 3 — handler slimming + credential seam (XAI rides here)

Stage 4 — Rust decomposition (parallel to 2–3)

Stage 5 — closeout

Child tickets

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Priority 1: current iteration goalcampaign:deep-modules-2Structure-first deep modules v2 & subscription providersenhancementNew feature or requestwayfinder:mapWayfinder campaign map

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions