metadata.json: standard track metadata (15 fields per the
live_gui_test_fixes_20260618 precedent; includes scope,
depends_on, blocks, out_of_scope, tolerated_at_run_time,
test_summary, verification_criteria, 10 risks).
state.toml: initial state (status=active, current_phase=0;
14 phases pending; 19 verification flags all false).
TIER2_STARTUP.md: the per-track readme for the Tier 2 agent.
Track-specific supplement to conductor/tier2/agents/tier2-autonomous.md.
Covers: what to load (plan_v2.md first, spec_v2.md second;
do NOT load v1 spec/plan), hard bans (3-layer), conventions,
TDD protocol, per-task commit protocol, pre-delegation
checkpoint, failcount contract, 8 known gotchas, verification
protocol, end-of-track handoff, out-of-scope restatement.
EXPLICITLY NOTES:
- any_type_componentization_20260621 + phase2_4_5_call_site_completion_20260621
are NOT on master (merged f914b2bc, reverted 751b94d4).
v2 audit is tolerant of their absence.
- The 3 candidate aggregates (ToolSpec, ChatMessage,
ProviderHistory) are forward-compat placeholders with
is_candidate: True. The integration tests verify the
placeholder format (synthesize_aggregate_profile() in
Phase 9 Task 9.2 has the template hard-coded).
- The 1-line extension to scripts/audit_optional_in_3_files.py
is the audit gate; skipping Phase 12 Task 12.2 leaves the
new file uncovered by the Optional[T] ban.
Total v2 artifacts (committed):
- spec_v2.md (460 lines)
- plan_v2.md (5006 lines)
- metadata.json
- state.toml
- TIER2_STARTUP.md
Re-scopes the audit from 'expensive operations per action' (v1) to
'data pipelines per aggregate' (v2). The v1 framing was correct
2026-06-07 (the 4 foundational tracks were future) but is now
stale; v2 also cross-validates the data_structure_strengthening
+ data_oriented_error_handling deductions directly.
10 in-scope aggregates (Metadata, FileItem, FileItems,
CommsLogEntry, CommsLog, HistoryMessage, History, ToolDefinition,
ToolCall, Result[T]) + 3 candidate aggregates (ToolSpec,
ChatMessage, ProviderHistory; forward-compat placeholders for
any_type_componentization_20260621 which is NOT on master).
4 static analyses: PCG (3 AST passes), MemoryDim classifier,
APD (5 access patterns), CFE (7 frequencies). 11 public
functions, all return Result[T] per error_handling.md hard rule.
Decomposition-cost heuristic per aggregate answers: 'should
this data be componentize further (split) or unify further
(wider fat structs)?' 4 directions: componentize, unify, hold,
insufficient_data. 10-phase TDD plan, 69 tests total.
Consumes JSON from 6 existing audit scripts (cross-validates
data_structure_strengthening + data_oriented_error_handling).
Out-of-scope: runtime profiling (deferred to
pipeline_runtime_profiling_20260607), MMA worker spawn (cold).
v1 spec.md + plan.md preserved unchanged.
Per the Tier 2 convention, throwaway scripts are committed as archival
artifacts so future agents can understand what was tried during the track.
7 scripts:
- verify_test_format.py: AST + indentation check for new test file
- _check_line_endings.py: CRLF vs LF diagnostic
- _find_tracks_line.py: locate line 27 entry in tracks.md
- _verify_line_66.py: verify new line 66 content
- _update_tracks_md.py: programmatic update of line 27
- _update_state_toml.py: programmatic update of state.toml
- _fix_state_toml_crlf.py: restore CRLF after edits
Updates:
- conductor/tracks.md: entry #27 marked SHIPPED 2026-06-21; BLOCKER
removed for code_path_audit_20260607 (broadcast() TypeError fixed)
- state.toml: status=completed, current_phase=6, all 4 phases marked
completed with checkpoint SHAs, all verification booleans true
NOT shipped (per user instruction):
- The git mv to conductor/tracks/archive/ is the USER's responsibility
- Track directory stays at conductor/tracks/phase2_4_5_call_site_completion_20260621/
- tier2/any_type_componentization_20260621 branch NOT merged (reconnaissance framing)
Tier 2 produced this analysis during phase2_4_5_call_site_completion_20260621
Phase 6e. Supersedes Tier 1's draft at PHASE3_HYPOTHETICAL_PROMOTION.md (kept
as the hypothesis doc; this is the refined version with in-context data
from Phase 6b/6d work in src/ai_client.py).
Key findings:
- Measured 104 history references (Tier 1 estimated 112; 7% under)
- Anthropic dominates per-turn cost (~35-65µs vs Tier 1's 8-15µs estimate)
- Grok/qwen/llama are LOWER than Tier 1 estimated (~400ns vs 2-8µs)
- Total per-session: ~0.5-1.0ms (Tier 1 estimated 1.1-2.4ms)
- Discovered 3 hidden cross-references Tier 1 missed (_strip_private_keys,
_extract_minimax_reasoning, _send_llama_native)
- Recommendations for the future Phase 3 track: anthropic first; use
'with h.lock: msg_list = h.messages' for read snapshots; use
'with h.lock: h.messages = [filtered]' for in-place mutations
Covers all 6 senders (anthropic, deepseek, minimax, grok, qwen, llama)
with per-site cost estimates + hidden cross-references + recommendations.
The audit (code_path_audit_20260607) quantifies these estimates after merge.
Completes the deferred t2_6 task from any_type_componentization_20260621 Phase 2.
The 3 OpenAI-compatible senders now construct OpenAICompatibleRequest with
messages=[ChatMessage(role=, content=)] instead of list[dict] literals.
The _<provider>_history global lists are still dicts (Phase 3 deferred to
a separate track); the migration converts each dict to ChatMessage at
the request-build boundary via list comprehension. The backward-compat
shim in openai_compatible.py:86 (m.to_dict() if hasattr(m, 'to_dict')
else m) handles both ChatMessage and dict transparently.
Verified: 20/20 provider tests pass; tier-1-unit (5 pre-existing
sandbox-pollution failures unchanged); no new regressions.
Phase 5 of any_type_componentization_20260621 changed
WebSocketServer.broadcast(channel, payload) -> broadcast(message: WebSocketMessage)
but did not update internal callers. This produced worker[queue_fallback]
TypeError spam on the GUI thread.
Fixed 2 sites:
- src/app_controller.py:1849 _process_pending_gui_tasks (telemetry broadcast)
- src/events.py:115 AsyncEventQueue.put (events broadcast)
gui_2.py has no internal broadcast callers (grep verified).
Both callers now construct WebSocketMessage(channel=, payload=) at the call site.
test_websocket_broadcast_regression.py 4/4 pass (was 1/4 failing in red phase).
Phase 5 of any_type_componentization_20260621 changed
WebSocketServer.broadcast(channel, payload) -> broadcast(message: WebSocketMessage)
but did not update internal callers in src/app_controller.py + src/events.py.
This adds 4 tests that pin the contract:
- test_websocket_server_broadcast_signature: asserts (self, message) signature
- test_websocket_server_broadcast_rejects_legacy_2arg_call: asserts legacy raises TypeError
- test_websocket_server_broadcast_accepts_websocket_message_instance: smoke test
- test_internal_callers_use_websocket_message_signature: structural grep over src/
The 4th test currently FAILS (red phase), identifying 2 legacy sites:
- src/app_controller.py:1849: self.event_queue.websocket_server.broadcast('telemetry', metrics)
- src/events.py:115: self.websocket_server.broadcast('events', {...})
The structural assertion is reused by code_path_audit_20260607.
The follow-up track now includes Phase 6e: Tier 2 produces the authoritative
Phase 3 cost analysis as part of the follow-up work. Tier 2 is in
src/ai_client.py doing Phase 6b/6d anyway; they have full context to produce
the refined cost hypothesis that Tier 1's draft at PHASE3_HYPOTHETICAL_PROMOTION.md
could not (Tier 1 worked without the 6b/6d ground-truth context).
Tier 1's draft STAYS as the hypothesis doc. Tier 2's PHASE3_TIER2_ANALYSIS.md
is the refined version (per-sender cost summary + hidden call sites table
+ recommendations for the future Phase 3 track + cross-reference to Tier 1
explicit).
Phase 6e tasks (5 total, ~2 commits):
- t6e_1: Profile the 6 senders (codepath catalog + hidden cross-refs)
- t6e_2: Qualitative cost estimation per sender
- t6e_3: Identify hot iteration sites needing 'with h.lock:' pattern
- t6e_4: Author PHASE3_TIER2_ANALYSIS.md
- t6e_5: Phase 6e checkpoint commit + git note
Total estimated commits: 16 -> 18 (still within Tier 2 1-4 hour budget).
Files updated:
- conductor/tracks/phase2_4_5_call_site_completion_20260621/spec.md (+50 lines)
- conductor/tracks/phase2_4_5_call_site_completion_20260621/plan.md (+146 lines)
- conductor/tracks/phase2_4_5_call_site_completion_20260621/metadata.json (+13 lines)
- conductor/tracks/phase2_4_5_call_site_completion_20260621/state.toml (+9 lines)
- conductor/tracks.md (track 27 entry expanded with Phase 6e details)
Per FR8 in conductor/tracks/video_analysis_campaign_20260621/spec.md, mp4 files are too large for git and VTT auto-sub files are regenerable from transcript.json.
Note: existing tracked files in entropy_epiplexity (commit 5c5f347c) are still in history. The gitignore prevents FUTURE commits from adding them. To remove from history requires filter-repo/filter-branch rewrite (out of scope for this commit).
Categorizes the 12 test failures the user observed when running
scripts/run_tests_batched.py after this track:
- 10 failures (mine): Phase 2 NormalizedResponse API migration
incomplete (state.toml t2_6 deferred task); FIXED in commit 30c8b263
- 3 failures (sandbox): test_audit_tier2_leaks.py flags sandbox
files (mcp_paths.toml, opencode.json) as modified; NOT my fault
- 1 failure (pre-existing): test_gui2_custom_callback_hook_works;
live_gui test not touched by this track
Hidden 12th failure:
- worker[queue_fallback] error: WebSocketServer.broadcast() takes 2
positional arguments but 3 were given (appeared 6+ times during
tier-2-mock-app-core but tests still passed; error logged on
GUI thread from app_controller._run_pending_tasks_once_result).
Phase 5 refactored broadcast(channel, payload) to
broadcast(WebSocketMessage); I updated test_websocket_server.py
but missed app_controller.py and events.py callers.
Sections:
1. Executive summary (3 categories of failure)
2. Per-failure categorization (10 + 3 + 1)
3. Hidden 12th failure: WebSocket broadcast callers in app_controller
4. Phase 2 API migration status (8 sites; 5 done, 3 unverified)
5. Recommendations for follow-up track (~5 call sites + ~41 Phase 3)
6. Code-path audit input (5 micro-benchmarks to add)
Follow-up track scope: ~15-20 commits, well-scoped. Should run BEFORE
code_path_audit_20260607 because the worker[queue_fallback] TypeError
spam will confuse the audit's runtime instrumentation.