Sweep of the per-source-file guides + Readme.md for stale references
to src/models.py as the data model home. models.py is now a ~1.5KB
re-export shim per module_taxonomy_refactor_20260627; dataclasses
moved to src/mma.py, src/project_files.py, src/type_aliases.py,
src/mcp_tool_specs.py, src/result_types.py, src/context_presets.py,
src/workspace_manager.py, src/personas.py.
- guide_gui_2.md: _gui_func line 754->1062; render_main_interface
line 1259->1898.
- python.md §10 exemption table: App gui_2.py:307->314; AppController
795->801; RAGEngine 123->125; HookServer 856->941;
HookServerInstance 130->171; HookHandler 155->208;
WebSocketServer 908->993.
- guide_multi_agent_conductor.md: Ticket now in src/mma.py (not
models.py); ConductorEngine 116+->112+; WorkerPool 50-114->52-110.
- guide_agent_memory_dimensions.md: FileItem ref models.py:510-559
-> src/project_files.py.
- guide_context_aggregation.md: FileItem + ContextPreset refs ->
src/project_files.py + src/context_presets.py; ai_client _send_*
count 5->8.
- guide_discussions.md: parse_history_entries now in src/mma.py;
ContextPreset/FileItem cross-refs updated.
- guide_personas.md: Persona now in src/personas.py; import example
updated.
- guide_rag.md: RAGConfig now in src/mcp_client.py.
- guide_workspace_profiles.md: WorkspaceProfile now in
src/workspace_manager.py.
- guide_mma.md: Data Structures section notes src/mma.py as the live
location.
- Readme.md: MMA Engine + Data Models rows updated for the
models.py shim reality + 8 providers + mma_exec deprecation.
- guide_ai_client.md: '5 provider SDKs'->8 (added note); PROVIDERS
line 56->62; __getattr__ re-export line 261->31; provider
switching examples use real registered model names (claude-sonnet-
4-5, MiniMax-M2, gemini-2.5-flash, qwen-plus, grok-2, llama-3.1);
_provider union lists all 8 providers.
python.md §17.8 and §17.10 listed audit_optional_returns.py as the
✅ implemented successor to audit_optional_in_3_files.py. Verified
via py_find_usages: audit_optional_returns does not exist in scripts/.
The live script is audit_optional_in_3_files.py (covers 4 baseline
files). Corrected the enforcement table + pre-commit workflow blocks.
Implements the 7th audit script referenced in python.md §17.8. Scans
src/*.py for local imports (§17.9a), _PREFIX aliasing (§17.9b), and
repeated .from_dict() in the same expression (§17.9c, info-only).
Three changes in this commit:
1. scripts/audit_imports.py: AST-based scanner; exits 1 in --strict on
LOCAL_IMPORT or PREFIX_ALIAS. Whitelist-aware via
scripts/audit_imports_whitelist.toml (load with --show-whitelist;
disable with --no-whitelist).
2. scripts/audit_imports_whitelist.toml: 21 files whitelisted with per-file
reason (vendor SDK warmup, hot-reload re-imports, circular-dep avoidance).
Suppresses 187 LOCAL_IMPORT sites; 0 strict violations remain.
3. conductor/code_styleguides/python.md: updated §17.8 (4th audit entry)
and §17.9a (3 documented exceptions + whitelist mechanism).
Tests: tests/test_audit_imports.py (7 tests, all passing).
The user called out the LLM training data bias: 'small files are
good, large files are bad.' This is wrong for production codebases.
Unreal has 15K+ line files; OS kernels, game engines, compilers all
routinely have 10K+ line files. File size is a non-issue. Cognitive
load is managed via naming, regions, and navigation tools (the
manual-slop MCP) — NOT via file splitting.
Updates:
1. AGENTS.md (master agent guidance):
- Added 'File Size and Naming Convention' section
- Added the hard rule: 'New namespaced src/<thing>.py files may
only be created on the user's explicit request. If you find
yourself about to create one, ASK FIRST.'
- Defaults: helpers and sub-systems go in the parent module
2. conductor/workflow.md (Guiding Principles):
- Removed 'Do NOT perform large file writes directamente' from
principle 7 (it was a delegating rule, but 'large file writes'
carried the propaganda)
- Added principle 8: 'File Naming Convention (HARD RULE)' that
references AGENTS.md
- Re-phrased principle 9 (Research-First) to clarify it's about
navigation efficiency, not file size
3. conductor/code_styleguides/python.md:
- Removed the 'extremely large files that violate the Anti-OOP
rule by necessity' framing
- Added the new rule about new src/<thing>.py files
4. .opencode/agents/tier3-worker.md and .opencode/agents/tier4-qa.md:
- Re-phrased 'Do NOT read full large files' to 'Use skeleton
tools to navigate any file regardless of size. File size is
not a concern; the right tools are.'
- Added the new rule about not creating new src/<thing>.py
files unless user explicitly requests it
5. conductor/tracks/qwen_llama_grok_followup_20260611/plan.md:
- Updated the 'Naming Convention' section to reference the new
'user explicit request' rule
This is docs-only. No code changes. The rule is now codified:
agents must ASK FIRST before creating new top-level src/ files.
One addition to conductor/code_styleguides/python.md §8
"AI-Agent Specific Conventions":
- **No diagnostic noise in production code (Added
2026-06-09).** `sys.stderr.write(f"[XYZ_DIAG] ...") lines
in src/*.py are technical debt. The right place for
one-time investigation output is tests/artifacts/<test>.diag.log
(a log file) or a standalone /tmp/diag_<name>.py script.
If you must instrument production code, the diag lines
are part of the same atomic commit as the fix.
- **Test files ARE allowed to be diagnostic.** The rule
applies to src/*.py only; tests/test_*.py may use
print(..., file=sys.stderr) freely.
Markdown only. No code modified.
- Add section 10 (Anti-OOP Conventions) to python.md with hard rules,
class justification requirements, and Strangler Fig refactoring pattern
- Create conductor/refactor_oop.md tracker with 4 phases for class elimination
- Add ruff PLR rules (PLR0912, PLR6301, PLR0206) to pyproject.toml for
OOP anti-patterns
Addresses AI agent scope misinterpretation issues by enforcing flat
function-call graphs over deep class hierarchies.
Replaces Google Python Style Guide with project-specific conventions:
1-space indentation, strict type hints on all signatures/vars,
minimal blank lines, 120-char soft limit, AI-agent conventions.
Also marks type hinting task complete in plan.md.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>