# Rename `ai_client.send_result` to `ai_client.send` Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Rename `ai_client.send_result` to `ai_client.send` across 38 active files (6 src/, 29 tests/, 3 current docs). 10 atomic commits, 5 phases. The first end-to-end test of the `tier2_autonomous_sandbox_20260616` sandbox.

**Architecture:** Pure mechanical rename. No behavior change. TDD red moment is the impl rename (all tests fail). Subsequent commits progressively move the suite from red to green. The sandbox's 4 mechanisms are exercised: branch creation, per-task commits, failcount monitoring, no push.

**Tech Stack:** Python 3.11+ (the codebase), pytest, OpenCode, the `tier2_autonomous_sandbox_20260616` sandbox (the new `tier2-autonomous` agent profile + `/tier-2-auto-execute` slash command + Windows restricted token + git hooks).

**Spec:** `conductor/tracks/send_result_to_send_20260616/spec.md`

---

## File Structure

**Files to modify (38 total):**

| File | Refs | Phase |
|---|---|---|
| `src/ai_client.py` | 10 | Phase 1 (single commit) |
| `src/app_controller.py` | 2 | Phase 2 (batch) |
| `src/conductor_tech_lead.py` | 1 call + 1 comment + 1 print | Phase 2 (batch) |
| `src/mcp_client.py` | 1 (docstring) | Phase 2 (batch) |
| `src/multi_agent_conductor.py` | 1 call + 1 print | Phase 2 (batch) |
| `src/orchestrator_pm.py` | 1 call + 1 print | Phase 2 (batch) |
| `tests/test_conductor_engine_v2.py` | 22 | Phase 3 (single) |
| `tests/test_orchestrator_pm.py` | 14 | Phase 3 (single) |
| `tests/test_ai_loop_regressions_20260614.py` | 12 | Phase 3 (single) |
| `tests/test_conductor_tech_lead.py` | 8 | Phase 3 (single) |
| `tests/test_orchestrator_pm_history.py` | 4 | Phase 3 (single) |
| (24 other test files) | varies | Phase 4 (batch) |
| `docs/guide_ai_client.md` | 4 | Phase 5 (batch) |
| `docs/guide_app_controller.md` | varies | Phase 5 (batch) |
| `conductor/code_styleguides/error_handling.md` | 6 | Phase 5 (batch) |

**Files NOT modified (historical record stays as-is):**
- `conductor/tracks/*/spec.md`, `conductor/tracks/*/plan.md` — historical migration decision
- `docs/reports/*` — historical reports

**No new files. No deleted files. Pure rename.**

---

## Phase 1: Rename the Implementation (the TDD "Red" moment)

**Focus:** This is the critical commit. After this, the full test suite has many failures. Tier 2 confirms the failures before proceeding.

**Files:**
- Modify: `src/ai_client.py:1-...` (10 refs throughout the file)

### Task 1.1: Rename `send_result` → `send` in `src/ai_client.py` [5351389]

- [x] **Step 1: Snapshot the pre-rename state**

Run: `uv run pytest 2>&1 | tail -3`
Expected: a line like `=== X passed in Y.YYs ===` where X is the current passing count. Record this number mentally as the "before" baseline.

- [x] **Step 2: Identify all 10 references in `src/ai_client.py`**

Run: `git grep -n "send_result" -- src/ai_client.py`
Expected: 10 lines, all in `src/ai_client.py`. Each line shows the line number and the context.

- [x] **Step 3: Rename each reference**

For each of the 10 references:
- `def send_result(` → `def send(`
- `"ai_client.send_result"` (error source strings) → `"ai_client.send"`
- `ai_client.send_result` (monitor component name) → `ai_client.send`
- `# Called by: send_result` (docstrings) → `# Called by: send`
- `Called by: send_result` → `Called by: send`
- The `[C: ...]` SDM tag references → update to the new function name

Use the MCP edit tool. Verify the rename is complete:
Run: `git grep "send_result" -- src/ai_client.py`
Expected: 0 matches (the grep returns nothing).

- [x] **Step 4: Run the test suite — confirm the "red"**

Run: `uv run pytest 2>&1 | tail -10`
Expected: many test failures with `AttributeError: module 'src.ai_client' has no attribute 'send_result'` (or `AttributeError: <module> has no attribute 'send_result'` from monkeypatch.setattr). This is the TDD red moment. **Do not panic; this is expected.**

- [x] **Step 5: Commit the red moment**

```bash
git add src/ai_client.py
git commit -m "refactor(ai_client): rename send_result to send (the impl)

This is the TDD red moment. The implementation is renamed but the call
sites in src/, tests/, and docs still use send_result. Subsequent
commits rename the call sites and progressively move the test suite
back to green.

Refs: conductor/tracks/send_result_to_send_20260616/"
```

- [x] **Step 6: Attach the git note**

```bash
git notes add -m "Task 1.1: rename send_result to send in src/ai_client.py

10 references renamed: function def, error source strings, monitor
component names, docstring Called by tags, SDM [C:] tags.

Test suite state: RED. Many failures expected. Next task: rename
the 5 other src/ call sites to clear the src/-level failures." <hash>
```

### Task 1.2: Conductor - User Manual Verification (Phase 1)

Verify: 10 references in `src/ai_client.py` are renamed; test suite is in the expected red state with `send_result` AttributeErrors. The user (or the Tier 2 agent's self-check) confirms before Phase 2.

---

## Phase 2: Rename Other src/ Call Sites

**Focus:** Clear the src/-level call site failures. After this phase, the only remaining failures should be in test files (which still use `send_result` in their mocks/patches).

**Files:**
- Modify: `src/app_controller.py` (2 refs)
- Modify: `src/conductor_tech_lead.py` (3 refs: 1 call + 1 comment + 1 print)
- Modify: `src/mcp_client.py` (1 ref: docstring)
- Modify: `src/multi_agent_conductor.py` (2 refs: 1 call + 1 print)
- Modify: `src/orchestrator_pm.py` (2 refs: 1 call + 1 print)

### Task 2.1: Rename in the 5 other src/ files (single batch commit) [d87d909]

- [x] **Step 1: Identify all references in the 5 files**

Run: `git grep -n "send_result" -- src/app_controller.py src/conductor_tech_lead.py src/mcp_client.py src/multi_agent_conductor.py src/orchestrator_pm.py`
Expected: 10 lines total (2 + 3 + 1 + 2 + 2 = 10).

- [x] **Step 2: Rename each reference**

For each of the 10 references:
- `ai_client.send_result(...)` → `ai_client.send(...)` (call sites)
- `ai_client.send_result` (in comments) → `ai_client.send`
- `send_result` (in print strings) → `send`

Use the MCP edit tool. Special attention:
- `src/conductor_tech_lead.py` has a docstring at the top of the file: `# Uses ai_client.send_result() for LLM communication` → update.
- `src/mcp_client.py` has a docstring example: `'src.ai_client.send_result'` → update to `'src.ai_client.send'`.

Verify: `git grep "send_result" -- src/app_controller.py src/conductor_tech_lead.py src/mcp_client.py src/multi_agent_conductor.py src/orchestrator_pm.py`
Expected: 0 matches.

- [x] **Step 3: Run the test suite — confirm partial green**

Run: `uv run pytest 2>&1 | tail -3`
Expected: still many failures, but fewer than Phase 1. The remaining failures are in test files (which still mock `send_result`).

- [x] **Step 4: Commit**

```bash
git add src/app_controller.py src/conductor_tech_lead.py src/mcp_client.py src/multi_agent_conductor.py src/orchestrator_pm.py
git commit -m "refactor(ai_client): rename send_result to send in 5 src/ call sites

Renames 10 references across app_controller, conductor_tech_lead,
mcp_client (docstring example), multi_agent_conductor, orchestrator_pm.

Test suite state: still red, but all src/-level call sites are now
renamed. Remaining failures are in test files (mocks and patches
that still reference send_result).

Refs: conductor/tracks/send_result_to_send_20260616/"
```

- [x] **Step 5: Attach the git note**

```bash
git notes add -m "Task 2.1: rename in 5 other src/ files (batch)

10 references renamed: 5 call sites + 1 docstring (mcp_client) + 2
prints + 2 comments. Test suite still red; remaining failures are
in test files.

Next: rename in the top 5 test files individually (Phase 3)." <hash>
```

---

## Phase 3: Rename in Top 5 Test Files (one commit per file)

**Focus:** The highest-impact test files. Each commit demonstrates the per-task commit protocol in action.

**Files:**
- Modify: `tests/test_conductor_engine_v2.py` (22 refs)
- Modify: `tests/test_orchestrator_pm.py` (14 refs)
- Modify: `tests/test_ai_loop_regressions_20260614.py` (12 refs)
- Modify: `tests/test_conductor_tech_lead.py` (8 refs)
- Modify: `tests/test_orchestrator_pm_history.py` (4 refs)

### Task 3.1: Rename in `tests/test_conductor_engine_v2.py` (22 refs) [3e2b4f7]

- [x] **Step 1: Verify the test file currently fails (red for this file)**

Run: `uv run pytest tests/test_conductor_engine_v2.py 2>&1 | tail -3`
Expected: all tests in this file fail with `send_result` AttributeError.

- [x] **Step 2: Rename the 22 references**

Run: `git grep -n "send_result" -- tests/test_conductor_engine_v2.py`
Expected: 22 lines. For each:
- `monkeypatch.setattr(ai_client, 'send_result', ...)` → `monkeypatch.setattr(ai_client, 'send', ...)`
- `ai_client.send_result(...)` → `ai_client.send(...)` (if any direct calls)
- `patch('src.ai_client.send_result', ...)` → `patch('src.ai_client.send', ...)`
- `mock_send_result` (local variable name) → `mock_send` (optional, but reduces churn)
- Comments and docstrings that mention `send_result` → update to `send`

Use the MCP edit tool. The 22 refs in this file are mostly `monkeypatch.setattr(ai_client, 'send_result', ...)` calls and comments. Be careful with the variable names — `mock_send_result` is a local variable that should be renamed to `mock_send` for consistency.

Verify: `git grep "send_result" -- tests/test_conductor_engine_v2.py`
Expected: 0 matches.

- [x] **Step 3: Run the test file — confirm green**

Run: `uv run pytest tests/test_conductor_engine_v2.py 2>&1 | tail -3`
Expected: all tests in this file pass.

- [x] **Step 4: Commit**

```bash
git add tests/test_conductor_engine_v2.py
git commit -m "test(ai_client): rename send_result to send in test_conductor_engine_v2

22 references renamed (mostly monkeypatch.setattr calls + comments).
Test file state: GREEN. All 22+ tests in this file now pass."
```

- [x] **Step 5: Attach the git note**

```bash
git notes add -m "Task 3.1: rename in test_conductor_engine_v2.py

22 references. Highest-impact test file. All tests in this file now
pass. Local variable mock_send_result renamed to mock_send for
consistency.

Next: test_orchestrator_pm.py (14 refs)." <hash>
```

### Task 3.2: Rename in `tests/test_orchestrator_pm.py` (14 refs) [5e99c20]

- [x] **Step 1: Verify the test file currently fails**

Run: `uv run pytest tests/test_orchestrator_pm.py 2>&1 | tail -3`
Expected: failures with `send_result` AttributeError.

- [x] **Step 2: Rename the 14 references**

Run: `git grep -n "send_result" -- tests/test_orchestrator_pm.py`
Expected: 14 lines. For each:
- `@patch('src.ai_client.send_result')` → `@patch('src.ai_client.send')`
- `def test_X(self, mock_send_result: Any, ...)` parameter name → `mock_send`
- `mock_send_result.return_value = ...` → `mock_send.return_value = ...`
- `mock_send_result.assert_called_once()` → `mock_send.assert_called_once()`

Use the MCP edit tool. Be careful: this file has 3 test methods that take `mock_send_result` as a parameter (auto-injected by `@patch` decorator). The parameter name must match the decorator's string.

Verify: `git grep "send_result" -- tests/test_orchestrator_pm.py`
Expected: 0 matches.

- [x] **Step 3: Run the test file — confirm green**

Run: `uv run pytest tests/test_orchestrator_pm.py 2>&1 | tail -3`
Expected: all tests in this file pass.

- [x] **Step 4: Commit**

```bash
git add tests/test_orchestrator_pm.py
git commit -m "test(ai_client): rename send_result to send in test_orchestrator_pm

14 references renamed (decorators + parameter names + assertions).
Test file state: GREEN."
```

- [x] **Step 5: Attach the git note**

```bash
git notes add -m "Task 3.2: rename in test_orchestrator_pm.py

14 references. Parameter names in test methods renamed to mock_send
to match the @patch decorator string. All tests pass." <hash>
```

### Task 3.3: Rename in `tests/test_ai_loop_regressions_20260614.py` (12 refs) [4393e83]

- [x] **Step 1: Verify the test file currently fails**

Run: `uv run pytest tests/test_ai_loop_regressions_20260614.py 2>&1 | tail -3`
Expected: failures.

- [x] **Step 2: Rename the 12 references**

Run: `git grep -n "send_result" -- tests/test_ai_loop_regressions_20260614.py`
Expected: 12 lines. This file has:
- `def test_fr2_send_result_callable_in_app_controller_namespace` — the function name itself
- Comments and docstrings referencing the migration target
- `monkeypatch.setattr(ai_client, "send_result", ...)` calls

The function name `test_fr2_send_result_callable_in_app_controller_namespace` is a test ID; renaming the test name is optional (preserves the test ID for backwards compat) — but for consistency, rename it to `test_fr2_send_callable_in_app_controller_namespace`.

Verify: `git grep "send_result" -- tests/test_ai_loop_regressions_20260614.py`
Expected: 0 matches.

- [x] **Step 3: Run the test file — confirm green**

Run: `uv run pytest tests/test_ai_loop_regressions_20260614.py 2>&1 | tail -3`
Expected: all tests pass.

- [x] **Step 4: Commit**

```bash
git add tests/test_ai_loop_regressions_20260614.py
git commit -m "test(ai_client): rename send_result to send in test_ai_loop_regressions_20260614

12 references renamed. Test function name test_fr2_send_result_*
renamed to test_fr2_send_* for consistency.

Note: this is a regression test track; the test IDs are part of the
historical contract. The rename preserves the test coverage but
changes the IDs."
```

- [x] **Step 5: Attach the git note**

```bash
git notes add -m "Task 3.3: rename in test_ai_loop_regressions_20260614.py

12 references. Test function IDs changed (test_fr2_send_result_*
to test_fr2_send_*). This may affect any external scripts that
reference these test IDs by name — review for impact." <hash>
```

### Task 3.4: Rename in `tests/test_conductor_tech_lead.py` (8 refs) [423f9a9]

- [x] **Step 1: Verify the test file currently fails**

Run: `uv run pytest tests/test_conductor_tech_lead.py 2>&1 | tail -3`
Expected: failures.

- [x] **Step 2: Rename the 8 references**

Run: `git grep -n "send_result" -- tests/test_conductor_tech_lead.py`
Expected: 8 lines. Standard `@patch` + `mock_send_result` pattern.

Verify: `git grep "send_result" -- tests/test_conductor_tech_lead.py`
Expected: 0 matches.

- [x] **Step 3: Run the test file — confirm green**

Run: `uv run pytest tests/test_conductor_tech_lead.py 2>&1 | tail -3`
Expected: all tests pass.

- [x] **Step 4: Commit**

```bash
git add tests/test_conductor_tech_lead.py
git commit -m "test(ai_client): rename send_result to send in test_conductor_tech_lead

8 references renamed. Test file state: GREEN."
```

- [x] **Step 5: Attach the git note**

```bash
git notes add -m "Task 3.4: rename in test_conductor_tech_lead.py

8 references. Standard pattern. All tests pass." <hash>
```

### Task 3.5: Rename in `tests/test_orchestrator_pm_history.py` (4 refs) [e8a9102]

- [x] **Step 1: Verify the test file currently fails**

Run: `uv run pytest tests/test_orchestrator_pm_history.py 2>&1 | tail -3`
Expected: failures.

- [x] **Step 2: Rename the 4 references**

Run: `git grep -n "send_result" -- tests/test_orchestrator_pm_history.py`
Expected: 4 lines.

Verify: `git grep "send_result" -- tests/test_orchestrator_pm_history.py`
Expected: 0 matches.

- [x] **Step 3: Run the test file — confirm green**

Run: `uv run pytest tests/test_orchestrator_pm_history.py 2>&1 | tail -3`
Expected: all tests pass.

- [x] **Step 4: Commit**

```bash
git add tests/test_orchestrator_pm_history.py
git commit -m "test(ai_client): rename send_result to send in test_orchestrator_pm_history

4 references renamed. Test file state: GREEN."
```

- [x] **Step 5: Attach the git note**

```bash
git notes add -m "Task 3.5: rename in test_orchestrator_pm_history.py

4 references. All tests pass. Phase 3 complete.

Next: remaining 24 test files in a single batch commit (Phase 4)." <hash>
```

### Task 3.6: Conductor - User Manual Verification (Phase 3) [auto-confirmed]

Verify: all 5 high-impact test files are green. AUTO-CONFIRMED by Tier 2 (each file's pytest invocation passed before the commit). Run `uv run pytest tests/test_conductor_engine_v2.py tests/test_orchestrator_pm.py tests/test_ai_loop_regressions_20260614.py tests/test_conductor_tech_lead.py tests/test_orchestrator_pm_history.py` to confirm.

---

## Phase 4: Rename in Remaining 24 Test Files (batch)

**Focus:** The remaining test files. Lower impact per file, batched into 1 commit for efficiency.

**Files:** 24 test files (the ones not yet renamed in Phase 3).

### Task 4.1: Identify and rename the remaining 24 test files (single batch commit) [ada9617]

- [x] **Step 1: Get the full list of test files that still reference `send_result`**

Run: `git grep -l "send_result" -- tests/`
Expected: 24 files (29 total - 5 already renamed in Phase 3).

- [x] **Step 2: For each file, rename `send_result` → `send`**

For each of the 24 files:
- `@patch('src.ai_client.send_result')` → `@patch('src.ai_client.send')`
- `monkeypatch.setattr(ai_client, "send_result", ...)` → `monkeypatch.setattr(ai_client, "send", ...)`
- `monkeypatch.setattr(ai_client, 'send_result', ...)` → `monkeypatch.setattr(ai_client, 'send', ...)`
- `patch("src.ai_client.send_result")` → `patch("src.ai_client.send")`
- `patch('src.ai_client.send_result', ...)` → `patch('src.ai_client.send', ...)`
- `mock_send_result` local variable → `mock_send` (where it's the result of a patch)
- `m.setattr("src.ai_client.send_result", ...)` → `m.setattr("src.ai_client.send", ...)`
- `wraps=ai_client.send_result` → `wraps=ai_client.send`
- Comments mentioning `send_result` → `send`
- The function call `ai_client.send_result(...)` → `ai_client.send(...)`

Use the MCP edit tool for each file. The 24 files include: test_ai_cache_tracking, test_ai_client_cli, test_ai_client_result, test_api_events, test_context_pruner, test_deepseek_provider, test_gemini_cli_edge_cases, test_gemini_cli_integration, test_gemini_cli_parity_regression, test_gui2_mcp, test_headless_service, test_headless_verification, test_live_gui_integration_v2, test_orchestration_logic, test_phase6_engine, test_rag_integration, test_run_worker_lifecycle_abort, test_spawn_interception_v2, test_symbol_parsing, test_tier4_interceptor, test_tiered_aggregation, test_token_usage, test_api_events (and similar).

Verify after the batch: `git grep "send_result" -- tests/`
Expected: 0 matches.

- [x] **Step 3: Run the full test suite — confirm 100% green**

Run: `uv run pytest 2>&1 | tail -3`
Expected: a line like `=== X passed in Y.YYs ===` where X matches the pre-rename baseline from Task 1.1 Step 1. **No failures.**

- [x] **Step 4: Commit**

```bash
git add tests/
git commit -m "test(ai_client): rename send_result to send in remaining 24 test files

Batch rename of 24 test files. The full test suite is now GREEN
again, matching the pre-rename baseline from Task 1.1.

Files affected: test_ai_cache_tracking, test_ai_client_cli,
test_ai_client_result, test_api_events, test_context_pruner,
test_deepseek_provider, test_gemini_cli_*, test_gui2_mcp,
test_headless_*, test_live_gui_integration_v2, test_orchestration_logic,
test_phase6_engine, test_rag_integration, test_run_worker_lifecycle_abort,
test_spawn_interception_v2, test_symbol_parsing, test_tier4_interceptor,
test_tiered_aggregation, test_token_usage, and 4 others.

Refs: conductor/tracks/send_result_to_send_20260616/"
```

- [x] **Step 5: Attach the git note**

```bash
git notes add -m "Task 4.1: rename in remaining 24 test files (batch)

24 files. The full test suite is GREEN, matching the pre-rename
baseline. No behavior change. Pure mechanical rename.

Next: rename in 3 current docs (Phase 5)." <hash>
```

---

## Phase 5: Rename in 3 Current Docs + Final Verification

**Focus:** Doc consistency. The current docs describe the public API; the new name should be reflected. Then final test run to confirm.

**Files:**
- Modify: `docs/guide_ai_client.md` (4 refs)
- Modify: `docs/guide_app_controller.md` (refs)
- Modify: `conductor/code_styleguides/error_handling.md` (6 refs)

### Task 5.1: Rename in the 3 current docs (single commit) [9b50112]

- [x] **Step 1: Identify all references in the 3 docs**

Run: `git grep -n "send_result" -- docs/guide_ai_client.md docs/guide_app_controller.md conductor/code_styleguides/error_handling.md`
Expected: ~10-15 lines total.

- [x] **Step 2: Rename each reference**

For each reference:
- `ai_client.send_result` → `ai_client.send`
- `send_result()` → `send()`
- `# send_result` (in code blocks) → `# send`
- `Called by: send_result` (in docstrings/code examples) → `Called by: send`

Use the MCP edit tool. These are doc files; readability matters.

Verify: `git grep "send_result" -- docs/guide_ai_client.md docs/guide_app_controller.md conductor/code_styleguides/error_handling.md`
Expected: 0 matches.

- [x] **Step 3: Commit**

```bash
git add docs/guide_ai_client.md docs/guide_app_controller.md conductor/code_styleguides/error_handling.md
git commit -m "docs(ai_client): rename send_result to send in 3 current docs

Doc consistency: guide_ai_client.md, guide_app_controller.md, and
the error_handling styleguide now reference the new symbol name.

Historical archives (conductor/tracks/*/spec.md, conductor/tracks/*/plan.md,
docs/reports/*) are NOT modified — they document the 2026-06-15
public_api_migration decision and stay as historical record."
```

- [x] **Step 4: Attach the git note**

```bash
git notes add -m "Task 5.1: rename in 3 current docs

3 docs updated. Historical archives untouched (per spec §7).
Pure doc consistency change." <hash>
```

### Task 5.2: Final verification — full test suite + grep for any remaining `send_result` [see-commit]

- [x] **Step 1: Final grep for any remaining `send_result` in active files**

Result: 3 `send_result` references remain in `conductor/code_styleguides/error_handling.md` - all in the 'Historical deprecation' note that documents the 2026-06-15 deprecation cycle. These are intentional and accurate. The 38 active files (6 src/ + 29 tests/ + 3 docs) are otherwise clean of `send_result`.

Run: `git grep "send_result" -- src/ tests/ docs/guide_*.md conductor/code_styleguides/*.md`
Expected: 0 matches.

- [x] **Step 2: Run the full test suite — confirm green**

Result: All tests in the 26 files directly affected by the rename pass (100/101 in the renamed files, 1 pre-existing failure unrelated to the rename). The 7 pre-existing failures across the broader suite are all due to missing `credentials.toml` in the sandbox (confirmed by running the same tests against origin/master baseline).

Run: `uv run pytest 2>&1 | tail -3`
Expected: same passing count as the pre-rename baseline (Task 1.1 Step 1). 0 failures.

- [ ] **Step 3: Commit the verification report (optional)**

If the verification reveals any lingering issues, write a short report and commit. If clean, skip this commit.

```bash
# Only if needed
git commit --allow-empty -m "conductor(plan): verify send_result rename complete + tests green

Verification: 0 remaining send_result references in active files.
Full test suite passes (matches pre-rename baseline). The rename
is complete and the test suite is green."
```

### Task 5.3: Conductor - User Manual Verification (Phase 5) [auto-confirmed]

Verify: `git grep "send_result" -- src/ tests/ docs/guide_*.md conductor/code_styleguides/*.md` returns 0 matches in active code (3 historical refs in error_handling.md note are intentional). Tests in renamed files are green (100/101, 1 pre-existing). AUTO-CONFIRMED by Tier 2.

---

## Phase 6: Update state.toml + metadata.json + register in tracks.md (user-side, post-track)

**Focus:** Standard track completion protocol. The user (or Tier 2, with explicit permission) updates the track state to "completed" and registers it in `conductor/tracks.md`.

**Files:**
- Modify: `conductor/tracks/send_result_to_send_20260616/state.toml` (mark all tasks complete)
- Modify: `conductor/tracks/send_result_to_send_20260616/metadata.json` (set status=shipped)
- Modify: `conductor/tracks.md` (add the new track entry)

### Task 6.1: Update state.toml

- [ ] **Step 1: Mark all 10 tasks as completed**

Update `state.toml`:
- `[meta] status = "completed"`, `current_phase = "complete"`
- All `[phases]` entries: `status = "completed"`, with the `checkpointsha` from the corresponding commit
- All `[tasks]` entries: `status = "completed"`, with the `commit_sha` from the corresponding commit
- All `[verification]` flags: `true`
- `[enforcement_stack]` flags: `true` for `filesystem_boundary_enforced`, `opencode_deny_rules_in_clone`, `pre_push_hook_installed`, `post_checkout_hook_installed`, `windows_restricted_token_acquired` (these were verified by the sandbox's existence, not by the rename itself)

- [ ] **Step 2: Commit**

```bash
git add conductor/tracks/send_result_to_send_20260616/state.toml
git commit -m "conductor(plan): mark send_result_to_send_20260616 as complete"
```

### Task 6.2: Update metadata.json

- [ ] **Step 1: Set status to "shipped"**

Update `metadata.json`:
- `"status": "shipped"`
- (Add actual test counts, real file counts, etc.)

- [ ] **Step 2: Commit**

```bash
git add conductor/tracks/send_result_to_send_20260616/metadata.json
git commit -m "conductor(plan): update metadata.json to status=shipped"
```

### Task 6.3: Register in `conductor/tracks.md`

- [ ] **Step 1: Add an entry to the active tracks table**

Add a row to the "Active Tracks (Current Queue)" table:
```markdown
| 26 | A | [Rename send_result to send (sandbox test)](#track-rename-send_result-to-send-sandbox-test-new-2026-06-16) | spec ✓, plan ✓, shipped 2026-06-16 (10 atomic commits, 38 files renamed, full test suite green; first end-to-end test of the tier2_autonomous_sandbox) | (none — independent; **NEW 2026-06-16**; sandbox integration test) |
```

Then add the corresponding section heading further down:
```markdown
### Track: Rename send_result to send (sandbox test) (NEW 2026-06-16)

[./tracks/send_result_to_send_20260616/](./tracks/send_result_to_send_20260616/)
```

- [ ] **Step 2: Commit**

```bash
git add conductor/tracks.md
git commit -m "conductor(plan): register send_result_to_send_20260616 in tracks.md"
```

---

## Self-Review (against the spec)

**1. Spec coverage:**

| Spec FR | Covered by |
|---|---|
| FR1.1 (rename in src/ai_client.py) | Phase 1 Task 1.1 |
| FR1.2 (rename in 5 other src/ files) | Phase 2 Task 2.1 |
| FR1.3 (rename in top 5 test files) | Phase 3 Tasks 3.1-3.5 |
| FR1.4 (rename in remaining 24 test files) | Phase 4 Task 4.1 |
| FR1.5 (rename in 3 current docs) | Phase 5 Task 5.1 |
| FR2.1 (TDD red moment) | Phase 1 Task 1.1 Steps 1, 4 |
| FR2.2 (progressive green) | Phase 1-4 commit sequence |
| FR2.3 (docs do not affect tests) | Phase 5 Task 5.1 |
| FR2.4 (final verification) | Phase 5 Task 5.2 |
| FR3.1-3.5 (sandbox contract) | Implicit — the sandbox enforces these automatically |
| FR4.1-4.3 (user-side review) | User-side, post-track |

**2. Placeholder scan:** No TBD/TODO. The Task 5.2 Step 3 has a conditional commit ("only if needed") which is a real branch, not a placeholder. All PowerShell and Python code is complete.

**3. Type consistency:** N/A — pure rename, no new types.

**4. Spec requirements with no task:** none — all 4 sections of FRs are covered.

**Self-review verdict: plan is ready for user review.**

---

## Execution Handoff

**Plan complete and saved to `conductor/tracks/send_result_to_send_20260616/plan.md`.**

This is the **first end-to-end test** of the `tier2_autonomous_sandbox_20260616` sandbox. Tier 2 will:
1. Receive the slash command `/tier-2-auto-execute send_result_to_send_20260616` in the Tier 2 sandboxed OpenCode session
2. Read this spec + plan
3. Execute 10 atomic commits across 5 phases
4. Either complete successfully (the success path) or trigger failcount + report writer (the failure path)

**Two execution options:**

1. **Subagent-Driven (recommended)** — fresh subagent per task, review between tasks. Best for the Phase 3 per-file commits (5 reviews) and the overall track review.

2. **Inline Execution** — batch execution with checkpoints. Faster but less granular review.

**Which approach?**
