Memory 019eaeca

Memory ID (Session ID): 019eaeca-ac0e-7000-b13d-fb6760a3714c
Last Updated: 2026-06-10 02:35:32

Fact Summary

StoryMatrix Project Constraints & Resolutions

  • Pipeline Execution: Pipeline stages are callable using await stage() rather than await stage.execute(). Avoid resolving un-awaited coroutine objects in assertions; use AsyncMock over MagicMock to prevent TypeError: object of type 'coroutine' has no len().
  • MockService Handling (mock_service.py): MockService.__getattr__ dynamically intercepts service methods (e.g., map_characters, create_story, synthesize_speech). These must be properly typed as async def coroutines. The class requires a custom get() method carefully implemented to avoid infinite recursion/shadowing against __getattr__.
  • Pause Calculations: Standard pause durations enforce exclamation_pause > period_pause > question_pause (e.g., sentence end bonus = 1.3, question bonus = 1.2).
  • Container Configuration: Service Container’s _get_music_providers() must append mock as a fallback strategy when dev_local_only or low_resource modes are enabled.
  • Voice Data (VoiceDataLoader): piper_data objects are formatted as a flat list[dict], not a deeply nested dictionary array.
  • Security Execution (test_security.py): The python command is explicitly permit-listed in allowed_commands. Command sanitization checks should evaluate inputs strictly against shlex.quote() parameters rather than string regex.
  • CLI / Typer Testing (test_cli.py): GenerateStoryUseCase.execute returns a Pydantic GenerateStoryResponse. Tests mocking the fast-dev-run CLI target must inject this Pydantic object rather than internal httpx.AsyncClient payload structures.

Reference Session