Private
Public Access
0
0

conductor(checkpoint): Phase 2 complete — PROVIDERS moved to src/ai_client.py

Phase 2 ships:
- PROVIDERS lives in src/ai_client.py:56 (canonical home for
  AI-client constants per the HARD RULE on src/ files)
- src/models.py keeps a __getattr__ re-export (PEP 562) for
  backward compat; lazy-loaded to break the circular import
  (src.ai_client imports ToolPreset/BiasProfile/Tool from
  models at line 50, so a top-level 'from src.ai_client
  import PROVIDERS' would deadlock)
- 4 call sites in src/app_controller.py:3093 and
  src/gui_2.py:{2293,2849,5377} updated from
  models.PROVIDERS to ai_client.PROVIDERS (direct lookup,
  no per-call __getattr__ cost)
- Stale tests/test_provider_curation.py updated from 5 to
  8 providers
- New test tests/test_providers_source_of_truth.py asserts
  the re-export + object identity
- New audit scripts/audit_providers_source_of_truth.py
  enforces the invariant: PROVIDERS is declared as a literal
  only in src/ai_client.py

Verification:
- 63 vendor + tool + provider + import-isolation tests pass
- 5 audit scripts pass
- No regressions

Side-track surfaced (not in scope for Phase 2):
src/models.py is bloated with non-MMA types
(Tool/ToolPreset/BiasProfile/MCPConfiguration/ContextPreset/
Persona/RAGConfig/ExternalEditorConfig/ThinkingSegment/etc.)
that belong in their respective sub-system modules per the
HARD RULE. This is a separate refactor track — proposed as
'namespace_cleanup_20260611' in the follow-up track's
deferred_work section. Should be elevated to its own track
before Phase 3 (UX adaptations) to keep the codebase
maintainable.

Commits in this phase:
- 74c3b6b2: move PROVIDERS to src/ai_client.py; re-export
- 6c6a4aef: update 4 import sites
- be505605: add audit script
- <this> (empty): Phase 2 checkpoint
This commit is contained in:
2026-06-11 16:46:40 -04:00
parent be5056051a
commit 7b24ee9da5

Diff Content Not Available