b15955c80e
Staged-but-not-yet-fixed file artifacts from the post_module_taxonomy_de_cruft followup. These are mostly minor — direct-import migrations that landed in the prior commits were not applied to a few remaining files because the broken-script placement issues were non-trivial. For Tier 1 followup: - src/commands.py — unused 'from src import models' removed by migration - src/mcp_client.py — verified to no longer have the circular self-import - src/models.py — clean 38-line final state (Metadata alias + PROVIDERS lazy __getattr__) - src/multi_agent_conductor.py, src/project_manager.py, src/rag_engine.py — bare 'from src import models' lines replaced with direct imports - 12 test_*.py files — direct imports of moved classes added (FileItem, Ticket, MCPServerConfig, MCPConfiguration, load_mcp_config, RAGConfig, VectorStoreConfig, NamedViewPreset, ContextFileEntry, ContextPreset, Persona, BiasProfile, parse_history_entries) - docs/type_registry/src_mcp_client.md — regenerated via type_registry script No production behavior changes here. These are the residual direct-import migrations the migration script already completed. Some are tracked in the end_of_session report for Tier 1 followup.
36 lines
1.4 KiB
Python
36 lines
1.4 KiB
Python
"""
|
|
Models - Pydantic proxies + Metadata alias only.
|
|
|
|
Per module_taxonomy_refactor_20260627 Phase 5 (reduce to Pydantic
|
|
proxies) and post_module_taxonomy_de_cruft_20260627 Phases 2-4 (de-cruft
|
|
removals). All dataclass definitions, DEFAULT_TOOL_CATEGORIES, the
|
|
__getattr__ shim, and the Pydantic proxies have been moved out.
|
|
|
|
Remaining content:
|
|
- The legacy 'Metadata = TrackMetadata' alias for tests that import
|
|
'from src.models import Metadata' expecting the dataclass
|
|
- The PROVIDERS lazy __getattr__ (loads from src.ai_client on first
|
|
access; required to break a startup-speedup circular import)
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from src.mma import TrackMetadata
|
|
|
|
# Legacy alias: the original models.py had a TrackMetadata dataclass named
|
|
# 'Metadata' (before Phase 3a moved it to src.mma.py). Existing tests +
|
|
# consumers use 'from src.models import Metadata' expecting the dataclass.
|
|
# We re-export the dataclass here so the legacy import path resolves to
|
|
# the same object. The Metadata TYPE ALIAS (from src.type_aliases) is the
|
|
# boundary wire type; legacy consumers wanting the dataclass should
|
|
# migrate to 'from src.mma import TrackMetadata'.
|
|
Metadata = TrackMetadata # noqa: F401 — legacy class name re-export
|
|
|
|
|
|
def __getattr__(name: str) -> Any:
|
|
if name == "PROVIDERS":
|
|
from src import ai_client
|
|
return ai_client.PROVIDERS
|
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|