Memory 019eae49

Memory ID (Session ID): 019eae49-cfc0-7000-b9ff-20aec757e941
Last Updated: 2026-06-09 23:43:31

Fact Summary

StoryMatrix Codebase Audit Findings (Actionable Fixes Required):

  1. Critical File Duplication:
  • src/[[projects/storymatrix|StoryMatrix]]/domain/models_1.py (4096 lines) is a duplicate of models.py. Needs deletion.
  • src/[[projects/storymatrix|StoryMatrix]]/application/agents/crews.py is an unimported duplicate of crew.py. Needs deletion.
  • src/[[projects/storymatrix|StoryMatrix]]/infrastructure/mock_service_old.py is obsolete.
  • .backup files and empty tests (test_chroma.py, test_simple.py, test_sanity.py) need cleanup.
  1. DI Container Issues (src/[[projects/storymatrix|StoryMatrix]]/core/container.py):
  • Bloated (1060 lines), requires splitting/refactoring.
  • _safe_init_provider uses a dangerous try: ... except Exception: pass pattern that swallows initialization errors. Needs explicit logging/error handling.
  • Line 727 contains a duplicate _provide_summary_service definition that shadows line 720.
  1. Dependency & Configuration Inconsistencies:
  • pyproject.toml Python versions conflict: requires-python expects >=3.11, while ruff/mypy/hatch configs target 3.10. Must align all to 3.11.
  • Core dependencies in pyproject.toml are bloated with web/ML tools (fastapi, nicegui, celery, redis, multiple JSON parsers). Move web/heavy dependencies to extras (e.g., [project.optional-dependencies.web]).
  1. Architectural/Code Smells:
  • mock_service.py (MockService) uses a magic null-object pattern (__getattr__, __call__ returning MockService()) that silently swallows missing methods/miswiring.
  • Exception hierarchy in src/[[projects/storymatrix|StoryMatrix]]/domain/exceptions.py is split: ValidationError and StoryGenerationError branch from StoryMatrixException rather than DomainError/StoryMatrixError, breaking exception catching.

Reference Session