From 1198aee36ef621d0880e4d09a30fdf275ef1f651 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Tue, 24 Feb 2026 22:18:14 -0500 Subject: [PATCH] docs(mma): Draft Track 2 - State Machine & Data Structures --- .../migration_epics.md | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/conductor/tracks/mma_implementation_20260224/migration_epics.md b/conductor/tracks/mma_implementation_20260224/migration_epics.md index 82120e1..0b0dbc4 100644 --- a/conductor/tracks/mma_implementation_20260224/migration_epics.md +++ b/conductor/tracks/mma_implementation_20260224/migration_epics.md @@ -27,4 +27,27 @@ ### 3. Acceptance Testing Criteria - **Unit Tests:** All AST parsing tests pass with >90% coverage for `file_cache.py`. -- **Integration Test:** Execute the parser on a large, complex project file (e.g., `ai_client.py`). The output `Skeleton View` must be less than 15% of the original token count. The `Curated View` must correctly retain docstrings and marked functions while stripping standard bodies. \ No newline at end of file +- **Integration Test:** Execute the parser on a large, complex project file (e.g., `ai_client.py`). The output `Skeleton View` must be less than 15% of the original token count. The `Curated View` must correctly retain docstrings and marked functions while stripping standard bodies. +## Track 2: State Machine & Data Structures + +**Goal:** Define the rigid Python objects (Pydantic/Dataclasses) that AI agents will pass to each other, enforcing structured data over loose chat strings. + +### 1. TDD Approach for \models.py\ +- Create \ ests/test_models.py\. +- Write failing tests that instantiate \Track\, \Ticket\, and \WorkerContext\ with various valid and invalid schemas. +- Write tests that assert state transitions (e.g., from \pending\ to \locked\, from \step_paused\ to \completed\) correctly update internal flags and dependencies. +- **Red Phase:** Tests fail because \models.py\ classes are undefined or lack transition methods. +- **Green Phase:** Implement the dataclasses and state mutators. + +### 2. State Machine Tasks +- **Task 2.1: The Dataclasses** + - Create \models.py\. Define \Ticket\ (id, target_file, prompt, worker_archetype, status, dependencies). + - Define \Track\ (id, title, description, status, tickets). +- **Task 2.2: Worker Context Definition** + - Define \WorkerContext\ holding a \Ticket\ ID, assigned model, configuration injection, and an ephemeral \messages\ array. +- **Task 2.3: State Mutator Methods** + - Implement methods like \ icket.mark_blocked(dependency_id)\, \ icket.mark_complete()\, and \ rack.get_executable_tickets()\. Ensure strict validation of valid state transitions. + +### 3. Acceptance Testing Criteria +- **Unit Tests:** \models.py\ has 100% test coverage for all state transitions. +- **Integration Test:** Instantiate a \Track\ with 3 dependent \Tickets\ in Python. Programmatically mark tickets as complete and assert that the subsequent dependent tickets transition from \locked\ to \pending\ without any AI involvement.