Memory 019eaef6
Memory ID (Session ID): 019eaef6-56cc-7000-9b4c-92412d2da8c2
Last Updated: 2026-06-10 03:04:20
Fact Summary
Project: StoryMatrix
- Critical Architecture Pitfall (DI Container):
container.pyis a massive ~1300-line God Object. Do NOT attempt to split it into subsets (e.g., DatabaseContainer, AudioContainer). Splitting carries an 8-12 hour regression risk. Maintain the monolith for DI setup. Experimental stubs ininfrastructure/containers/are deprecated/purged. - Identity & UUIDs: Deterministic UUID generation (uuid5) must be centralized via domain utilities in
src/[[projects/storymatrix|StoryMatrix]]/domain/utils/identity.py(e.g.,generate_character_id). Do not duplicate this logic across services likestory_creation_service.pyorcrew_transformer_service.py. - Path Handling: Use
pathlib.Pathproperties (.suffix,.stem) instead of primitive string manipulations like.rsplit()(e.g., insrc/[[projects/storymatrix|StoryMatrix]]/utils/path_utils.py) for multi-platform robustness. - Observability/Tracing: Ensure central domain/application services (e.g.,
StoryOrchestrationServiceand its core methods likeexecute_story_generation_pipeline,generate_story_plan_and_data,generate_timeline) are decorated with OpenTelemetry’s@tracer.start_as_current_spanto avoid tracing gaps between CrewAI and domain logic. - Imports: Hoist imports to module level. Avoid deeply nested/inline imports (e.g.,
json,CharacterDTO) within functions to prevent performance hits and PEP-8 violations. - Testing: CLI tests can be verified using the command:
APP__DEV_LOCAL_ONLY=true uv run pytest tests/unit/test_cli.py. - Subagent Tooling: To dispatch subagents (e.g., for reviews), use the
tasktool withagent: "reviewer"and atasksarray defining theid,description, andassignmentpayload.
Reference Session
- Associated Chat Session: 019eaef6-56cc-7000-9b4c-92412d2da8c2