AggregateKind (4 values), MemoryDim (7), AccessPattern (5),
Frequency (7), RecommendedDirection (4). All Literal types
for stable postfix DSL output (string-valued, no enum-name
lookup table needed in the parser).
5 unit tests passing. The 9 supporting dataclasses + the
AggregateProfile central artifact go in Tasks 1.2-1.10.
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.
Reflects the user's batched-run feedback that 5 pre-existing failures
needed to be fixed for the track to be truly 'done'. Lists the 5 fixes
(logging_e2e, no_temp_writes, gui2_custom_callback_hook_works,
audit_tier2_leaks x3) and acknowledges remaining live_gui flakes as
a separate infrastructure track.
audit_tier2_leaks bug: when test fixtures (tmp_path) are inside the
parent git repo, git's git diff and git ls-files look UP for a
parent .git/ directory and report the PARENT's modified files. This
made tests/test_audit_tier2_leaks.py fail because the audit reported
mcp_paths.toml + opencode.json as 'modified' even though those are in
the parent repo, not in the clean tmp_path fixture.
Fix: set GIT_DIR to a non-existent path (repo_root/.git) in the env
passed to git subprocesses. This forces git to fail, which the audit
treats as 'no modifications' / 'no tracked files'.
test_palette_starts_hidden hardening: live_gui is session-scoped so
other tests may leave the palette open. Pre-toggle the palette before
asserting it's hidden - converts a 'depends on test ordering' test
into a 'palette is closable' test.
Verification:
- tier-1-unit-core: ALL 5 batches PASS (was 5 failures)
- tier-3-live_gui: test_gui2_custom_callback_hook_works now PASSES
(was FAILED); other live_gui flakes surface non-deterministically
per batch run (pre-existing issue, not caused by this fix)
The phase2_4_5_call_site_completion_20260621 track's end-of-track report
documented 5 pre-existing tier-1-unit-core failures as 'not caused by
this track' and deferred them to a future track. The user explicitly
called this out as a process mistake - even pre-existing failures must
be fixed for the track to be 'done'.
Fixed 3 of 5 (the other 2 are sandbox-pollution audit_tier2_leaks tests
that require infrastructure changes):
1. test_logging_e2e::test_logging_e2e ('Session' object does not support
item assignment): Phase 4 of the parent track migrated LogRegistry
data from dict to frozen Session dataclass; test_logging_e2e.py was
missed in the migration. Fix: add LogRegistry.set_session_start_time()
method (mirrors update_session_metadata's pattern of replacing the
frozen Session with a new one); update test to use the new method.
2. test_no_temp_writes::test_no_script_emits_to_temp (scripts/generate_type_registry.py
uses tempfile): The --check mode was using tempfile.TemporaryDirectory
which the audit forbids. Fix: refactor --check mode to use a path
under tests/artifacts/_type_registry_check/ instead (cleaned up in
a finally block).
3. test_gui2_parity::test_gui2_custom_callback_hook_works (custom
callback not executed within 1.5s): The test used time.sleep(1.5) +
assert, the documented race condition anti-pattern. Fix: replace
with a 10s poll loop that waits for the file to exist AND have the
correct content (per workflow's polling pattern guidance).
Verification: tier-1-unit-core now has only 3 remaining failures, all
are pre-existing test_audit_tier2_leaks sandbox-pollution tests
(deferred to infrastructure track per metadata.json).
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
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)
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.