conductor(plan): Mark Phase 1 tasks 1.1-1.6 complete (8d9f25d)

This commit is contained in:
2026-03-02 16:19:01 -05:00
parent 8d9f25d0ce
commit 00a196cf13

View File

@@ -9,44 +9,14 @@ Architecture reference: [docs/guide_mma.md](../../../docs/guide_mma.md)
## Phase 1: Tier Tagging at Emission
Focus: Add `current_tier` context variable to `ai_client` and stamp it on every comms/tool entry at the point of emission. No UI changes — purely data layer.
- [ ] Task 1.1: Add `current_tier` module variable to `ai_client.py`.
- **Location**: `ai_client.py` line 91 (beside `tool_log_callback`). Confirm with `get_file_slice(87, 95)`.
- **What**: Add `current_tier: str | None = None` as a module-level variable.
- **How**: Use `Edit` to insert after `tool_log_callback: Callable[[str, str], None] | None = None`.
- **Verify**: `grep -n "current_tier" ai_client.py` returns the new line.
- [x] Task 1.1: Add `current_tier` module variable to `ai_client.py`. 8d9f25d
- [x] Task 1.2: Stamp `source_tier` in `_append_comms`. 8d9f25d
- [x] Task 1.3: Set/clear `current_tier` in `run_worker_lifecycle` (Tier 3). 8d9f25d
- [x] Task 1.4: Set/clear `current_tier` in `generate_tickets` (Tier 2). 8d9f25d
- [x] Task 1.5: Migrate `_tool_log` from tuple to dict; update emission and storage. 8d9f25d
- [x] Task 1.6: Write tests for Phase 1. 8 tests, 12/12 passed. 8d9f25d
- [ ] Task 1.2: Stamp `source_tier` in `_append_comms`.
- **Location**: `ai_client._append_comms` (`ai_client.py:136-147`). Confirm with `py_get_definition`.
- **What**: Add `"source_tier": current_tier` as a key in the `entry` dict (after `"model"`).
- **How**: Use `Edit` to insert the key into the dict literal.
- **Note**: Add comment: `# current_tier is set/cleared by caller tiers; safe — ai_client.send() calls are serialized by the MMA engine executor.`
- **Verify**: Manually check the dict has `source_tier` key.
- [ ] Task 1.3: Set/clear `current_tier` in `run_worker_lifecycle` (Tier 3).
- **Location**: `multi_agent_conductor.run_worker_lifecycle` (`multi_agent_conductor.py:224-354`). The `try:` block that calls `ai_client.send()` starts at line ~296. Confirm with `py_get_definition`.
- **What**: Before the `try:` block, add `ai_client.current_tier = "Tier 3"`. In the existing `finally:` block (which already restores `ai_client.comms_log_callback`), add `ai_client.current_tier = None`.
- **How**: Use `Edit` to insert before `try:` and inside `finally:`.
- **Verify**: After edit, `py_get_definition(run_worker_lifecycle)` shows both lines.
- [ ] Task 1.4: Set/clear `current_tier` in `generate_tickets` (Tier 2).
- **Location**: `conductor_tech_lead.generate_tickets` (`conductor_tech_lead.py:6-48`). The `try:` block starts at line ~21. Confirm with `py_get_definition`.
- **What**: Before the `try:` block (before `response = ai_client.send(...)`), add `ai_client.current_tier = "Tier 2"`. In the existing `finally:` block (which restores `_custom_system_prompt`), add `ai_client.current_tier = None`.
- **How**: Use `Edit`.
- **Verify**: `py_get_definition(generate_tickets)` shows both lines.
- [ ] Task 1.5: Migrate `_tool_log` from tuple to dict; update emission and storage.
- **Step A — `_on_tool_log`** (`gui_2.py:897-900`): Change to read `ai_client.current_tier` and pass it: `self._append_tool_log(script, result, ai_client.current_tier)`.
- **Step B — `_append_tool_log`** (`gui_2.py:1496-1503`): Change signature to `_append_tool_log(self, script: str, result: str, source_tier: str | None = None)`. Change `self._tool_log.append((script, result, time.time()))` to `self._tool_log.append({"script": script, "result": result, "ts": time.time(), "source_tier": source_tier})`.
- **Step C — type hint in `__init__`**: Change `self._tool_log: list[tuple[str, str, float]] = []` to `self._tool_log: list[dict] = []`.
- **How**: Use `Edit` for each step. Confirm with `py_get_definition` after each.
- **Verify**: `grep -n "_tool_log" gui_2.py` — all references confirmed; `_render_tool_calls_panel` still uses tuple destructure (fixed in Phase 2).
- [ ] Task 1.6: Write tests for Phase 1.
- Confirm `ai_client._append_comms` produces entries with `source_tier` key (even if `None`).
- Confirm `_append_tool_log` stores a dict with `source_tier` key.
- Run `uv run pytest tests/ -x -q`.
- [ ] Task 1.7: Conductor — User Manual Verification
- [~] Task 1.7: Conductor — User Manual Verification
- Launch app. Open a send in normal mode — confirm comms entries in Operations Hub > Comms History still render.
- (MMA run not required at this phase — data layer only.)