diff --git a/docs/reports/code_path_audit/2026-06-24/aggregates/ChatMessage.md b/docs/reports/code_path_audit/2026-06-24/aggregates/ChatMessage.md new file mode 100644 index 00000000..adc21a72 --- /dev/null +++ b/docs/reports/code_path_audit/2026-06-24/aggregates/ChatMessage.md @@ -0,0 +1,92 @@ +# Aggregate Profile: ChatMessage + +**Aggregate kind:** candidate_dataclass +**Memory dim:** discussion +**Is candidate:** True + +## Pipeline summary + +- Producers: 0 +- Consumers: 0 +- Distinct producer fqnames: 0 +- Distinct consumer fqnames: 0 +- Access pattern (aggregate): mixed +- Frequency (aggregate): unknown +- Decomposition direction: insufficient_data +- Struct field count (estimated): 0 + +## Producers (0) + +_(none)_ + +## Consumers (0) + +_(none)_ + +## Field access matrix + +_(no field accesses detected)_ + +## Access pattern + +**Dominant pattern:** mixed +**Evidence count:** 0 + +## SSDL Sketch for ChatMessage + +_(placeholder; candidate aggregate)_ + + +## Frequency + +**Dominant frequency:** unknown +**Evidence count:** 0 + +## Result coverage + +**Summary:** + +| metric | value | +|---|---| +| total producers | 0 | +| result producers | 0 | +| total consumers | 0 | +| result consumers | 0 | + +## Type alias coverage + +**Summary:** + +| metric | value | +|---|---| +| total field-access sites | 0 | +| typed sites (canonical field) | 0 | +| untyped sites (wildcard) | 0 | + +## Cross-audit findings + +_(no cross-audit findings mapped to this aggregate)_ + +## Decomposition cost + +**Current cost estimate:** 0 us/turn +**Componentize savings:** 0 us/turn +**Unify savings:** 0 us/turn +**Recommended direction:** insufficient_data +**Rationale:** candidate aggregate; would be detected after any_type_componentization_20260621 merges +**Struct field count (estimated):** 0 +**Struct frozen:** False + +## Struct shape (inferred from producer returns) + +_(no producers; cannot infer shape)_ + +## Optimization candidates + +_(no optimization candidates generated)_ + +## Verdict + +candidate aggregate; would be detected after any_type_componentization_20260621 merges + +## Evidence appendix diff --git a/docs/reports/code_path_audit/2026-06-24/aggregates/CommsLog.md b/docs/reports/code_path_audit/2026-06-24/aggregates/CommsLog.md new file mode 100644 index 00000000..c8ef8591 --- /dev/null +++ b/docs/reports/code_path_audit/2026-06-24/aggregates/CommsLog.md @@ -0,0 +1,173 @@ +# Aggregate Profile: CommsLog + +**Aggregate kind:** typealias +**Memory dim:** discussion +**Is candidate:** False + +## Pipeline summary + +- Producers: 6 +- Consumers: 5 +- Distinct producer fqnames: 6 +- Distinct consumer fqnames: 5 +- Access pattern (aggregate): whole_struct +- Frequency (aggregate): per_turn +- Decomposition direction: hold +- Struct field count (estimated): 5 + +## Producers (6) + +### `src\ai_client.py` (4 producers) + +- `src.ai_client._list_minimax_models_result` (line 2436) +- `src.ai_client._list_gemini_models_result` (line 1626) +- `src.ai_client._set_minimax_provider_result` (line 398) +- `src.ai_client._list_anthropic_models_result` (line 1317) + +### `src\gui_2.py` (2 producers) + +- `src.gui_2._drain_normalize_errors` (line 7417) +- `src.gui_2._render_beads_tab_list_result` (line 8314) + +## Consumers (5) + +### `src\app_controller.py` (3 consumers) + +- `src.app_controller._symbol_resolution_result` (line 3506) +- `src.app_controller._topological_sort_tickets_result` (line 4708) +- `src.app_controller._serialize_tool_calls_result` (line 2217) + +### `src\gui_2.py` (1 consumer) + +- `src.gui_2.__init__` (line 7550) + +### `src\project_manager.py` (1 consumer) + +- `src.project_manager.calculate_track_progress` (line 420) + +## Field access matrix + +| consumer | _attr_name | _cached | _module_name | _report_worker_error | +|---|---|---|---|---| +| `_symbol_resolution_result` | . | . | . | . | +| `_topological_sort_tickets_result` | . | . | . | 1 | +| `_serialize_tool_calls_result` | . | . | . | . | +| `calculate_track_progress` | . | . | . | . | +| `__init__` | 1 | 1 | 1 | . | + +## Access pattern + +**Dominant pattern:** whole_struct +**Evidence count:** 5 + +**Per-function pattern distribution:** + +- `whole_struct`: 4 functions (80%) +- `field_by_field`: 1 functions (20%) + +## SSDL Sketch for `CommsLog` + +``` +[Q:CommsLog entry-point] -> [Q:PCG lookup] + -> [1: _symbol_resolution_result] [B:check] (branches=4) + -> [2: _topological_sort_tickets_result] [B:check] (branches=2) + -> [3: _serialize_tool_calls_result] [B:check] (branches=2) + -> [4: calculate_track_progress] [B:check] (branches=1) + -> [5: __init__] [B:check] (branches=0) + -> [T:done] +``` + +**Effective codepaths:** 27 (sum of 2^branches across 5 consumers) +**Total branch points:** 9 +**Nil-check functions:** 0 + +**Defusing opportunities:** + +- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `commslog_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 4 field-check branches to 1 cache lookup. + - Effective codepaths: 27 -> 4 + + +## Frequency + +**Dominant frequency:** per_turn +**Evidence count:** 5 + +**Per-function frequency distribution:** + +- `per_turn`: 5 functions + +## Result coverage + +**Summary:** 6 producers, 5 consumers + +| metric | value | +|---|---| +| total producers | 6 | +| result producers | 6 | +| total consumers | 5 | +| result consumers | 0 | + +## Type alias coverage + +**Summary:** 4 sites; 0 typed (0%); 4 untyped (100%) + +| metric | value | +|---|---| +| total field-access sites | 4 | +| typed sites (canonical field) | 0 | +| untyped sites (wildcard) | 4 | + +## Cross-audit findings + +| bucket | audit script | site count | example file | example line | note | +|---|---|---|---|---|---| +| optional_in_baseline | `audit_optional_in_3_files` | 76 | `src\ai_client.py` | 159 | 76 sites | + +## Decomposition cost + +**Current cost estimate:** 470 us/turn +**Componentize savings:** 0 us/turn +**Unify savings:** 70 us/turn +**Recommended direction:** hold +**Rationale:** CommsLog: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. +**Struct field count (estimated):** 5 +**Struct frozen:** True + +## Struct shape (inferred from producer returns) + +| field | access count | access pattern | +|---|---|---| +| `_report_worker_error` | 1 | used | +| `_module_name` | 1 | used | +| `_attr_name` | 1 | used | +| `_cached` | 1 | used | + +## Optimization candidates + +_(no optimization candidates generated)_ + +## Verdict + +CommsLog: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. + +## Evidence appendix + +### Access pattern evidence + +| function | pattern | field_accesses | confidence | +|---|---|---|---| +| `src.app_controller._symbol_resolution_result` | `whole_struct` | | low | +| `src.app_controller._topological_sort_tickets_result` | `whole_struct` | `_report_worker_error`=1 | high | +| `src.app_controller._serialize_tool_calls_result` | `whole_struct` | | low | +| `src.project_manager.calculate_track_progress` | `whole_struct` | | low | +| `src.gui_2.__init__` | `field_by_field` | `_module_name`=1, `_attr_name`=1, `_cached`=1 | high | + +### Frequency evidence + +| function | frequency | source | note | +|---|---|---|---| +| `src.gui_2._drain_normalize_errors` | `per_turn` | `static_analysis` | producer from src\gui_2.py | +| `src.ai_client._list_minimax_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py | +| `src.ai_client._list_gemini_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py | +| `src.gui_2._render_beads_tab_list_result` | `per_turn` | `static_analysis` | producer from src\gui_2.py | +| `src.ai_client._set_minimax_provider_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py | diff --git a/docs/reports/code_path_audit/2026-06-24/aggregates/CommsLogEntry.md b/docs/reports/code_path_audit/2026-06-24/aggregates/CommsLogEntry.md new file mode 100644 index 00000000..68d34343 --- /dev/null +++ b/docs/reports/code_path_audit/2026-06-24/aggregates/CommsLogEntry.md @@ -0,0 +1,559 @@ +# Aggregate Profile: CommsLogEntry + +**Aggregate kind:** typealias +**Memory dim:** discussion +**Is candidate:** False + +## Pipeline summary + +- Producers: 117 +- Consumers: 66 +- Distinct producer fqnames: 96 +- Distinct consumer fqnames: 46 +- Access pattern (aggregate): whole_struct +- Frequency (aggregate): per_turn +- Decomposition direction: hold +- Struct field count (estimated): 10 + +## Producers (117) + +### `src\aggregate.py` (1 producer) + +- `src.aggregate.build_file_items` (line 158) + +### `src\ai_client.py` (16 producers) + +- `src.ai_client._load_credentials` (line 282) +- `src.ai_client._pre_dispatch` (line 2089) +- `src.ai_client.get_comms_log` (line 273) +- `src.ai_client.get_gemini_cache_stats` (line 1604) +- `src.ai_client._add_bleed_derived` (line 3332) +- `src.ai_client._get_anthropic_tools` (line 664) +- `src.ai_client._dashscope_call` (line 2716) +- `src.ai_client._extract_dashscope_tool_calls` (line 2754) +- `src.ai_client._send_cli_round_result` (line 1746) +- `src.ai_client._parse_tool_args_result` (line 741) +- `src.ai_client._content_block_to_dict` (line 1200) +- `src.ai_client.ollama_chat` (line 2938) +- `src.ai_client._get_deepseek_tools` (line 1194) +- `src.ai_client._strip_private_keys` (line 1464) +- `src.ai_client._build_chunked_context_blocks` (line 1281) +- `src.ai_client.get_token_stats` (line 3185) + +### `src\api_hook_client.py` (39 producers) + +- `src.api_hook_client.post_project` (line 470) +- `src.api_hook_client.drag` (line 230) +- `src.api_hook_client.set_value` (line 212) +- `src.api_hook_client.get_financial_metrics` (line 520) +- `src.api_hook_client.get_gui_health` (line 434) +- `src.api_hook_client.select_list_item` (line 256) +- `src.api_hook_client.get_mma_status` (line 539) +- `src.api_hook_client.get_project_switch_status` (line 374) +- `src.api_hook_client.get_performance` (line 318) +- `src.api_hook_client.get_patch_status` (line 295) +- `src.api_hook_client.get_startup_timeline` (line 353) +- `src.api_hook_client.get_events` (line 124) +- `src.api_hook_client.get_gui_state` (line 165) +- `src.api_hook_client.click` (line 223) +- `src.api_hook_client.get_node_status` (line 532) +- `src.api_hook_client.reject_patch` (line 288) +- `src.api_hook_client.get_project` (line 367) +- `src.api_hook_client.get_warmup_status` (line 325) +- `src.api_hook_client.right_click` (line 237) +- `src.api_hook_client.get_io_pool_status` (line 420) +- `src.api_hook_client.push_event` (line 156) +- `src.api_hook_client.get_warmup_wait` (line 332) +- `src.api_hook_client.get_status` (line 105) +- `src.api_hook_client._make_request` (line 65) +- `src.api_hook_client.wait_for_project_switch` (line 389) +- `src.api_hook_client.apply_patch` (line 281) +- `src.api_hook_client.get_context_state` (line 491) +- `src.api_hook_client.post_project` (line 473) +- `src.api_hook_client.get_warmup_canaries` (line 342) +- `src.api_hook_client.trigger_patch` (line 274) +- `src.api_hook_client.clear_events` (line 129) +- `src.api_hook_client.post_session` (line 117) +- `src.api_hook_client.get_session` (line 502) +- `src.api_hook_client.get_mma_workers` (line 546) +- `src.api_hook_client.get_gui_diagnostics` (line 311) +- `src.api_hook_client.post_gui` (line 149) +- `src.api_hook_client.get_system_telemetry` (line 524) +- `src.api_hook_client.select_tab` (line 263) +- `src.api_hook_client.wait_for_event` (line 136) + +### `src\app_controller.py` (30 producers) + +- `src.app_controller.wait` (line 5205) +- `src.app_controller.get_mma_status` (line 2835) +- `src.app_controller._api_get_performance` (line 195) +- `src.app_controller.get_performance` (line 2856) +- `src.app_controller.get_diagnostics` (line 2862) +- `src.app_controller.load_config` (line 5142) +- `src.app_controller._api_get_context` (line 398) +- `src.app_controller._api_status` (line 209) +- `src.app_controller.generate` (line 2868) +- `src.app_controller._api_generate` (line 221) +- `src.app_controller._api_token_stats` (line 417) +- `src.app_controller._api_get_gui_state` (line 123) +- `src.app_controller._api_get_diagnostics` (line 202) +- `src.app_controller.get_api_session` (line 2847) +- `src.app_controller.token_stats` (line 2898) +- `src.app_controller._api_get_api_session` (line 170) +- `src.app_controller._offload_entry_payload` (line 4240) +- `src.app_controller._pending_mma_spawn` (line 2772) +- `src.app_controller._api_pending_actions` (line 335) +- `src.app_controller.get_context` (line 2892) +- `src.app_controller.get_session` (line 2883) +- `src.app_controller.status` (line 2865) +- `src.app_controller.get_session_insights` (line 3049) +- `src.app_controller._api_get_api_project` (line 188) +- `src.app_controller._api_get_mma_status` (line 144) +- `src.app_controller._pending_mma_approval` (line 2776) +- `src.app_controller.get_api_project` (line 2853) +- `src.app_controller.pending_actions` (line 2874) +- `src.app_controller.get_gui_state` (line 2829) +- `src.app_controller._api_get_session` (line 374) + +### `src\models.py` (23 producers) + +- `src.models.to_dict` (line 646) +- `src.models.to_dict` (line 1000) +- `src.models.to_dict` (line 672) +- `src.models.to_dict` (line 938) +- `src.models.to_dict` (line 855) +- `src.models.to_dict` (line 441) +- `src.models.to_dict` (line 406) +- `src.models.to_dict` (line 355) +- `src.models.parse_history_entries` (line 214) +- `src.models.to_dict` (line 737) +- `src.models.to_dict` (line 486) +- `src.models.to_dict` (line 913) +- `src.models.to_dict` (line 596) +- `src.models.to_dict` (line 794) +- `src.models.to_dict` (line 558) +- `src.models.to_dict` (line 971) +- `src.models.to_dict` (line 1024) +- `src.models.to_dict` (line 288) +- `src.models.to_dict` (line 701) +- `src.models.to_dict` (line 886) +- `src.models.to_dict` (line 1059) +- `src.models._load_config_from_disk` (line 186) +- `src.models.to_dict` (line 618) + +### `src\project_manager.py` (8 producers) + +- `src.project_manager.load_history` (line 209) +- `src.project_manager.default_project` (line 123) +- `src.project_manager.migrate_from_legacy_config` (line 253) +- `src.project_manager.load_project` (line 186) +- `src.project_manager.get_all_tracks` (line 342) +- `src.project_manager.default_discussion` (line 117) +- `src.project_manager.flat_config` (line 267) +- `src.project_manager.str_to_entry` (line 75) + +## Consumers (66) + +### `src\aggregate.py` (5 consumers) + +- `src.aggregate.build_tier3_context` (line 382) +- `src.aggregate.build_markdown_from_items` (line 348) +- `src.aggregate._build_files_section_from_items` (line 300) +- `src.aggregate.build_markdown_no_history` (line 366) +- `src.aggregate.run` (line 479) + +### `src\ai_client.py` (29 consumers) + +- `src.ai_client._strip_cache_controls` (line 1291) +- `src.ai_client._send_anthropic` (line 1405) +- `src.ai_client._estimate_prompt_tokens` (line 1243) +- `src.ai_client._strip_private_keys` (line 1464) +- `src.ai_client._trim_anthropic_history` (line 1353) +- `src.ai_client._add_history_cache_breakpoint` (line 1299) +- `src.ai_client._send_gemini_cli` (line 2019) +- `src.ai_client._repair_anthropic_history` (line 1381) +- `src.ai_client._create_gemini_cache_result` (line 1706) +- `src.ai_client._dashscope_call` (line 2716) +- `src.ai_client._send_grok` (line 2530) +- `src.ai_client._execute_single_tool_call_async` (line 945) +- `src.ai_client._repair_deepseek_history` (line 2138) +- `src.ai_client._add_bleed_derived` (line 3332) +- `src.ai_client._append_comms` (line 257) +- `src.ai_client._send_llama_native` (line 2958) +- `src.ai_client.send` (line 3208) +- `src.ai_client._estimate_message_tokens` (line 1218) +- `src.ai_client._pre_dispatch` (line 2089) +- `src.ai_client._send_gemini` (line 1802) +- `src.ai_client._send_minimax` (line 2616) +- `src.ai_client._send_deepseek` (line 2165) +- `src.ai_client._trim_minimax_history` (line 2482) +- `src.ai_client.ollama_chat` (line 2938) +- `src.ai_client._send_llama` (line 2858) +- `src.ai_client._invalidate_token_estimate` (line 1240) +- `src.ai_client._repair_minimax_history` (line 2462) +- `src.ai_client._send_qwen` (line 2773) +- `src.ai_client._strip_stale_file_refreshes` (line 1253) + +### `src\app_controller.py` (5 consumers) + +- `src.app_controller._start_track_logic_result` (line 4728) +- `src.app_controller._offload_entry_payload` (line 4240) +- `src.app_controller._start_track_logic` (line 4721) +- `src.app_controller._refresh_api_metrics` (line 3074) +- `src.app_controller._on_comms_entry` (line 4282) + +### `src\models.py` (22 consumers) + +- `src.models.from_dict` (line 603) +- `src.models.from_dict` (line 416) +- `src.models.from_dict` (line 506) +- `src.models.from_dict` (line 814) +- `src.models.from_dict` (line 893) +- `src.models._save_config_to_disk` (line 199) +- `src.models.from_dict` (line 378) +- `src.models.from_dict` (line 1007) +- `src.models.from_dict` (line 1038) +- `src.models.from_dict` (line 866) +- `src.models.from_dict` (line 712) +- `src.models.from_dict` (line 747) +- `src.models.from_dict` (line 683) +- `src.models.from_dict` (line 575) +- `src.models.from_dict` (line 630) +- `src.models.from_dict` (line 454) +- `src.models.from_dict` (line 949) +- `src.models.from_dict` (line 982) +- `src.models.from_dict` (line 656) +- `src.models.from_dict` (line 1072) +- `src.models.from_dict` (line 295) +- `src.models.from_dict` (line 920) + +### `src\project_manager.py` (5 consumers) + +- `src.project_manager.format_discussion` (line 69) +- `src.project_manager.flat_config` (line 267) +- `src.project_manager.entry_to_str` (line 49) +- `src.project_manager.save_project` (line 229) +- `src.project_manager.migrate_from_legacy_config` (line 253) + +## Field access matrix + +| consumer | _est_tokens | _gemini_cache_text | _pending_gui_tasks | _pending_gui_tasks_lock | _recalculate_session_usage | _start_track_logic_result | _token_stats | _topological_sort_tickets_result | _update_cached_stats | active_discussion | active_project_path | active_project_root | ai_status | append | config | content | context_files | encode | engines | error | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `build_tier3_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_strip_cache_controls` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_send_anthropic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_estimate_prompt_tokens` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_start_track_logic_result` | . | . | 2 | 2 | . | . | . | 1 | . | 1 | 1 | 1 | 4 | . | 1 | . | 1 | . | 1 | . | +| `_strip_private_keys` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_trim_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_add_history_cache_breakpoint` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `build_markdown_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_send_gemini_cli` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_repair_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_create_gemini_cache_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_dashscope_call` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_send_grok` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_offload_entry_payload` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_save_config_to_disk` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_execute_single_tool_call_async` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_repair_deepseek_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . | +| `_add_bleed_derived` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `flat_config` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_build_files_section_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_append_comms` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_send_llama_native` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `send` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | +| `_start_track_logic` | . | . | . | . | . | 1 | . | . | . | . | . | . | 1 | . | . | . | . | . | . | . | +| `build_markdown_no_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_estimate_message_tokens` | 1 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_pre_dispatch` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_send_gemini` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | +| `_send_minimax` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_refresh_api_metrics` | . | 1 | . | . | 1 | . | 1 | . | 1 | . | . | . | . | . | . | . | . | . | . | 2 | +| `_send_deepseek` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_trim_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `entry_to_str` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `ollama_chat` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_send_llama` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | + +_... 24 more fields_ + +## Access pattern + +**Dominant pattern:** whole_struct +**Evidence count:** 50 + +**Per-function pattern distribution:** + +- `whole_struct`: 30 functions (60%) +- `mixed`: 17 functions (34%) +- `field_by_field`: 3 functions (6%) + +## SSDL Sketch for `CommsLogEntry` + +``` +[Q:CommsLogEntry entry-point] -> [Q:PCG lookup] + -> [1: from_dict] [B:check] (branches=0) + -> [2: build_tier3_context] [B:check] (branches=50) + -> [3: _strip_cache_controls] [B:check] (branches=4) + -> [4: from_dict] [B:check] (branches=0) + -> [5: from_dict] [B:check] (branches=0) + -> [6: _send_anthropic] [B:is None?] (branches=40) [N:safe] + -> [7: _estimate_prompt_tokens] [B:check] (branches=2) + -> [8: _start_track_logic_result] [B:check] (branches=10) + -> [9: _strip_private_keys] [B:check] (branches=0) + -> [10: _trim_anthropic_history] [B:check] (branches=13) + -> [11: _add_history_cache_breakpoint] [B:check] (branches=5) + -> [12: build_markdown_from_items] [B:check] (branches=9) + -> [13: _send_gemini_cli] [B:is None?] (branches=23) [N:safe] + -> [14: _repair_anthropic_history] [B:check] (branches=6) + -> [15: from_dict] [B:check] (branches=0) + -> [16: format_discussion] [B:check] (branches=0) + -> [17: _create_gemini_cache_result] [B:check] (branches=3) + -> [18: _dashscope_call] [B:check] (branches=5) + -> [19: _send_grok] [B:check] (branches=14) + -> [20: _offload_entry_payload] [B:check] (branches=10) + -> [21: from_dict] [B:check] (branches=0) + -> [22: _save_config_to_disk] [B:check] (branches=1) + -> [23: from_dict] [B:check] (branches=0) + -> [24: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe] + -> [25: from_dict] [B:check] (branches=0) + -> [26: _repair_deepseek_history] [B:check] (branches=6) + -> [27: _add_bleed_derived] [B:check] (branches=0) + -> [28: flat_config] [B:check] (branches=2) + -> [29: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe] + -> [30: _append_comms] [B:is None?] (branches=1) [N:safe] + -> [31: _send_llama_native] [B:check] (branches=12) + -> [32: send] [B:check] (branches=19) + -> [33: _start_track_logic] [B:check] (branches=1) + -> [34: build_markdown_no_history] [B:check] (branches=0) + -> [35: from_dict] [B:check] (branches=0) + -> [36: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe] + -> [37: _pre_dispatch] [B:check] (branches=8) + -> [38: from_dict] [B:check] (branches=0) + -> [39: from_dict] [B:check] (branches=0) + -> [40: _send_gemini] [B:is None?] (branches=75) [N:safe] + -> [41: _send_minimax] [B:check] (branches=11) + -> [42: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe] + -> [43: _send_deepseek] [B:check] (branches=71) + -> [44: _trim_minimax_history] [B:check] (branches=8) + -> [45: entry_to_str] [B:check] (branches=3) + -> [46: from_dict] [B:check] (branches=0) + -> [47: from_dict] [B:check] (branches=0) + -> [48: ollama_chat] [B:check] (branches=3) + -> [49: from_dict] [B:check] (branches=0) + -> [50: _send_llama] [B:check] (branches=13) + -> [51: from_dict] [B:check] (branches=0) + -> [52: run] [B:check] (branches=1) + -> [53: _invalidate_token_estimate] [B:check] (branches=0) + -> [54: _on_comms_entry] [B:check] (branches=32) + -> [55: from_dict] [B:check] (branches=0) + -> [56: _repair_minimax_history] [B:check] (branches=10) + -> [57: from_dict] [B:check] (branches=0) + -> [58: from_dict] [B:check] (branches=0) + -> [59: from_dict] [B:check] (branches=0) + -> [60: _send_qwen] [B:check] (branches=9) + -> [61: save_project] [B:is None?] (branches=7) [N:safe] + -> [62: migrate_from_legacy_config] [B:check] (branches=2) + -> [63: from_dict] [B:check] (branches=0) + -> [64: _strip_stale_file_refreshes] [B:check] (branches=12) + -> [65: from_dict] [B:check] (branches=0) + -> [66: from_dict] [B:check] (branches=0) + -> [T:done] +``` + +**Effective codepaths:** 40140116231395706750390 (sum of 2^branches across 66 consumers) +**Total branch points:** 541 +**Nil-check functions:** 9 + +**Defusing opportunities:** + +- **Nil Sentinel `[N]`**: Introduce a module-level `NIL_` sentinel whose field accesses return safe defaults. Replace None checks with the sentinel. Collapses 2^branch_count into ~1. + - Effective codepaths: 40140116231395706750390 -> 40140116231395706750372 +- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `commslogentry_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 110 field-check branches to 1 cache lookup. + - Effective codepaths: 40140116231395706750390 -> 110 +- **Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`**: Wrap the aggregate in a generational handle (index + generation). Validation is one comparison; mismatch returns the nil sentinel. Reduces N lifetime branches to 1 handle validation + sentinel return. + - Effective codepaths: 40140116231395706750390 -> 66 + + +## Frequency + +**Dominant frequency:** per_turn +**Evidence count:** 5 + +**Per-function frequency distribution:** + +- `per_turn`: 5 functions + +## Result coverage + +**Summary:** 96 producers, 46 consumers + +| metric | value | +|---|---| +| total producers | 96 | +| result producers | 96 | +| total consumers | 46 | +| result consumers | 0 | + +## Type alias coverage + +**Summary:** 110 sites; 0 typed (0%); 110 untyped (100%) + +| metric | value | +|---|---| +| total field-access sites | 110 | +| typed sites (canonical field) | 0 | +| untyped sites (wildcard) | 110 | + +## Cross-audit findings + +_(no cross-audit findings mapped to this aggregate)_ + +## Decomposition cost + +**Current cost estimate:** 720 us/turn +**Componentize savings:** 0 us/turn +**Unify savings:** 0 us/turn +**Recommended direction:** hold +**Rationale:** CommsLogEntry: access_pattern=whole_struct, frequency=per_turn, struct_field_count=10, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. +**Struct field count (estimated):** 10 +**Struct frozen:** True + +## Struct shape (inferred from producer returns) + +| field | access count | access pattern | +|---|---|---| +| `content` | 13 | hot | +| `marker` | 13 | hot | +| `get` | 7 | hot | +| `ai_status` | 2 | used | +| `config` | 2 | used | +| `pop` | 2 | used | +| `append` | 2 | used | +| `context_files` | 1 | used | +| `_pending_gui_tasks_lock` | 1 | used | +| `_topological_sort_tickets_result` | 1 | used | +| `active_project_root` | 1 | used | +| `event_queue` | 1 | used | +| `engines` | 1 | used | +| `project` | 1 | used | +| `active_discussion` | 1 | used | +| `submit_io` | 1 | used | +| `tracks` | 1 | used | +| `mma_tier_usage` | 1 | used | +| `_pending_gui_tasks` | 1 | used | +| `mma_step_mode` | 1 | used | +| `active_project_path` | 1 | used | +| `items` | 1 | used | +| `estimated_prompt_tokens` | 1 | used | +| `max_prompt_tokens` | 1 | used | +| `utilization_pct` | 1 | used | +| `headroom` | 1 | used | +| `would_trim` | 1 | used | +| `sys_tokens` | 1 | used | +| `tool_tokens` | 1 | used | +| `history_tokens` | 1 | used | +| `search` | 1 | used | +| `_start_track_logic_result` | 1 | used | +| `_est_tokens` | 1 | used | +| `encode` | 1 | used | +| `latency` | 1 | used | +| `_recalculate_session_usage` | 1 | used | +| `_token_stats` | 1 | used | +| `_gemini_cache_text` | 1 | used | +| `vendor_quota` | 1 | used | +| `last_error` | 1 | used | +| `error` | 1 | used | +| `_update_cached_stats` | 1 | used | +| `session_usage` | 1 | used | +| `usage` | 1 | used | + +## Optimization candidates + +_(no optimization candidates generated)_ + +## Verdict + +CommsLogEntry: access_pattern=whole_struct, frequency=per_turn, struct_field_count=10, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. + +## Evidence appendix + +### Access pattern evidence + +| function | pattern | field_accesses | confidence | +|---|---|---|---| +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.aggregate.build_tier3_context` | `whole_struct` | | low | +| `src.ai_client._strip_cache_controls` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._send_anthropic` | `whole_struct` | | low | +| `src.ai_client._estimate_prompt_tokens` | `whole_struct` | | low | +| `src.app_controller._start_track_logic_result` | `field_by_field` | `ai_status`=4, `context_files`=1, `get`=3, `_pending_gui_tasks_lock`=2, `_topological_sort_tickets_result`=1, `active_project_root`=1, `event_queue`=1, `engines`=1, `project`=1, `active_discussion`=1 (+7 more) | high | +| `src.ai_client._strip_private_keys` | `whole_struct` | | low | +| `src.ai_client._trim_anthropic_history` | `whole_struct` | `pop`=5 | high | +| `src.ai_client._add_history_cache_breakpoint` | `whole_struct` | | low | +| `src.aggregate.build_markdown_from_items` | `whole_struct` | | low | +| `src.ai_client._send_gemini_cli` | `whole_struct` | | low | +| `src.ai_client._repair_anthropic_history` | `whole_struct` | `append`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.project_manager.format_discussion` | `whole_struct` | | low | +| `src.ai_client._create_gemini_cache_result` | `whole_struct` | | low | +| `src.ai_client._dashscope_call` | `whole_struct` | | low | +| `src.ai_client._send_grok` | `whole_struct` | | low | +| `src.app_controller._offload_entry_payload` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models._save_config_to_disk` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._execute_single_tool_call_async` | `mixed` | `get`=2, `items`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._repair_deepseek_history` | `whole_struct` | `append`=1 | high | +| `src.ai_client._add_bleed_derived` | `field_by_field` | `estimated_prompt_tokens`=1, `max_prompt_tokens`=1, `utilization_pct`=1, `headroom`=1, `would_trim`=1, `sys_tokens`=1, `tool_tokens`=1, `history_tokens`=1, `get`=3 | high | +| `src.project_manager.flat_config` | `whole_struct` | `get`=7 | high | +| `src.aggregate._build_files_section_from_items` | `whole_struct` | | low | +| `src.ai_client._append_comms` | `whole_struct` | | low | +| `src.ai_client._send_llama_native` | `whole_struct` | | low | +| `src.ai_client.send` | `mixed` | `config`=1, `search`=1 | high | +| `src.app_controller._start_track_logic` | `mixed` | `_start_track_logic_result`=1, `ai_status`=1 | high | +| `src.aggregate.build_markdown_no_history` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._estimate_message_tokens` | `mixed` | `_est_tokens`=1, `get`=2 | high | +| `src.ai_client._pre_dispatch` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._send_gemini` | `whole_struct` | `encode`=1 | high | +| `src.ai_client._send_minimax` | `whole_struct` | | low | +| `src.app_controller._refresh_api_metrics` | `field_by_field` | `latency`=1, `_recalculate_session_usage`=1, `_token_stats`=1, `get`=2, `_gemini_cache_text`=1, `vendor_quota`=1, `last_error`=1, `error`=2, `_update_cached_stats`=1, `session_usage`=2 (+1 more) | high | +| `src.ai_client._send_deepseek` | `whole_struct` | | low | +| `src.ai_client._trim_minimax_history` | `whole_struct` | `pop`=4 | high | +| `src.project_manager.entry_to_str` | `whole_struct` | `get`=4 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client.ollama_chat` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._send_llama` | `whole_struct` | | low | + +### Frequency evidence + +| function | frequency | source | note | +|---|---|---|---| +| `src.app_controller.wait` | `per_turn` | `static_analysis` | producer from src\app_controller.py | +| `src.api_hook_client.post_project` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py | +| `src.app_controller.get_mma_status` | `per_turn` | `static_analysis` | producer from src\app_controller.py | +| `src.ai_client._load_credentials` | `per_turn` | `static_analysis` | producer from src\ai_client.py | +| `src.ai_client._pre_dispatch` | `per_turn` | `static_analysis` | producer from src\ai_client.py | diff --git a/docs/reports/code_path_audit/2026-06-24/aggregates/FileItem.md b/docs/reports/code_path_audit/2026-06-24/aggregates/FileItem.md new file mode 100644 index 00000000..a06ea6ec --- /dev/null +++ b/docs/reports/code_path_audit/2026-06-24/aggregates/FileItem.md @@ -0,0 +1,559 @@ +# Aggregate Profile: FileItem + +**Aggregate kind:** typealias +**Memory dim:** curation +**Is candidate:** False + +## Pipeline summary + +- Producers: 117 +- Consumers: 66 +- Distinct producer fqnames: 96 +- Distinct consumer fqnames: 46 +- Access pattern (aggregate): whole_struct +- Frequency (aggregate): per_turn +- Decomposition direction: hold +- Struct field count (estimated): 10 + +## Producers (117) + +### `src\aggregate.py` (1 producer) + +- `src.aggregate.build_file_items` (line 158) + +### `src\ai_client.py` (16 producers) + +- `src.ai_client._load_credentials` (line 282) +- `src.ai_client._pre_dispatch` (line 2089) +- `src.ai_client.get_comms_log` (line 273) +- `src.ai_client.get_gemini_cache_stats` (line 1604) +- `src.ai_client._add_bleed_derived` (line 3332) +- `src.ai_client._get_anthropic_tools` (line 664) +- `src.ai_client._dashscope_call` (line 2716) +- `src.ai_client._extract_dashscope_tool_calls` (line 2754) +- `src.ai_client._send_cli_round_result` (line 1746) +- `src.ai_client._parse_tool_args_result` (line 741) +- `src.ai_client._content_block_to_dict` (line 1200) +- `src.ai_client.ollama_chat` (line 2938) +- `src.ai_client._get_deepseek_tools` (line 1194) +- `src.ai_client._strip_private_keys` (line 1464) +- `src.ai_client._build_chunked_context_blocks` (line 1281) +- `src.ai_client.get_token_stats` (line 3185) + +### `src\api_hook_client.py` (39 producers) + +- `src.api_hook_client.post_project` (line 470) +- `src.api_hook_client.drag` (line 230) +- `src.api_hook_client.set_value` (line 212) +- `src.api_hook_client.get_financial_metrics` (line 520) +- `src.api_hook_client.get_gui_health` (line 434) +- `src.api_hook_client.select_list_item` (line 256) +- `src.api_hook_client.get_mma_status` (line 539) +- `src.api_hook_client.get_project_switch_status` (line 374) +- `src.api_hook_client.get_performance` (line 318) +- `src.api_hook_client.get_patch_status` (line 295) +- `src.api_hook_client.get_startup_timeline` (line 353) +- `src.api_hook_client.get_events` (line 124) +- `src.api_hook_client.get_gui_state` (line 165) +- `src.api_hook_client.click` (line 223) +- `src.api_hook_client.get_node_status` (line 532) +- `src.api_hook_client.reject_patch` (line 288) +- `src.api_hook_client.get_project` (line 367) +- `src.api_hook_client.get_warmup_status` (line 325) +- `src.api_hook_client.right_click` (line 237) +- `src.api_hook_client.get_io_pool_status` (line 420) +- `src.api_hook_client.push_event` (line 156) +- `src.api_hook_client.get_warmup_wait` (line 332) +- `src.api_hook_client.get_status` (line 105) +- `src.api_hook_client._make_request` (line 65) +- `src.api_hook_client.wait_for_project_switch` (line 389) +- `src.api_hook_client.apply_patch` (line 281) +- `src.api_hook_client.get_context_state` (line 491) +- `src.api_hook_client.post_project` (line 473) +- `src.api_hook_client.get_warmup_canaries` (line 342) +- `src.api_hook_client.trigger_patch` (line 274) +- `src.api_hook_client.clear_events` (line 129) +- `src.api_hook_client.post_session` (line 117) +- `src.api_hook_client.get_session` (line 502) +- `src.api_hook_client.get_mma_workers` (line 546) +- `src.api_hook_client.get_gui_diagnostics` (line 311) +- `src.api_hook_client.post_gui` (line 149) +- `src.api_hook_client.get_system_telemetry` (line 524) +- `src.api_hook_client.select_tab` (line 263) +- `src.api_hook_client.wait_for_event` (line 136) + +### `src\app_controller.py` (30 producers) + +- `src.app_controller.wait` (line 5205) +- `src.app_controller.get_mma_status` (line 2835) +- `src.app_controller._api_get_performance` (line 195) +- `src.app_controller.get_performance` (line 2856) +- `src.app_controller.get_diagnostics` (line 2862) +- `src.app_controller.load_config` (line 5142) +- `src.app_controller._api_get_context` (line 398) +- `src.app_controller._api_status` (line 209) +- `src.app_controller.generate` (line 2868) +- `src.app_controller._api_generate` (line 221) +- `src.app_controller._api_token_stats` (line 417) +- `src.app_controller._api_get_gui_state` (line 123) +- `src.app_controller._api_get_diagnostics` (line 202) +- `src.app_controller.get_api_session` (line 2847) +- `src.app_controller.token_stats` (line 2898) +- `src.app_controller._api_get_api_session` (line 170) +- `src.app_controller._offload_entry_payload` (line 4240) +- `src.app_controller._pending_mma_spawn` (line 2772) +- `src.app_controller._api_pending_actions` (line 335) +- `src.app_controller.get_context` (line 2892) +- `src.app_controller.get_session` (line 2883) +- `src.app_controller.status` (line 2865) +- `src.app_controller.get_session_insights` (line 3049) +- `src.app_controller._api_get_api_project` (line 188) +- `src.app_controller._api_get_mma_status` (line 144) +- `src.app_controller._pending_mma_approval` (line 2776) +- `src.app_controller.get_api_project` (line 2853) +- `src.app_controller.pending_actions` (line 2874) +- `src.app_controller.get_gui_state` (line 2829) +- `src.app_controller._api_get_session` (line 374) + +### `src\models.py` (23 producers) + +- `src.models.to_dict` (line 646) +- `src.models.to_dict` (line 1000) +- `src.models.to_dict` (line 672) +- `src.models.to_dict` (line 938) +- `src.models.to_dict` (line 855) +- `src.models.to_dict` (line 441) +- `src.models.to_dict` (line 406) +- `src.models.to_dict` (line 355) +- `src.models.parse_history_entries` (line 214) +- `src.models.to_dict` (line 737) +- `src.models.to_dict` (line 486) +- `src.models.to_dict` (line 913) +- `src.models.to_dict` (line 596) +- `src.models.to_dict` (line 794) +- `src.models.to_dict` (line 558) +- `src.models.to_dict` (line 971) +- `src.models.to_dict` (line 1024) +- `src.models.to_dict` (line 288) +- `src.models.to_dict` (line 701) +- `src.models.to_dict` (line 886) +- `src.models.to_dict` (line 1059) +- `src.models._load_config_from_disk` (line 186) +- `src.models.to_dict` (line 618) + +### `src\project_manager.py` (8 producers) + +- `src.project_manager.load_history` (line 209) +- `src.project_manager.default_project` (line 123) +- `src.project_manager.migrate_from_legacy_config` (line 253) +- `src.project_manager.load_project` (line 186) +- `src.project_manager.get_all_tracks` (line 342) +- `src.project_manager.default_discussion` (line 117) +- `src.project_manager.flat_config` (line 267) +- `src.project_manager.str_to_entry` (line 75) + +## Consumers (66) + +### `src\aggregate.py` (5 consumers) + +- `src.aggregate.build_tier3_context` (line 382) +- `src.aggregate.build_markdown_from_items` (line 348) +- `src.aggregate._build_files_section_from_items` (line 300) +- `src.aggregate.build_markdown_no_history` (line 366) +- `src.aggregate.run` (line 479) + +### `src\ai_client.py` (29 consumers) + +- `src.ai_client._strip_cache_controls` (line 1291) +- `src.ai_client._send_anthropic` (line 1405) +- `src.ai_client._estimate_prompt_tokens` (line 1243) +- `src.ai_client._strip_private_keys` (line 1464) +- `src.ai_client._trim_anthropic_history` (line 1353) +- `src.ai_client._add_history_cache_breakpoint` (line 1299) +- `src.ai_client._send_gemini_cli` (line 2019) +- `src.ai_client._repair_anthropic_history` (line 1381) +- `src.ai_client._create_gemini_cache_result` (line 1706) +- `src.ai_client._dashscope_call` (line 2716) +- `src.ai_client._send_grok` (line 2530) +- `src.ai_client._execute_single_tool_call_async` (line 945) +- `src.ai_client._repair_deepseek_history` (line 2138) +- `src.ai_client._add_bleed_derived` (line 3332) +- `src.ai_client._append_comms` (line 257) +- `src.ai_client._send_llama_native` (line 2958) +- `src.ai_client.send` (line 3208) +- `src.ai_client._estimate_message_tokens` (line 1218) +- `src.ai_client._pre_dispatch` (line 2089) +- `src.ai_client._send_gemini` (line 1802) +- `src.ai_client._send_minimax` (line 2616) +- `src.ai_client._send_deepseek` (line 2165) +- `src.ai_client._trim_minimax_history` (line 2482) +- `src.ai_client.ollama_chat` (line 2938) +- `src.ai_client._send_llama` (line 2858) +- `src.ai_client._invalidate_token_estimate` (line 1240) +- `src.ai_client._repair_minimax_history` (line 2462) +- `src.ai_client._send_qwen` (line 2773) +- `src.ai_client._strip_stale_file_refreshes` (line 1253) + +### `src\app_controller.py` (5 consumers) + +- `src.app_controller._start_track_logic_result` (line 4728) +- `src.app_controller._offload_entry_payload` (line 4240) +- `src.app_controller._start_track_logic` (line 4721) +- `src.app_controller._refresh_api_metrics` (line 3074) +- `src.app_controller._on_comms_entry` (line 4282) + +### `src\models.py` (22 consumers) + +- `src.models.from_dict` (line 603) +- `src.models.from_dict` (line 416) +- `src.models.from_dict` (line 506) +- `src.models.from_dict` (line 814) +- `src.models.from_dict` (line 893) +- `src.models._save_config_to_disk` (line 199) +- `src.models.from_dict` (line 378) +- `src.models.from_dict` (line 1007) +- `src.models.from_dict` (line 1038) +- `src.models.from_dict` (line 866) +- `src.models.from_dict` (line 712) +- `src.models.from_dict` (line 747) +- `src.models.from_dict` (line 683) +- `src.models.from_dict` (line 575) +- `src.models.from_dict` (line 630) +- `src.models.from_dict` (line 454) +- `src.models.from_dict` (line 949) +- `src.models.from_dict` (line 982) +- `src.models.from_dict` (line 656) +- `src.models.from_dict` (line 1072) +- `src.models.from_dict` (line 295) +- `src.models.from_dict` (line 920) + +### `src\project_manager.py` (5 consumers) + +- `src.project_manager.format_discussion` (line 69) +- `src.project_manager.flat_config` (line 267) +- `src.project_manager.entry_to_str` (line 49) +- `src.project_manager.save_project` (line 229) +- `src.project_manager.migrate_from_legacy_config` (line 253) + +## Field access matrix + +| consumer | _est_tokens | _gemini_cache_text | _pending_gui_tasks | _pending_gui_tasks_lock | _recalculate_session_usage | _start_track_logic_result | _token_stats | _topological_sort_tickets_result | _update_cached_stats | active_discussion | active_project_path | active_project_root | ai_status | append | config | content | context_files | encode | engines | error | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `build_tier3_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_strip_cache_controls` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_send_anthropic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_estimate_prompt_tokens` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_start_track_logic_result` | . | . | 2 | 2 | . | . | . | 1 | . | 1 | 1 | 1 | 4 | . | 1 | . | 1 | . | 1 | . | +| `_strip_private_keys` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_trim_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_add_history_cache_breakpoint` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `build_markdown_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_send_gemini_cli` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_repair_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_create_gemini_cache_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_dashscope_call` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_send_grok` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_offload_entry_payload` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_save_config_to_disk` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_execute_single_tool_call_async` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_repair_deepseek_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . | +| `_add_bleed_derived` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `flat_config` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_build_files_section_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_append_comms` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_send_llama_native` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `send` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | +| `_start_track_logic` | . | . | . | . | . | 1 | . | . | . | . | . | . | 1 | . | . | . | . | . | . | . | +| `build_markdown_no_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_estimate_message_tokens` | 1 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_pre_dispatch` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_send_gemini` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | +| `_send_minimax` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_refresh_api_metrics` | . | 1 | . | . | 1 | . | 1 | . | 1 | . | . | . | . | . | . | . | . | . | . | 2 | +| `_send_deepseek` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_trim_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `entry_to_str` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `ollama_chat` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_send_llama` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | + +_... 24 more fields_ + +## Access pattern + +**Dominant pattern:** whole_struct +**Evidence count:** 50 + +**Per-function pattern distribution:** + +- `whole_struct`: 30 functions (60%) +- `mixed`: 17 functions (34%) +- `field_by_field`: 3 functions (6%) + +## SSDL Sketch for `FileItem` + +``` +[Q:FileItem entry-point] -> [Q:PCG lookup] + -> [1: from_dict] [B:check] (branches=0) + -> [2: build_tier3_context] [B:check] (branches=50) + -> [3: _strip_cache_controls] [B:check] (branches=4) + -> [4: from_dict] [B:check] (branches=0) + -> [5: from_dict] [B:check] (branches=0) + -> [6: _send_anthropic] [B:is None?] (branches=40) [N:safe] + -> [7: _estimate_prompt_tokens] [B:check] (branches=2) + -> [8: _start_track_logic_result] [B:check] (branches=10) + -> [9: _strip_private_keys] [B:check] (branches=0) + -> [10: _trim_anthropic_history] [B:check] (branches=13) + -> [11: _add_history_cache_breakpoint] [B:check] (branches=5) + -> [12: build_markdown_from_items] [B:check] (branches=9) + -> [13: _send_gemini_cli] [B:is None?] (branches=23) [N:safe] + -> [14: _repair_anthropic_history] [B:check] (branches=6) + -> [15: from_dict] [B:check] (branches=0) + -> [16: format_discussion] [B:check] (branches=0) + -> [17: _create_gemini_cache_result] [B:check] (branches=3) + -> [18: _dashscope_call] [B:check] (branches=5) + -> [19: _send_grok] [B:check] (branches=14) + -> [20: _offload_entry_payload] [B:check] (branches=10) + -> [21: from_dict] [B:check] (branches=0) + -> [22: _save_config_to_disk] [B:check] (branches=1) + -> [23: from_dict] [B:check] (branches=0) + -> [24: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe] + -> [25: from_dict] [B:check] (branches=0) + -> [26: _repair_deepseek_history] [B:check] (branches=6) + -> [27: _add_bleed_derived] [B:check] (branches=0) + -> [28: flat_config] [B:check] (branches=2) + -> [29: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe] + -> [30: _append_comms] [B:is None?] (branches=1) [N:safe] + -> [31: _send_llama_native] [B:check] (branches=12) + -> [32: send] [B:check] (branches=19) + -> [33: _start_track_logic] [B:check] (branches=1) + -> [34: build_markdown_no_history] [B:check] (branches=0) + -> [35: from_dict] [B:check] (branches=0) + -> [36: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe] + -> [37: _pre_dispatch] [B:check] (branches=8) + -> [38: from_dict] [B:check] (branches=0) + -> [39: from_dict] [B:check] (branches=0) + -> [40: _send_gemini] [B:is None?] (branches=75) [N:safe] + -> [41: _send_minimax] [B:check] (branches=11) + -> [42: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe] + -> [43: _send_deepseek] [B:check] (branches=71) + -> [44: _trim_minimax_history] [B:check] (branches=8) + -> [45: entry_to_str] [B:check] (branches=3) + -> [46: from_dict] [B:check] (branches=0) + -> [47: from_dict] [B:check] (branches=0) + -> [48: ollama_chat] [B:check] (branches=3) + -> [49: from_dict] [B:check] (branches=0) + -> [50: _send_llama] [B:check] (branches=13) + -> [51: from_dict] [B:check] (branches=0) + -> [52: run] [B:check] (branches=1) + -> [53: _invalidate_token_estimate] [B:check] (branches=0) + -> [54: _on_comms_entry] [B:check] (branches=32) + -> [55: from_dict] [B:check] (branches=0) + -> [56: _repair_minimax_history] [B:check] (branches=10) + -> [57: from_dict] [B:check] (branches=0) + -> [58: from_dict] [B:check] (branches=0) + -> [59: from_dict] [B:check] (branches=0) + -> [60: _send_qwen] [B:check] (branches=9) + -> [61: save_project] [B:is None?] (branches=7) [N:safe] + -> [62: migrate_from_legacy_config] [B:check] (branches=2) + -> [63: from_dict] [B:check] (branches=0) + -> [64: _strip_stale_file_refreshes] [B:check] (branches=12) + -> [65: from_dict] [B:check] (branches=0) + -> [66: from_dict] [B:check] (branches=0) + -> [T:done] +``` + +**Effective codepaths:** 40140116231395706750390 (sum of 2^branches across 66 consumers) +**Total branch points:** 541 +**Nil-check functions:** 9 + +**Defusing opportunities:** + +- **Nil Sentinel `[N]`**: Introduce a module-level `NIL_` sentinel whose field accesses return safe defaults. Replace None checks with the sentinel. Collapses 2^branch_count into ~1. + - Effective codepaths: 40140116231395706750390 -> 40140116231395706750372 +- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `fileitem_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 110 field-check branches to 1 cache lookup. + - Effective codepaths: 40140116231395706750390 -> 110 +- **Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`**: Wrap the aggregate in a generational handle (index + generation). Validation is one comparison; mismatch returns the nil sentinel. Reduces N lifetime branches to 1 handle validation + sentinel return. + - Effective codepaths: 40140116231395706750390 -> 66 + + +## Frequency + +**Dominant frequency:** per_turn +**Evidence count:** 5 + +**Per-function frequency distribution:** + +- `per_turn`: 5 functions + +## Result coverage + +**Summary:** 96 producers, 46 consumers + +| metric | value | +|---|---| +| total producers | 96 | +| result producers | 96 | +| total consumers | 46 | +| result consumers | 0 | + +## Type alias coverage + +**Summary:** 110 sites; 0 typed (0%); 110 untyped (100%) + +| metric | value | +|---|---| +| total field-access sites | 110 | +| typed sites (canonical field) | 0 | +| untyped sites (wildcard) | 110 | + +## Cross-audit findings + +_(no cross-audit findings mapped to this aggregate)_ + +## Decomposition cost + +**Current cost estimate:** 720 us/turn +**Componentize savings:** 0 us/turn +**Unify savings:** 0 us/turn +**Recommended direction:** hold +**Rationale:** FileItem: access_pattern=whole_struct, frequency=per_turn, struct_field_count=10, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. +**Struct field count (estimated):** 10 +**Struct frozen:** True + +## Struct shape (inferred from producer returns) + +| field | access count | access pattern | +|---|---|---| +| `content` | 13 | hot | +| `marker` | 13 | hot | +| `get` | 7 | hot | +| `ai_status` | 2 | used | +| `config` | 2 | used | +| `pop` | 2 | used | +| `append` | 2 | used | +| `context_files` | 1 | used | +| `_pending_gui_tasks_lock` | 1 | used | +| `_topological_sort_tickets_result` | 1 | used | +| `active_project_root` | 1 | used | +| `event_queue` | 1 | used | +| `engines` | 1 | used | +| `project` | 1 | used | +| `active_discussion` | 1 | used | +| `submit_io` | 1 | used | +| `tracks` | 1 | used | +| `mma_tier_usage` | 1 | used | +| `_pending_gui_tasks` | 1 | used | +| `mma_step_mode` | 1 | used | +| `active_project_path` | 1 | used | +| `items` | 1 | used | +| `estimated_prompt_tokens` | 1 | used | +| `max_prompt_tokens` | 1 | used | +| `utilization_pct` | 1 | used | +| `headroom` | 1 | used | +| `would_trim` | 1 | used | +| `sys_tokens` | 1 | used | +| `tool_tokens` | 1 | used | +| `history_tokens` | 1 | used | +| `search` | 1 | used | +| `_start_track_logic_result` | 1 | used | +| `_est_tokens` | 1 | used | +| `encode` | 1 | used | +| `latency` | 1 | used | +| `_recalculate_session_usage` | 1 | used | +| `_token_stats` | 1 | used | +| `_gemini_cache_text` | 1 | used | +| `vendor_quota` | 1 | used | +| `last_error` | 1 | used | +| `error` | 1 | used | +| `_update_cached_stats` | 1 | used | +| `session_usage` | 1 | used | +| `usage` | 1 | used | + +## Optimization candidates + +_(no optimization candidates generated)_ + +## Verdict + +FileItem: access_pattern=whole_struct, frequency=per_turn, struct_field_count=10, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. + +## Evidence appendix + +### Access pattern evidence + +| function | pattern | field_accesses | confidence | +|---|---|---|---| +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.aggregate.build_tier3_context` | `whole_struct` | | low | +| `src.ai_client._strip_cache_controls` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._send_anthropic` | `whole_struct` | | low | +| `src.ai_client._estimate_prompt_tokens` | `whole_struct` | | low | +| `src.app_controller._start_track_logic_result` | `field_by_field` | `ai_status`=4, `context_files`=1, `get`=3, `_pending_gui_tasks_lock`=2, `_topological_sort_tickets_result`=1, `active_project_root`=1, `event_queue`=1, `engines`=1, `project`=1, `active_discussion`=1 (+7 more) | high | +| `src.ai_client._strip_private_keys` | `whole_struct` | | low | +| `src.ai_client._trim_anthropic_history` | `whole_struct` | `pop`=5 | high | +| `src.ai_client._add_history_cache_breakpoint` | `whole_struct` | | low | +| `src.aggregate.build_markdown_from_items` | `whole_struct` | | low | +| `src.ai_client._send_gemini_cli` | `whole_struct` | | low | +| `src.ai_client._repair_anthropic_history` | `whole_struct` | `append`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.project_manager.format_discussion` | `whole_struct` | | low | +| `src.ai_client._create_gemini_cache_result` | `whole_struct` | | low | +| `src.ai_client._dashscope_call` | `whole_struct` | | low | +| `src.ai_client._send_grok` | `whole_struct` | | low | +| `src.app_controller._offload_entry_payload` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models._save_config_to_disk` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._execute_single_tool_call_async` | `mixed` | `get`=2, `items`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._repair_deepseek_history` | `whole_struct` | `append`=1 | high | +| `src.ai_client._add_bleed_derived` | `field_by_field` | `estimated_prompt_tokens`=1, `max_prompt_tokens`=1, `utilization_pct`=1, `headroom`=1, `would_trim`=1, `sys_tokens`=1, `tool_tokens`=1, `history_tokens`=1, `get`=3 | high | +| `src.project_manager.flat_config` | `whole_struct` | `get`=7 | high | +| `src.aggregate._build_files_section_from_items` | `whole_struct` | | low | +| `src.ai_client._append_comms` | `whole_struct` | | low | +| `src.ai_client._send_llama_native` | `whole_struct` | | low | +| `src.ai_client.send` | `mixed` | `config`=1, `search`=1 | high | +| `src.app_controller._start_track_logic` | `mixed` | `_start_track_logic_result`=1, `ai_status`=1 | high | +| `src.aggregate.build_markdown_no_history` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._estimate_message_tokens` | `mixed` | `_est_tokens`=1, `get`=2 | high | +| `src.ai_client._pre_dispatch` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._send_gemini` | `whole_struct` | `encode`=1 | high | +| `src.ai_client._send_minimax` | `whole_struct` | | low | +| `src.app_controller._refresh_api_metrics` | `field_by_field` | `latency`=1, `_recalculate_session_usage`=1, `_token_stats`=1, `get`=2, `_gemini_cache_text`=1, `vendor_quota`=1, `last_error`=1, `error`=2, `_update_cached_stats`=1, `session_usage`=2 (+1 more) | high | +| `src.ai_client._send_deepseek` | `whole_struct` | | low | +| `src.ai_client._trim_minimax_history` | `whole_struct` | `pop`=4 | high | +| `src.project_manager.entry_to_str` | `whole_struct` | `get`=4 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client.ollama_chat` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._send_llama` | `whole_struct` | | low | + +### Frequency evidence + +| function | frequency | source | note | +|---|---|---|---| +| `src.app_controller.wait` | `per_turn` | `static_analysis` | producer from src\app_controller.py | +| `src.api_hook_client.post_project` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py | +| `src.app_controller.get_mma_status` | `per_turn` | `static_analysis` | producer from src\app_controller.py | +| `src.ai_client._load_credentials` | `per_turn` | `static_analysis` | producer from src\ai_client.py | +| `src.ai_client._pre_dispatch` | `per_turn` | `static_analysis` | producer from src\ai_client.py | diff --git a/docs/reports/code_path_audit/2026-06-24/aggregates/FileItems.md b/docs/reports/code_path_audit/2026-06-24/aggregates/FileItems.md new file mode 100644 index 00000000..c4c2109a --- /dev/null +++ b/docs/reports/code_path_audit/2026-06-24/aggregates/FileItems.md @@ -0,0 +1,195 @@ +# Aggregate Profile: FileItems + +**Aggregate kind:** typealias +**Memory dim:** curation +**Is candidate:** False + +## Pipeline summary + +- Producers: 6 +- Consumers: 9 +- Distinct producer fqnames: 6 +- Distinct consumer fqnames: 9 +- Access pattern (aggregate): whole_struct +- Frequency (aggregate): per_turn +- Decomposition direction: hold +- Struct field count (estimated): 5 + +## Producers (6) + +### `src\ai_client.py` (4 producers) + +- `src.ai_client._list_minimax_models_result` (line 2436) +- `src.ai_client._list_gemini_models_result` (line 1626) +- `src.ai_client._set_minimax_provider_result` (line 398) +- `src.ai_client._list_anthropic_models_result` (line 1317) + +### `src\gui_2.py` (2 producers) + +- `src.gui_2._drain_normalize_errors` (line 7417) +- `src.gui_2._render_beads_tab_list_result` (line 8314) + +## Consumers (9) + +### `src\ai_client.py` (4 consumers) + +- `src.ai_client._build_file_diff_text` (line 1105) +- `src.ai_client.run_with_tool_loop` (line 833) +- `src.ai_client._reread_file_items_result` (line 1056) +- `src.ai_client._build_file_context_text` (line 1092) + +### `src\app_controller.py` (3 consumers) + +- `src.app_controller._symbol_resolution_result` (line 3506) +- `src.app_controller._topological_sort_tickets_result` (line 4708) +- `src.app_controller._serialize_tool_calls_result` (line 2217) + +### `src\gui_2.py` (1 consumer) + +- `src.gui_2.__init__` (line 7550) + +### `src\project_manager.py` (1 consumer) + +- `src.project_manager.calculate_track_progress` (line 420) + +## Field access matrix + +| consumer | _attr_name | _cached | _module_name | _report_worker_error | append | +|---|---|---|---|---|---| +| `_build_file_diff_text` | . | . | . | . | . | +| `__init__` | 1 | 1 | 1 | . | . | +| `_symbol_resolution_result` | . | . | . | . | . | +| `_topological_sort_tickets_result` | . | . | . | 1 | . | +| `_serialize_tool_calls_result` | . | . | . | . | . | +| `run_with_tool_loop` | . | . | . | . | 2 | +| `calculate_track_progress` | . | . | . | . | . | +| `_reread_file_items_result` | . | . | . | . | . | +| `_build_file_context_text` | . | . | . | . | . | + +## Access pattern + +**Dominant pattern:** whole_struct +**Evidence count:** 9 + +**Per-function pattern distribution:** + +- `whole_struct`: 8 functions (89%) +- `field_by_field`: 1 functions (11%) + +## SSDL Sketch for `FileItems` + +``` +[Q:FileItems entry-point] -> [Q:PCG lookup] + -> [1: _build_file_diff_text] [B:check] (branches=6) + -> [2: __init__] [B:check] (branches=0) + -> [3: _symbol_resolution_result] [B:check] (branches=4) + -> [4: _topological_sort_tickets_result] [B:check] (branches=2) + -> [5: _serialize_tool_calls_result] [B:check] (branches=2) + -> [6: run_with_tool_loop] [B:is None?] (branches=23) [N:safe] + -> [7: calculate_track_progress] [B:check] (branches=1) + -> [8: _reread_file_items_result] [B:is None?] (branches=5) [N:safe] + -> [9: _build_file_context_text] [B:check] (branches=3) + -> [T:done] +``` + +**Effective codepaths:** 8388739 (sum of 2^branches across 9 consumers) +**Total branch points:** 46 +**Nil-check functions:** 2 + +**Defusing opportunities:** + +- **Nil Sentinel `[N]`**: Introduce a module-level `NIL_` sentinel whose field accesses return safe defaults. Replace None checks with the sentinel. Collapses 2^branch_count into ~1. + - Effective codepaths: 8388739 -> 8388735 +- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `fileitems_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 6 field-check branches to 1 cache lookup. + - Effective codepaths: 8388739 -> 6 +- **Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`**: Wrap the aggregate in a generational handle (index + generation). Validation is one comparison; mismatch returns the nil sentinel. Reduces N lifetime branches to 1 handle validation + sentinel return. + - Effective codepaths: 8388739 -> 9 + + +## Frequency + +**Dominant frequency:** per_turn +**Evidence count:** 5 + +**Per-function frequency distribution:** + +- `per_turn`: 5 functions + +## Result coverage + +**Summary:** 6 producers, 9 consumers + +| metric | value | +|---|---| +| total producers | 6 | +| result producers | 6 | +| total consumers | 9 | +| result consumers | 0 | + +## Type alias coverage + +**Summary:** 6 sites; 0 typed (0%); 6 untyped (100%) + +| metric | value | +|---|---| +| total field-access sites | 6 | +| typed sites (canonical field) | 0 | +| untyped sites (wildcard) | 6 | + +## Cross-audit findings + +_(no cross-audit findings mapped to this aggregate)_ + +## Decomposition cost + +**Current cost estimate:** 470 us/turn +**Componentize savings:** 0 us/turn +**Unify savings:** 70 us/turn +**Recommended direction:** hold +**Rationale:** FileItems: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. +**Struct field count (estimated):** 5 +**Struct frozen:** True + +## Struct shape (inferred from producer returns) + +| field | access count | access pattern | +|---|---|---| +| `_module_name` | 1 | used | +| `_attr_name` | 1 | used | +| `_cached` | 1 | used | +| `_report_worker_error` | 1 | used | +| `append` | 1 | used | + +## Optimization candidates + +_(no optimization candidates generated)_ + +## Verdict + +FileItems: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. + +## Evidence appendix + +### Access pattern evidence + +| function | pattern | field_accesses | confidence | +|---|---|---|---| +| `src.ai_client._build_file_diff_text` | `whole_struct` | | low | +| `src.gui_2.__init__` | `field_by_field` | `_module_name`=1, `_attr_name`=1, `_cached`=1 | high | +| `src.app_controller._symbol_resolution_result` | `whole_struct` | | low | +| `src.app_controller._topological_sort_tickets_result` | `whole_struct` | `_report_worker_error`=1 | high | +| `src.app_controller._serialize_tool_calls_result` | `whole_struct` | | low | +| `src.ai_client.run_with_tool_loop` | `whole_struct` | `append`=2 | high | +| `src.project_manager.calculate_track_progress` | `whole_struct` | | low | +| `src.ai_client._reread_file_items_result` | `whole_struct` | | low | +| `src.ai_client._build_file_context_text` | `whole_struct` | | low | + +### Frequency evidence + +| function | frequency | source | note | +|---|---|---|---| +| `src.gui_2._drain_normalize_errors` | `per_turn` | `static_analysis` | producer from src\gui_2.py | +| `src.ai_client._list_minimax_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py | +| `src.ai_client._list_gemini_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py | +| `src.gui_2._render_beads_tab_list_result` | `per_turn` | `static_analysis` | producer from src\gui_2.py | +| `src.ai_client._set_minimax_provider_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py | diff --git a/docs/reports/code_path_audit/2026-06-24/aggregates/History.md b/docs/reports/code_path_audit/2026-06-24/aggregates/History.md new file mode 100644 index 00000000..ac69fbe0 --- /dev/null +++ b/docs/reports/code_path_audit/2026-06-24/aggregates/History.md @@ -0,0 +1,189 @@ +# Aggregate Profile: History + +**Aggregate kind:** typealias +**Memory dim:** discussion +**Is candidate:** False + +## Pipeline summary + +- Producers: 7 +- Consumers: 7 +- Distinct producer fqnames: 7 +- Distinct consumer fqnames: 7 +- Access pattern (aggregate): whole_struct +- Frequency (aggregate): per_turn +- Decomposition direction: hold +- Struct field count (estimated): 5 + +## Producers (7) + +### `src\ai_client.py` (4 producers) + +- `src.ai_client._list_minimax_models_result` (line 2436) +- `src.ai_client._list_gemini_models_result` (line 1626) +- `src.ai_client._set_minimax_provider_result` (line 398) +- `src.ai_client._list_anthropic_models_result` (line 1317) + +### `src\gui_2.py` (2 producers) + +- `src.gui_2._drain_normalize_errors` (line 7417) +- `src.gui_2._render_beads_tab_list_result` (line 8314) + +### `src\provider_state.py` (1 producer) + +- `src.provider_state.get_all` (line 34) + +## Consumers (7) + +### `src\app_controller.py` (3 consumers) + +- `src.app_controller._symbol_resolution_result` (line 3506) +- `src.app_controller._topological_sort_tickets_result` (line 4708) +- `src.app_controller._serialize_tool_calls_result` (line 2217) + +### `src\gui_2.py` (1 consumer) + +- `src.gui_2.__init__` (line 7550) + +### `src\project_manager.py` (1 consumer) + +- `src.project_manager.calculate_track_progress` (line 420) + +### `src\provider_state.py` (2 consumers) + +- `src.provider_state.append` (line 30) +- `src.provider_state.replace_all` (line 38) + +## Field access matrix + +| consumer | _attr_name | _cached | _module_name | _report_worker_error | lock | messages | +|---|---|---|---|---|---|---| +| `_symbol_resolution_result` | . | . | . | . | . | . | +| `_topological_sort_tickets_result` | . | . | . | 1 | . | . | +| `_serialize_tool_calls_result` | . | . | . | . | . | . | +| `append` | . | . | . | . | 1 | 1 | +| `replace_all` | . | . | . | . | 1 | 1 | +| `calculate_track_progress` | . | . | . | . | . | . | +| `__init__` | 1 | 1 | 1 | . | . | . | + +## Access pattern + +**Dominant pattern:** whole_struct +**Evidence count:** 7 + +**Per-function pattern distribution:** + +- `whole_struct`: 4 functions (57%) +- `mixed`: 2 functions (29%) +- `field_by_field`: 1 functions (14%) + +## SSDL Sketch for `History` + +``` +[Q:History entry-point] -> [Q:PCG lookup] + -> [1: _symbol_resolution_result] [B:check] (branches=4) + -> [2: _topological_sort_tickets_result] [B:check] (branches=2) + -> [3: _serialize_tool_calls_result] [B:check] (branches=2) + -> [4: append] [B:check] (branches=1) + -> [5: replace_all] [B:check] (branches=1) + -> [6: calculate_track_progress] [B:check] (branches=1) + -> [7: __init__] [B:check] (branches=0) + -> [T:done] +``` + +**Effective codepaths:** 31 (sum of 2^branches across 7 consumers) +**Total branch points:** 11 +**Nil-check functions:** 0 + +**Defusing opportunities:** + +- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `history_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 8 field-check branches to 1 cache lookup. + - Effective codepaths: 31 -> 8 + + +## Frequency + +**Dominant frequency:** per_turn +**Evidence count:** 5 + +**Per-function frequency distribution:** + +- `per_turn`: 5 functions + +## Result coverage + +**Summary:** 7 producers, 7 consumers + +| metric | value | +|---|---| +| total producers | 7 | +| result producers | 7 | +| total consumers | 7 | +| result consumers | 0 | + +## Type alias coverage + +**Summary:** 8 sites; 0 typed (0%); 8 untyped (100%) + +| metric | value | +|---|---| +| total field-access sites | 8 | +| typed sites (canonical field) | 0 | +| untyped sites (wildcard) | 8 | + +## Cross-audit findings + +_(no cross-audit findings mapped to this aggregate)_ + +## Decomposition cost + +**Current cost estimate:** 470 us/turn +**Componentize savings:** 0 us/turn +**Unify savings:** 70 us/turn +**Recommended direction:** hold +**Rationale:** History: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. +**Struct field count (estimated):** 5 +**Struct frozen:** True + +## Struct shape (inferred from producer returns) + +| field | access count | access pattern | +|---|---|---| +| `lock` | 2 | used | +| `messages` | 2 | used | +| `_report_worker_error` | 1 | used | +| `_module_name` | 1 | used | +| `_attr_name` | 1 | used | +| `_cached` | 1 | used | + +## Optimization candidates + +_(no optimization candidates generated)_ + +## Verdict + +History: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. + +## Evidence appendix + +### Access pattern evidence + +| function | pattern | field_accesses | confidence | +|---|---|---|---| +| `src.app_controller._symbol_resolution_result` | `whole_struct` | | low | +| `src.app_controller._topological_sort_tickets_result` | `whole_struct` | `_report_worker_error`=1 | high | +| `src.app_controller._serialize_tool_calls_result` | `whole_struct` | | low | +| `src.provider_state.append` | `mixed` | `lock`=1, `messages`=1 | high | +| `src.provider_state.replace_all` | `mixed` | `lock`=1, `messages`=1 | high | +| `src.project_manager.calculate_track_progress` | `whole_struct` | | low | +| `src.gui_2.__init__` | `field_by_field` | `_module_name`=1, `_attr_name`=1, `_cached`=1 | high | + +### Frequency evidence + +| function | frequency | source | note | +|---|---|---|---| +| `src.gui_2._drain_normalize_errors` | `per_turn` | `static_analysis` | producer from src\gui_2.py | +| `src.ai_client._list_minimax_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py | +| `src.ai_client._list_gemini_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py | +| `src.gui_2._render_beads_tab_list_result` | `per_turn` | `static_analysis` | producer from src\gui_2.py | +| `src.provider_state.get_all` | `per_turn` | `static_analysis` | producer from src\provider_state.py | diff --git a/docs/reports/code_path_audit/2026-06-24/aggregates/HistoryMessage.md b/docs/reports/code_path_audit/2026-06-24/aggregates/HistoryMessage.md new file mode 100644 index 00000000..15738fa9 --- /dev/null +++ b/docs/reports/code_path_audit/2026-06-24/aggregates/HistoryMessage.md @@ -0,0 +1,572 @@ +# Aggregate Profile: HistoryMessage + +**Aggregate kind:** typealias +**Memory dim:** discussion +**Is candidate:** False + +## Pipeline summary + +- Producers: 118 +- Consumers: 68 +- Distinct producer fqnames: 97 +- Distinct consumer fqnames: 48 +- Access pattern (aggregate): whole_struct +- Frequency (aggregate): per_turn +- Decomposition direction: hold +- Struct field count (estimated): 10 + +## Producers (118) + +### `src\aggregate.py` (1 producer) + +- `src.aggregate.build_file_items` (line 158) + +### `src\ai_client.py` (16 producers) + +- `src.ai_client._load_credentials` (line 282) +- `src.ai_client._pre_dispatch` (line 2089) +- `src.ai_client.get_comms_log` (line 273) +- `src.ai_client.get_gemini_cache_stats` (line 1604) +- `src.ai_client._add_bleed_derived` (line 3332) +- `src.ai_client._get_anthropic_tools` (line 664) +- `src.ai_client._dashscope_call` (line 2716) +- `src.ai_client._extract_dashscope_tool_calls` (line 2754) +- `src.ai_client._send_cli_round_result` (line 1746) +- `src.ai_client._parse_tool_args_result` (line 741) +- `src.ai_client._content_block_to_dict` (line 1200) +- `src.ai_client.ollama_chat` (line 2938) +- `src.ai_client._get_deepseek_tools` (line 1194) +- `src.ai_client._strip_private_keys` (line 1464) +- `src.ai_client._build_chunked_context_blocks` (line 1281) +- `src.ai_client.get_token_stats` (line 3185) + +### `src\api_hook_client.py` (39 producers) + +- `src.api_hook_client.post_project` (line 470) +- `src.api_hook_client.drag` (line 230) +- `src.api_hook_client.set_value` (line 212) +- `src.api_hook_client.get_financial_metrics` (line 520) +- `src.api_hook_client.get_gui_health` (line 434) +- `src.api_hook_client.select_list_item` (line 256) +- `src.api_hook_client.get_mma_status` (line 539) +- `src.api_hook_client.get_project_switch_status` (line 374) +- `src.api_hook_client.get_performance` (line 318) +- `src.api_hook_client.get_patch_status` (line 295) +- `src.api_hook_client.get_startup_timeline` (line 353) +- `src.api_hook_client.get_events` (line 124) +- `src.api_hook_client.get_gui_state` (line 165) +- `src.api_hook_client.click` (line 223) +- `src.api_hook_client.get_node_status` (line 532) +- `src.api_hook_client.reject_patch` (line 288) +- `src.api_hook_client.get_project` (line 367) +- `src.api_hook_client.get_warmup_status` (line 325) +- `src.api_hook_client.right_click` (line 237) +- `src.api_hook_client.get_io_pool_status` (line 420) +- `src.api_hook_client.push_event` (line 156) +- `src.api_hook_client.get_warmup_wait` (line 332) +- `src.api_hook_client.get_status` (line 105) +- `src.api_hook_client._make_request` (line 65) +- `src.api_hook_client.wait_for_project_switch` (line 389) +- `src.api_hook_client.apply_patch` (line 281) +- `src.api_hook_client.get_context_state` (line 491) +- `src.api_hook_client.post_project` (line 473) +- `src.api_hook_client.get_warmup_canaries` (line 342) +- `src.api_hook_client.trigger_patch` (line 274) +- `src.api_hook_client.clear_events` (line 129) +- `src.api_hook_client.post_session` (line 117) +- `src.api_hook_client.get_session` (line 502) +- `src.api_hook_client.get_mma_workers` (line 546) +- `src.api_hook_client.get_gui_diagnostics` (line 311) +- `src.api_hook_client.post_gui` (line 149) +- `src.api_hook_client.get_system_telemetry` (line 524) +- `src.api_hook_client.select_tab` (line 263) +- `src.api_hook_client.wait_for_event` (line 136) + +### `src\app_controller.py` (30 producers) + +- `src.app_controller.wait` (line 5205) +- `src.app_controller.get_mma_status` (line 2835) +- `src.app_controller._api_get_performance` (line 195) +- `src.app_controller.get_performance` (line 2856) +- `src.app_controller.get_diagnostics` (line 2862) +- `src.app_controller.load_config` (line 5142) +- `src.app_controller._api_get_context` (line 398) +- `src.app_controller._api_status` (line 209) +- `src.app_controller.generate` (line 2868) +- `src.app_controller._api_generate` (line 221) +- `src.app_controller._api_token_stats` (line 417) +- `src.app_controller._api_get_gui_state` (line 123) +- `src.app_controller._api_get_diagnostics` (line 202) +- `src.app_controller.get_api_session` (line 2847) +- `src.app_controller.token_stats` (line 2898) +- `src.app_controller._api_get_api_session` (line 170) +- `src.app_controller._offload_entry_payload` (line 4240) +- `src.app_controller._pending_mma_spawn` (line 2772) +- `src.app_controller._api_pending_actions` (line 335) +- `src.app_controller.get_context` (line 2892) +- `src.app_controller.get_session` (line 2883) +- `src.app_controller.status` (line 2865) +- `src.app_controller.get_session_insights` (line 3049) +- `src.app_controller._api_get_api_project` (line 188) +- `src.app_controller._api_get_mma_status` (line 144) +- `src.app_controller._pending_mma_approval` (line 2776) +- `src.app_controller.get_api_project` (line 2853) +- `src.app_controller.pending_actions` (line 2874) +- `src.app_controller.get_gui_state` (line 2829) +- `src.app_controller._api_get_session` (line 374) + +### `src\models.py` (23 producers) + +- `src.models.to_dict` (line 646) +- `src.models.to_dict` (line 1000) +- `src.models.to_dict` (line 672) +- `src.models.to_dict` (line 938) +- `src.models.to_dict` (line 855) +- `src.models.to_dict` (line 441) +- `src.models.to_dict` (line 406) +- `src.models.to_dict` (line 355) +- `src.models.parse_history_entries` (line 214) +- `src.models.to_dict` (line 737) +- `src.models.to_dict` (line 486) +- `src.models.to_dict` (line 913) +- `src.models.to_dict` (line 596) +- `src.models.to_dict` (line 794) +- `src.models.to_dict` (line 558) +- `src.models.to_dict` (line 971) +- `src.models.to_dict` (line 1024) +- `src.models.to_dict` (line 288) +- `src.models.to_dict` (line 701) +- `src.models.to_dict` (line 886) +- `src.models.to_dict` (line 1059) +- `src.models._load_config_from_disk` (line 186) +- `src.models.to_dict` (line 618) + +### `src\project_manager.py` (8 producers) + +- `src.project_manager.load_history` (line 209) +- `src.project_manager.default_project` (line 123) +- `src.project_manager.migrate_from_legacy_config` (line 253) +- `src.project_manager.load_project` (line 186) +- `src.project_manager.get_all_tracks` (line 342) +- `src.project_manager.default_discussion` (line 117) +- `src.project_manager.flat_config` (line 267) +- `src.project_manager.str_to_entry` (line 75) + +### `src\provider_state.py` (1 producer) + +- `src.provider_state.get_all` (line 34) + +## Consumers (68) + +### `src\aggregate.py` (5 consumers) + +- `src.aggregate.build_tier3_context` (line 382) +- `src.aggregate.build_markdown_from_items` (line 348) +- `src.aggregate._build_files_section_from_items` (line 300) +- `src.aggregate.build_markdown_no_history` (line 366) +- `src.aggregate.run` (line 479) + +### `src\ai_client.py` (29 consumers) + +- `src.ai_client._strip_cache_controls` (line 1291) +- `src.ai_client._send_anthropic` (line 1405) +- `src.ai_client._estimate_prompt_tokens` (line 1243) +- `src.ai_client._strip_private_keys` (line 1464) +- `src.ai_client._trim_anthropic_history` (line 1353) +- `src.ai_client._add_history_cache_breakpoint` (line 1299) +- `src.ai_client._send_gemini_cli` (line 2019) +- `src.ai_client._repair_anthropic_history` (line 1381) +- `src.ai_client._create_gemini_cache_result` (line 1706) +- `src.ai_client._dashscope_call` (line 2716) +- `src.ai_client._send_grok` (line 2530) +- `src.ai_client._execute_single_tool_call_async` (line 945) +- `src.ai_client._repair_deepseek_history` (line 2138) +- `src.ai_client._add_bleed_derived` (line 3332) +- `src.ai_client._append_comms` (line 257) +- `src.ai_client._send_llama_native` (line 2958) +- `src.ai_client.send` (line 3208) +- `src.ai_client._estimate_message_tokens` (line 1218) +- `src.ai_client._pre_dispatch` (line 2089) +- `src.ai_client._send_gemini` (line 1802) +- `src.ai_client._send_minimax` (line 2616) +- `src.ai_client._send_deepseek` (line 2165) +- `src.ai_client._trim_minimax_history` (line 2482) +- `src.ai_client.ollama_chat` (line 2938) +- `src.ai_client._send_llama` (line 2858) +- `src.ai_client._invalidate_token_estimate` (line 1240) +- `src.ai_client._repair_minimax_history` (line 2462) +- `src.ai_client._send_qwen` (line 2773) +- `src.ai_client._strip_stale_file_refreshes` (line 1253) + +### `src\app_controller.py` (5 consumers) + +- `src.app_controller._start_track_logic_result` (line 4728) +- `src.app_controller._offload_entry_payload` (line 4240) +- `src.app_controller._start_track_logic` (line 4721) +- `src.app_controller._refresh_api_metrics` (line 3074) +- `src.app_controller._on_comms_entry` (line 4282) + +### `src\models.py` (22 consumers) + +- `src.models.from_dict` (line 603) +- `src.models.from_dict` (line 416) +- `src.models.from_dict` (line 506) +- `src.models.from_dict` (line 814) +- `src.models.from_dict` (line 893) +- `src.models._save_config_to_disk` (line 199) +- `src.models.from_dict` (line 378) +- `src.models.from_dict` (line 1007) +- `src.models.from_dict` (line 1038) +- `src.models.from_dict` (line 866) +- `src.models.from_dict` (line 712) +- `src.models.from_dict` (line 747) +- `src.models.from_dict` (line 683) +- `src.models.from_dict` (line 575) +- `src.models.from_dict` (line 630) +- `src.models.from_dict` (line 454) +- `src.models.from_dict` (line 949) +- `src.models.from_dict` (line 982) +- `src.models.from_dict` (line 656) +- `src.models.from_dict` (line 1072) +- `src.models.from_dict` (line 295) +- `src.models.from_dict` (line 920) + +### `src\project_manager.py` (5 consumers) + +- `src.project_manager.format_discussion` (line 69) +- `src.project_manager.flat_config` (line 267) +- `src.project_manager.entry_to_str` (line 49) +- `src.project_manager.save_project` (line 229) +- `src.project_manager.migrate_from_legacy_config` (line 253) + +### `src\provider_state.py` (2 consumers) + +- `src.provider_state.append` (line 30) +- `src.provider_state.replace_all` (line 38) + +## Field access matrix + +| consumer | _est_tokens | _gemini_cache_text | _pending_gui_tasks | _pending_gui_tasks_lock | _recalculate_session_usage | _start_track_logic_result | _token_stats | _topological_sort_tickets_result | _update_cached_stats | active_discussion | active_project_path | active_project_root | ai_status | append | config | content | context_files | encode | engines | error | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `build_tier3_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_strip_cache_controls` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_send_anthropic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_estimate_prompt_tokens` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_start_track_logic_result` | . | . | 2 | 2 | . | . | . | 1 | . | 1 | 1 | 1 | 4 | . | 1 | . | 1 | . | 1 | . | +| `_strip_private_keys` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_trim_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_add_history_cache_breakpoint` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `build_markdown_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_send_gemini_cli` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_repair_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_create_gemini_cache_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_dashscope_call` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_send_grok` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_offload_entry_payload` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_save_config_to_disk` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_execute_single_tool_call_async` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_repair_deepseek_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . | +| `_add_bleed_derived` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `flat_config` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `append` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_build_files_section_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_append_comms` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_send_llama_native` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `send` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | +| `_start_track_logic` | . | . | . | . | . | 1 | . | . | . | . | . | . | 1 | . | . | . | . | . | . | . | +| `build_markdown_no_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_estimate_message_tokens` | 1 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_pre_dispatch` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_send_gemini` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | +| `_send_minimax` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_refresh_api_metrics` | . | 1 | . | . | 1 | . | 1 | . | 1 | . | . | . | . | . | . | . | . | . | . | 2 | +| `_send_deepseek` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `replace_all` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_trim_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `entry_to_str` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `ollama_chat` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | + +_... 26 more fields_ + +## Access pattern + +**Dominant pattern:** whole_struct +**Evidence count:** 50 + +**Per-function pattern distribution:** + +- `whole_struct`: 29 functions (58%) +- `mixed`: 18 functions (36%) +- `field_by_field`: 3 functions (6%) + +## SSDL Sketch for `HistoryMessage` + +``` +[Q:HistoryMessage entry-point] -> [Q:PCG lookup] + -> [1: from_dict] [B:check] (branches=0) + -> [2: build_tier3_context] [B:check] (branches=50) + -> [3: _strip_cache_controls] [B:check] (branches=4) + -> [4: from_dict] [B:check] (branches=0) + -> [5: from_dict] [B:check] (branches=0) + -> [6: _send_anthropic] [B:is None?] (branches=40) [N:safe] + -> [7: _estimate_prompt_tokens] [B:check] (branches=2) + -> [8: _start_track_logic_result] [B:check] (branches=10) + -> [9: _strip_private_keys] [B:check] (branches=0) + -> [10: _trim_anthropic_history] [B:check] (branches=13) + -> [11: _add_history_cache_breakpoint] [B:check] (branches=5) + -> [12: build_markdown_from_items] [B:check] (branches=9) + -> [13: _send_gemini_cli] [B:is None?] (branches=23) [N:safe] + -> [14: _repair_anthropic_history] [B:check] (branches=6) + -> [15: from_dict] [B:check] (branches=0) + -> [16: format_discussion] [B:check] (branches=0) + -> [17: _create_gemini_cache_result] [B:check] (branches=3) + -> [18: _dashscope_call] [B:check] (branches=5) + -> [19: _send_grok] [B:check] (branches=14) + -> [20: _offload_entry_payload] [B:check] (branches=10) + -> [21: from_dict] [B:check] (branches=0) + -> [22: _save_config_to_disk] [B:check] (branches=1) + -> [23: from_dict] [B:check] (branches=0) + -> [24: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe] + -> [25: from_dict] [B:check] (branches=0) + -> [26: _repair_deepseek_history] [B:check] (branches=6) + -> [27: _add_bleed_derived] [B:check] (branches=0) + -> [28: flat_config] [B:check] (branches=2) + -> [29: append] [B:check] (branches=1) + -> [30: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe] + -> [31: _append_comms] [B:is None?] (branches=1) [N:safe] + -> [32: _send_llama_native] [B:check] (branches=12) + -> [33: send] [B:check] (branches=19) + -> [34: _start_track_logic] [B:check] (branches=1) + -> [35: build_markdown_no_history] [B:check] (branches=0) + -> [36: from_dict] [B:check] (branches=0) + -> [37: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe] + -> [38: _pre_dispatch] [B:check] (branches=8) + -> [39: from_dict] [B:check] (branches=0) + -> [40: from_dict] [B:check] (branches=0) + -> [41: _send_gemini] [B:is None?] (branches=75) [N:safe] + -> [42: _send_minimax] [B:check] (branches=11) + -> [43: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe] + -> [44: _send_deepseek] [B:check] (branches=71) + -> [45: replace_all] [B:check] (branches=1) + -> [46: _trim_minimax_history] [B:check] (branches=8) + -> [47: entry_to_str] [B:check] (branches=3) + -> [48: from_dict] [B:check] (branches=0) + -> [49: from_dict] [B:check] (branches=0) + -> [50: ollama_chat] [B:check] (branches=3) + -> [51: from_dict] [B:check] (branches=0) + -> [52: _send_llama] [B:check] (branches=13) + -> [53: from_dict] [B:check] (branches=0) + -> [54: run] [B:check] (branches=1) + -> [55: _invalidate_token_estimate] [B:check] (branches=0) + -> [56: _on_comms_entry] [B:check] (branches=32) + -> [57: from_dict] [B:check] (branches=0) + -> [58: _repair_minimax_history] [B:check] (branches=10) + -> [59: from_dict] [B:check] (branches=0) + -> [60: from_dict] [B:check] (branches=0) + -> [61: from_dict] [B:check] (branches=0) + -> [62: _send_qwen] [B:check] (branches=9) + -> [63: save_project] [B:is None?] (branches=7) [N:safe] + -> [64: migrate_from_legacy_config] [B:check] (branches=2) + -> [65: from_dict] [B:check] (branches=0) + -> [66: _strip_stale_file_refreshes] [B:check] (branches=12) + -> [67: from_dict] [B:check] (branches=0) + -> [68: from_dict] [B:check] (branches=0) + -> [T:done] +``` + +**Effective codepaths:** 40140116231395706750394 (sum of 2^branches across 68 consumers) +**Total branch points:** 543 +**Nil-check functions:** 9 + +**Defusing opportunities:** + +- **Nil Sentinel `[N]`**: Introduce a module-level `NIL_` sentinel whose field accesses return safe defaults. Replace None checks with the sentinel. Collapses 2^branch_count into ~1. + - Effective codepaths: 40140116231395706750394 -> 40140116231395706750376 +- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `historymessage_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 112 field-check branches to 1 cache lookup. + - Effective codepaths: 40140116231395706750394 -> 112 +- **Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`**: Wrap the aggregate in a generational handle (index + generation). Validation is one comparison; mismatch returns the nil sentinel. Reduces N lifetime branches to 1 handle validation + sentinel return. + - Effective codepaths: 40140116231395706750394 -> 68 + + +## Frequency + +**Dominant frequency:** per_turn +**Evidence count:** 5 + +**Per-function frequency distribution:** + +- `per_turn`: 5 functions + +## Result coverage + +**Summary:** 97 producers, 48 consumers + +| metric | value | +|---|---| +| total producers | 97 | +| result producers | 97 | +| total consumers | 48 | +| result consumers | 0 | + +## Type alias coverage + +**Summary:** 112 sites; 0 typed (0%); 112 untyped (100%) + +| metric | value | +|---|---| +| total field-access sites | 112 | +| typed sites (canonical field) | 0 | +| untyped sites (wildcard) | 112 | + +## Cross-audit findings + +_(no cross-audit findings mapped to this aggregate)_ + +## Decomposition cost + +**Current cost estimate:** 720 us/turn +**Componentize savings:** 0 us/turn +**Unify savings:** 0 us/turn +**Recommended direction:** hold +**Rationale:** HistoryMessage: access_pattern=whole_struct, frequency=per_turn, struct_field_count=10, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. +**Struct field count (estimated):** 10 +**Struct frozen:** True + +## Struct shape (inferred from producer returns) + +| field | access count | access pattern | +|---|---|---| +| `content` | 12 | hot | +| `marker` | 12 | hot | +| `get` | 7 | hot | +| `ai_status` | 2 | used | +| `config` | 2 | used | +| `pop` | 2 | used | +| `append` | 2 | used | +| `lock` | 2 | used | +| `messages` | 2 | used | +| `context_files` | 1 | used | +| `_pending_gui_tasks_lock` | 1 | used | +| `_topological_sort_tickets_result` | 1 | used | +| `active_project_root` | 1 | used | +| `event_queue` | 1 | used | +| `engines` | 1 | used | +| `project` | 1 | used | +| `active_discussion` | 1 | used | +| `submit_io` | 1 | used | +| `tracks` | 1 | used | +| `mma_tier_usage` | 1 | used | +| `_pending_gui_tasks` | 1 | used | +| `mma_step_mode` | 1 | used | +| `active_project_path` | 1 | used | +| `items` | 1 | used | +| `estimated_prompt_tokens` | 1 | used | +| `max_prompt_tokens` | 1 | used | +| `utilization_pct` | 1 | used | +| `headroom` | 1 | used | +| `would_trim` | 1 | used | +| `sys_tokens` | 1 | used | +| `tool_tokens` | 1 | used | +| `history_tokens` | 1 | used | +| `search` | 1 | used | +| `_start_track_logic_result` | 1 | used | +| `_est_tokens` | 1 | used | +| `encode` | 1 | used | +| `latency` | 1 | used | +| `_recalculate_session_usage` | 1 | used | +| `_token_stats` | 1 | used | +| `_gemini_cache_text` | 1 | used | +| `vendor_quota` | 1 | used | +| `last_error` | 1 | used | +| `error` | 1 | used | +| `_update_cached_stats` | 1 | used | +| `session_usage` | 1 | used | +| `usage` | 1 | used | + +## Optimization candidates + +_(no optimization candidates generated)_ + +## Verdict + +HistoryMessage: access_pattern=whole_struct, frequency=per_turn, struct_field_count=10, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. + +## Evidence appendix + +### Access pattern evidence + +| function | pattern | field_accesses | confidence | +|---|---|---|---| +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.aggregate.build_tier3_context` | `whole_struct` | | low | +| `src.ai_client._strip_cache_controls` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._send_anthropic` | `whole_struct` | | low | +| `src.ai_client._estimate_prompt_tokens` | `whole_struct` | | low | +| `src.app_controller._start_track_logic_result` | `field_by_field` | `ai_status`=4, `context_files`=1, `get`=3, `_pending_gui_tasks_lock`=2, `_topological_sort_tickets_result`=1, `active_project_root`=1, `event_queue`=1, `engines`=1, `project`=1, `active_discussion`=1 (+7 more) | high | +| `src.ai_client._strip_private_keys` | `whole_struct` | | low | +| `src.ai_client._trim_anthropic_history` | `whole_struct` | `pop`=5 | high | +| `src.ai_client._add_history_cache_breakpoint` | `whole_struct` | | low | +| `src.aggregate.build_markdown_from_items` | `whole_struct` | | low | +| `src.ai_client._send_gemini_cli` | `whole_struct` | | low | +| `src.ai_client._repair_anthropic_history` | `whole_struct` | `append`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.project_manager.format_discussion` | `whole_struct` | | low | +| `src.ai_client._create_gemini_cache_result` | `whole_struct` | | low | +| `src.ai_client._dashscope_call` | `whole_struct` | | low | +| `src.ai_client._send_grok` | `whole_struct` | | low | +| `src.app_controller._offload_entry_payload` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models._save_config_to_disk` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._execute_single_tool_call_async` | `mixed` | `get`=2, `items`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._repair_deepseek_history` | `whole_struct` | `append`=1 | high | +| `src.ai_client._add_bleed_derived` | `field_by_field` | `estimated_prompt_tokens`=1, `max_prompt_tokens`=1, `utilization_pct`=1, `headroom`=1, `would_trim`=1, `sys_tokens`=1, `tool_tokens`=1, `history_tokens`=1, `get`=3 | high | +| `src.project_manager.flat_config` | `whole_struct` | `get`=7 | high | +| `src.provider_state.append` | `mixed` | `lock`=1, `messages`=1 | high | +| `src.aggregate._build_files_section_from_items` | `whole_struct` | | low | +| `src.ai_client._append_comms` | `whole_struct` | | low | +| `src.ai_client._send_llama_native` | `whole_struct` | | low | +| `src.ai_client.send` | `mixed` | `config`=1, `search`=1 | high | +| `src.app_controller._start_track_logic` | `mixed` | `_start_track_logic_result`=1, `ai_status`=1 | high | +| `src.aggregate.build_markdown_no_history` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._estimate_message_tokens` | `mixed` | `_est_tokens`=1, `get`=2 | high | +| `src.ai_client._pre_dispatch` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._send_gemini` | `whole_struct` | `encode`=1 | high | +| `src.ai_client._send_minimax` | `whole_struct` | | low | +| `src.app_controller._refresh_api_metrics` | `field_by_field` | `latency`=1, `_recalculate_session_usage`=1, `_token_stats`=1, `get`=2, `_gemini_cache_text`=1, `vendor_quota`=1, `last_error`=1, `error`=2, `_update_cached_stats`=1, `session_usage`=2 (+1 more) | high | +| `src.ai_client._send_deepseek` | `whole_struct` | | low | +| `src.provider_state.replace_all` | `mixed` | `lock`=1, `messages`=1 | high | +| `src.ai_client._trim_minimax_history` | `whole_struct` | `pop`=4 | high | +| `src.project_manager.entry_to_str` | `whole_struct` | `get`=4 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client.ollama_chat` | `whole_struct` | | low | + +### Frequency evidence + +| function | frequency | source | note | +|---|---|---|---| +| `src.app_controller.wait` | `per_turn` | `static_analysis` | producer from src\app_controller.py | +| `src.api_hook_client.post_project` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py | +| `src.app_controller.get_mma_status` | `per_turn` | `static_analysis` | producer from src\app_controller.py | +| `src.ai_client._load_credentials` | `per_turn` | `static_analysis` | producer from src\ai_client.py | +| `src.ai_client._pre_dispatch` | `per_turn` | `static_analysis` | producer from src\ai_client.py | diff --git a/docs/reports/code_path_audit/2026-06-24/aggregates/Metadata.md b/docs/reports/code_path_audit/2026-06-24/aggregates/Metadata.md new file mode 100644 index 00000000..cc664fa5 --- /dev/null +++ b/docs/reports/code_path_audit/2026-06-24/aggregates/Metadata.md @@ -0,0 +1,2646 @@ +# Aggregate Profile: Metadata + +**Aggregate kind:** typealias +**Memory dim:** discussion +**Is candidate:** False + +## Pipeline summary + +- Producers: 477 +- Consumers: 751 +- Distinct producer fqnames: 453 +- Distinct consumer fqnames: 696 +- Access pattern (aggregate): whole_struct +- Frequency (aggregate): per_turn +- Decomposition direction: hold +- Struct field count (estimated): 10 + +## Producers (477) + +### `src\aggregate.py` (13 producers) + +- `src.aggregate.compute_file_stats` (line 104) +- `src.aggregate.build_discussion_text` (line 373) +- `src.aggregate.build_tier3_context` (line 382) +- `src.aggregate._build_files_section_from_items` (line 300) +- `src.aggregate.build_screenshots_section` (line 142) +- `src.aggregate.build_discussion_section` (line 125) +- `src.aggregate.build_markdown_no_history` (line 366) +- `src.aggregate.build_beads_section` (line 327) +- `src.aggregate.build_markdown` (line 475) +- `src.aggregate.build_markdown_from_items` (line 348) +- `src.aggregate.group_files_by_dir` (line 86) +- `src.aggregate.run` (line 479) +- `src.aggregate.build_file_items` (line 158) + +### `src\ai_client.py` (59 producers) + +- `src.ai_client._truncate_tool_output` (line 1047) +- `src.ai_client._get_gemini_history_list` (line 1795) +- `src.ai_client._get_combined_system_prompt` (line 221) +- `src.ai_client.get_provider` (line 448) +- `src.ai_client._send_gemini_cli` (line 2019) +- `src.ai_client._add_bleed_derived` (line 3332) +- `src.ai_client._send_deepseek` (line 2165) +- `src.ai_client._list_llama_models` (line 3024) +- `src.ai_client._run_tier4_patch_generation_result` (line 3118) +- `src.ai_client._chunk_text` (line 1278) +- `src.ai_client.get_combined_system_prompt` (line 236) +- `src.ai_client._extract_dashscope_tool_calls` (line 2754) +- `src.ai_client._send_qwen` (line 2773) +- `src.ai_client._parse_tool_args_result` (line 741) +- `src.ai_client._send_grok` (line 2530) +- `src.ai_client._list_deepseek_models` (line 2135) +- `src.ai_client.run_subagent_summarization` (line 3356) +- `src.ai_client.ollama_chat` (line 2938) +- `src.ai_client.run_discussion_compression` (line 3409) +- `src.ai_client._get_deepseek_tools` (line 1194) +- `src.ai_client._strip_private_keys` (line 1464) +- `src.ai_client._build_chunked_context_blocks` (line 1281) +- `src.ai_client._run_script` (line 1038) +- `src.ai_client._send_minimax` (line 2616) +- `src.ai_client.run_tier4_patch_callback` (line 3115) +- `src.ai_client._list_qwen_models` (line 2769) +- `src.ai_client._execute_single_tool_call_async` (line 945) +- `src.ai_client.run_tier4_analysis` (line 3082) +- `src.ai_client._send_llama_native` (line 2958) +- `src.ai_client._try_warm_sdk_result` (line 298) +- `src.ai_client._dashscope_call` (line 2716) +- `src.ai_client._extract_gemini_thoughts_result` (line 1768) +- `src.ai_client._send_anthropic` (line 1405) +- `src.ai_client.list_models` (line 506) +- `src.ai_client._create_gemini_cache_result` (line 1706) +- `src.ai_client._extract_minimax_reasoning` (line 2677) +- `src.ai_client._pre_dispatch` (line 2089) +- `src.ai_client._send_gemini` (line 1802) +- `src.ai_client.get_bias_profile` (line 619) +- `src.ai_client.get_comms_log` (line 273) +- `src.ai_client.get_gemini_cache_stats` (line 1604) +- `src.ai_client._ensure_llama_client` (line 2844) +- `src.ai_client.run_tier4_patch_generation` (line 3157) +- `src.ai_client.send` (line 3208) +- `src.ai_client._ensure_grok_client` (line 2519) +- `src.ai_client.run_with_tool_loop` (line 833) +- `src.ai_client._content_block_to_dict` (line 1200) +- `src.ai_client._list_gemini_cli_models` (line 1616) +- `src.ai_client._list_grok_models` (line 2612) +- `src.ai_client._send_llama` (line 2858) +- `src.ai_client._load_credentials` (line 282) +- `src.ai_client._get_context_marker` (line 218) +- `src.ai_client._get_anthropic_tools` (line 664) +- `src.ai_client._build_file_diff_text` (line 1105) +- `src.ai_client.get_current_tier` (line 159) +- `src.ai_client._build_file_context_text` (line 1092) +- `src.ai_client._send_cli_round_result` (line 1746) +- `src.ai_client._run_tier4_analysis_result` (line 3042) +- `src.ai_client.get_token_stats` (line 3185) + +### `src\api_hook_client.py` (49 producers) + +- `src.api_hook_client.post_project` (line 470) +- `src.api_hook_client.spawn_mma_worker` (line 553) +- `src.api_hook_client.get_project_switch_status` (line 374) +- `src.api_hook_client.get_patch_status` (line 295) +- `src.api_hook_client.get_startup_timeline` (line 353) +- `src.api_hook_client.reject_patch` (line 288) +- `src.api_hook_client.get_project` (line 367) +- `src.api_hook_client.get_warmup_status` (line 325) +- `src.api_hook_client.approve_mma_ticket` (line 583) +- `src.api_hook_client.get_io_pool_status` (line 420) +- `src.api_hook_client.post_project` (line 473) +- `src.api_hook_client.clear_events` (line 129) +- `src.api_hook_client.set_value` (line 212) +- `src.api_hook_client.get_text_value` (line 204) +- `src.api_hook_client.select_list_item` (line 256) +- `src.api_hook_client.get_events` (line 124) +- `src.api_hook_client.get_value` (line 172) +- `src.api_hook_client.right_click` (line 237) +- `src.api_hook_client.get_warmup_wait` (line 332) +- `src.api_hook_client.kill_mma_worker` (line 561) +- `src.api_hook_client.inject_context` (line 484) +- `src.api_hook_client.get_indicator_state` (line 303) +- `src.api_hook_client.get_financial_metrics` (line 520) +- `src.api_hook_client.mutate_mma_dag` (line 576) +- `src.api_hook_client.get_gui_state` (line 165) +- `src.api_hook_client.pause_mma_pipeline` (line 565) +- `src.api_hook_client._make_request` (line 65) +- `src.api_hook_client.post_session` (line 117) +- `src.api_hook_client.get_mma_workers` (line 546) +- `src.api_hook_client.get_gui_diagnostics` (line 311) +- `src.api_hook_client.post_gui` (line 149) +- `src.api_hook_client.select_tab` (line 263) +- `src.api_hook_client.drag` (line 230) +- `src.api_hook_client.get_gui_health` (line 434) +- `src.api_hook_client.get_mma_status` (line 539) +- `src.api_hook_client.get_performance` (line 318) +- `src.api_hook_client.click` (line 223) +- `src.api_hook_client.get_node_status` (line 532) +- `src.api_hook_client.resume_mma_pipeline` (line 572) +- `src.api_hook_client.push_event` (line 156) +- `src.api_hook_client.get_status` (line 105) +- `src.api_hook_client.wait_for_project_switch` (line 389) +- `src.api_hook_client.apply_patch` (line 281) +- `src.api_hook_client.get_context_state` (line 491) +- `src.api_hook_client.get_warmup_canaries` (line 342) +- `src.api_hook_client.trigger_patch` (line 274) +- `src.api_hook_client.get_session` (line 502) +- `src.api_hook_client.get_system_telemetry` (line 524) +- `src.api_hook_client.wait_for_event` (line 136) + +### `src\api_hooks.py` (2 producers) + +- `src.api_hooks._safe_controller_result` (line 81) +- `src.api_hooks._get_app_attr` (line 56) + +### `src\api_hooks_helpers.py` (1 producer) + +- `src.api_hooks_helpers._get_app_attr` (line 3) + +### `src\app_controller.py` (72 producers) + +- `src.app_controller.load_config` (line 5142) +- `src.app_controller._resolve_log_ref` (line 2145) +- `src.app_controller._api_list_sessions` (line 364) +- `src.app_controller._api_token_stats` (line 417) +- `src.app_controller._compute_warmup_list` (line 2570) +- `src.app_controller._api_post_gui` (line 162) +- `src.app_controller._extract_tool_name` (line 4460) +- `src.app_controller.startup_timeline` (line 1435) +- `src.app_controller.current_provider` (line 2780) +- `src.app_controller.mcp_config_json` (line 1734) +- `src.app_controller.get_api_key` (line 2823) +- `src.app_controller._do_generate` (line 4004) +- `src.app_controller.get_session` (line 2883) +- `src.app_controller.list_sessions` (line 2880) +- `src.app_controller.submit_io` (line 2646) +- `src.app_controller._api_get_api_project` (line 188) +- `src.app_controller.rag_collection_name` (line 1725) +- `src.app_controller._api_health` (line 116) +- `src.app_controller._pending_mma_approval` (line 2776) +- `src.app_controller.__getattr__` (line 1273) +- `src.app_controller.get_gui_state` (line 2829) +- `src.app_controller.token_stats` (line 2898) +- `src.app_controller._api_get_session` (line 374) +- `src.app_controller.rag_mcp_tool` (line 1718) +- `src.app_controller.post_gui` (line 2841) +- `src.app_controller._api_stream` (line 327) +- `src.app_controller.mma_status` (line 1606) +- `src.app_controller.post_api_session` (line 2850) +- `src.app_controller._api_status` (line 209) +- `src.app_controller.get_symbol_definition` (line 69) +- `src.app_controller.generate` (line 2868) +- `src.app_controller.stream` (line 2871) +- `src.app_controller._api_get_api_session` (line 170) +- `src.app_controller.ui_file_paths` (line 1764) +- `src.app_controller.status` (line 2865) +- `src.app_controller.rag_emb_provider` (line 1686) +- `src.app_controller._api_get_mma_status` (line 144) +- `src.app_controller.get_api_project` (line 2853) +- `src.app_controller.wait` (line 5205) +- `src.app_controller.get_mma_status` (line 2835) +- `src.app_controller._api_get_performance` (line 195) +- `src.app_controller.delete_session` (line 2889) +- `src.app_controller.get_performance` (line 2856) +- `src.app_controller.get_diagnostics` (line 2862) +- `src.app_controller._api_delete_session` (line 385) +- `src.app_controller._api_get_gui_state` (line 123) +- `src.app_controller.confirm_action` (line 2877) +- `src.app_controller.rag_mcp_server` (line 1711) +- `src.app_controller.rag_source` (line 1676) +- `src.app_controller.pending_actions` (line 2874) +- `src.app_controller._api_confirm_action` (line 346) +- `src.app_controller.health` (line 2826) +- `src.app_controller._api_get_context` (line 398) +- `src.app_controller.summary_cache` (line 1618) +- `src.app_controller._api_generate` (line 221) +- `src.app_controller._api_post_api_session` (line 178) +- `src.app_controller._api_get_diagnostics` (line 202) +- `src.app_controller.get_api_session` (line 2847) +- `src.app_controller._confirm_and_run` (line 4402) +- `src.app_controller._offload_entry_payload` (line 4240) +- `src.app_controller._api_get_key` (line 100) +- `src.app_controller._pending_mma_spawn` (line 2772) +- `src.app_controller._api_pending_actions` (line 335) +- `src.app_controller.active_project_root` (line 1546) +- `src.app_controller.parse_symbols` (line 63) +- `src.app_controller.ai_status` (line 1598) +- `src.app_controller.current_model` (line 2796) +- `src.app_controller.get_context` (line 2892) +- `src.app_controller.warmup_canaries` (line 2601) +- `src.app_controller.get_session_insights` (line 3049) +- `src.app_controller.warmup_status` (line 2593) +- `src.app_controller._get_discussion_names` (line 3741) + +### `src\beads_client.py` (2 producers) + +- `src.beads_client._read_beads` (line 77) +- `src.beads_client.create_bead` (line 42) + +### `src\code_path_audit.py` (11 producers) + +- `src.code_path_audit.load_frequency_overrides` (line 494) +- `src.code_path_audit.to_tree` (line 883) +- `src.code_path_audit.code_path_audit_v2` (line 1124) +- `src.code_path_audit.render_rollups` (line 1083) +- `src.code_path_audit._resolve_aliases` (line 224) +- `src.code_path_audit.to_markdown` (line 815) +- `src.code_path_audit.load_memory_dim_overrides` (line 378) +- `src.code_path_audit.run_all_cross_audit_reads` (line 790) +- `src.code_path_audit.read_input_json` (line 657) +- `src.code_path_audit._extract_type_name` (line 172) +- `src.code_path_audit.generate_rationale` (line 606) + +### `src\code_path_audit_analysis.py` (2 producers) + +- `src.code_path_audit_analysis._field_names_for_aggregate` (line 32) +- `src.code_path_audit_analysis._analyze_function_param_names` (line 67) + +### `src\code_path_audit_cross_audit.py` (5 producers) + +- `src.code_path_audit_cross_audit._normalize_path` (line 66) +- `src.code_path_audit_cross_audit._file_to_aggregates` (line 36) +- `src.code_path_audit_cross_audit.map_finding_to_aggregates` (line 71) +- `src.code_path_audit_cross_audit._aggregate_for_fqname` (line 51) +- `src.code_path_audit_cross_audit.aggregate_findings` (line 93) + +### `src\code_path_audit_gen.py` (2 producers) + +- `src.code_path_audit_gen.strip_h1` (line 17) +- `src.code_path_audit_gen.generate_audit_report` (line 24) + +### `src\code_path_audit_render.py` (3 producers) + +- `src.code_path_audit_render.render_full_markdown` (line 16) +- `src.code_path_audit_render.render_call_graph_rollup` (line 309) +- `src.code_path_audit_render.render_field_usage_rollup` (line 285) + +### `src\code_path_audit_ssdl.py` (4 producers) + +- `src.code_path_audit_ssdl.render_ssdl_rollup` (line 221) +- `src.code_path_audit_ssdl.render_organization_deductions` (line 259) +- `src.code_path_audit_ssdl.suggest_defusing_technique` (line 128) +- `src.code_path_audit_ssdl.render_ssdl_sketch` (line 175) + +### `src\command_palette.py` (1 producer) + +- `src.command_palette.register` (line 32) + +### `src\commands.py` (3 producers) + +- `src.commands._get_real_registry` (line 47) +- `src.commands.__getattr__` (line 43) +- `src.commands.register` (line 39) + +### `src\conductor_tech_lead.py` (2 producers) + +- `src.conductor_tech_lead.generate_tickets` (line 45) +- `src.conductor_tech_lead.topological_sort` (line 107) + +### `src\dag_engine.py` (1 producer) + +- `src.dag_engine.topological_sort` (line 130) + +### `src\diff_viewer.py` (1 producer) + +- `src.diff_viewer.get_line_color` (line 117) + +### `src\events.py` (3 producers) + +- `src.events.get` (line 119) +- `src.events.to_dict` (line 166) +- `src.events._make_serializable` (line 170) + +### `src\external_editor.py` (3 producers) + +- `src.external_editor.build_diff_command` (line 30) +- `src.external_editor._find_vscode_common_paths` (line 90) +- `src.external_editor.create_temp_modified_file` (line 147) + +### `src\file_cache.py` (10 producers) + +- `src.file_cache.get_curated_view` (line 291) +- `src.file_cache.get_file_id` (line 895) +- `src.file_cache.get_definition` (line 538) +- `src.file_cache.get_code_outline` (line 748) +- `src.file_cache.find_id` (line 129) +- `src.file_cache._get_name` (line 123) +- `src.file_cache.update_definition` (line 790) +- `src.file_cache.get_skeleton` (line 207) +- `src.file_cache.get_targeted_view` (line 371) +- `src.file_cache.get_signature` (line 636) + +### `src\fuzzy_anchor.py` (2 producers) + +- `src.fuzzy_anchor.get_context` (line 9) +- `src.fuzzy_anchor.create_slice` (line 20) + +### `src\gemini_cli_adapter.py` (1 producer) + +- `src.gemini_cli_adapter.send` (line 61) + +### `src\gui_2.py` (20 producers) + +- `src.gui_2.ui_screenshot_paths` (line 1014) +- `src.gui_2.__getattr__` (line 742) +- `src.gui_2._render_ast_inspector_outline_result` (line 7863) +- `src.gui_2.current_model` (line 780) +- `src.gui_2._populate_auto_slices_file_read_result` (line 7956) +- `src.gui_2.ui_file_paths` (line 995) +- `src.gui_2._capture_workspace_profile_ini_result` (line 8398) +- `src.gui_2.askopenfilename` (line 88) +- `src.gui_2.app_debug_info` (line 810) +- `src.gui_2._resolve_font_path_result` (line 227) +- `src.gui_2._populate_auto_slices_outline_result` (line 7926) +- `src.gui_2.truncate_entries` (line 173) +- `src.gui_2.asksaveasfilename` (line 91) +- `src.gui_2._diag_layout_state_ini_text_result` (line 8373) +- `src.gui_2.ui_message` (line 7544) +- `src.gui_2.current_provider` (line 772) +- `src.gui_2.missing_files` (line 806) +- `src.gui_2.askdirectory` (line 90) +- `src.gui_2._render_warmup_status_indicator_result` (line 7732) +- `src.gui_2._render_context_batch_actions_preview_result` (line 8167) + +### `src\history.py` (1 producer) + +- `src.history.to_dict` (line 24) + +### `src\hot_reloader.py` (1 producer) + +- `src.hot_reloader.capture_state` (line 33) + +### `src\log_registry.py` (6 producers) + +- `src.log_registry.get` (line 105) +- `src.log_registry.get_old_non_whitelisted_sessions` (line 390) +- `src.log_registry.__getitem__` (line 93) +- `src.log_registry.to_dict` (line 81) +- `src.log_registry.sessions` (line 155) +- `src.log_registry.to_dict` (line 62) + +### `src\markdown_helper.py` (4 producers) + +- `src.markdown_helper._normalize_nested_list_endings` (line 228) +- `src.markdown_helper.detect_language` (line 378) +- `src.markdown_helper._normalize_bullet_delimiters` (line 215) +- `src.markdown_helper._normalize_list_continuations` (line 254) + +### `src\markdown_table.py` (1 producer) + +- `src.markdown_table._split_row` (line 36) + +### `src\mcp_client.py` (87 producers) + +- `src.mcp_client.edit_file_result` (line 312) +- `src.mcp_client.py_get_definition` (line 1347) +- `src.mcp_client.edit_file` (line 1079) +- `src.mcp_client.get_file_slice_result` (line 357) +- `src.mcp_client.derive_code_path` (line 1491) +- `src.mcp_client.ts_c_get_signature_result` (line 481) +- `src.mcp_client.py_get_class_summary` (line 1395) +- `src.mcp_client.py_get_imports` (line 1443) +- `src.mcp_client.py_set_var_declaration_result` (line 789) +- `src.mcp_client.py_get_code_outline` (line 1323) +- `src.mcp_client.ts_c_get_skeleton_result` (line 436) +- `src.mcp_client.py_get_signature_result` (line 684) +- `src.mcp_client._ast_update_definition` (line 432) +- `src.mcp_client.py_check_syntax` (line 1455) +- `src.mcp_client.py_get_class_summary_result` (line 737) +- `src.mcp_client.ts_cpp_get_definition` (line 1245) +- `src.mcp_client.web_search` (line 1578) +- `src.mcp_client.ts_c_update_definition` (line 1201) +- `src.mcp_client.ts_cpp_get_code_outline` (line 1231) +- `src.mcp_client.py_set_var_declaration` (line 1419) +- `src.mcp_client.ts_c_get_code_outline` (line 1163) +- `src.mcp_client.ts_cpp_get_signature` (line 1257) +- `src.mcp_client.get_ui_performance_result` (line 1066) +- `src.mcp_client._ast_get_signature` (line 428) +- `src.mcp_client.get_file_summary_result` (line 340) +- `src.mcp_client.ts_c_get_signature` (line 1189) +- `src.mcp_client.py_get_var_declaration` (line 1407) +- `src.mcp_client.py_get_hierarchy` (line 1467) +- `src.mcp_client.py_get_skeleton_result` (line 595) +- `src.mcp_client.get_tool_schemas` (line 1954) +- `src.mcp_client.get_all_tools` (line 1737) +- `src.mcp_client.get_servers_status` (line 1748) +- `src.mcp_client.read_file_result` (line 239) +- `src.mcp_client.py_get_symbol_info` (line 1335) +- `src.mcp_client.py_get_docstring` (line 1479) +- `src.mcp_client.ts_c_get_definition_result` (line 466) +- `src.mcp_client.async_dispatch` (line 1752) +- `src.mcp_client.ts_cpp_update_definition_result` (line 576) +- `src.mcp_client.get_git_diff_result` (line 397) +- `src.mcp_client.ts_c_update_definition_result` (line 496) +- `src.mcp_client.py_update_definition_result` (line 663) +- `src.mcp_client.set_file_slice_result` (line 374) +- `src.mcp_client.ts_cpp_get_skeleton` (line 1217) +- `src.mcp_client.ts_cpp_get_definition_result` (line 546) +- `src.mcp_client.py_get_symbol_info_result` (line 629) +- `src.mcp_client.list_directory_result` (line 256) +- `src.mcp_client.py_get_skeleton` (line 1311) +- `src.mcp_client.ts_cpp_get_skeleton_result` (line 515) +- `src.mcp_client.py_get_code_outline_result` (line 612) +- `src.mcp_client.get_tree` (line 1505) +- `src.mcp_client.get_file_slice` (line 1108) +- `src.mcp_client.ts_c_get_definition` (line 1177) +- `src.mcp_client.py_check_syntax_result` (line 880) +- `src.mcp_client.py_set_signature_result` (line 714) +- `src.mcp_client._build_tree` (line 1002) +- `src.mcp_client._ast_get_skeleton` (line 416) +- `src.mcp_client.py_get_docstring_result` (line 898) +- `src.mcp_client.py_find_usages_result` (line 811) +- `src.mcp_client.fetch_url_result` (line 1043) +- `src.mcp_client.search_files` (line 177) +- `src.mcp_client.fetch_url` (line 1590) +- `src.mcp_client.ts_cpp_get_code_outline_result` (line 530) +- `src.mcp_client.ts_cpp_get_signature_result` (line 561) +- `src.mcp_client.ts_c_get_skeleton` (line 1149) +- `src.mcp_client.get_ui_performance` (line 1601) +- `src.mcp_client._ast_get_code_outline` (line 420) +- `src.mcp_client.py_get_imports_result` (line 853) +- `src.mcp_client.search_files_result` (line 284) +- `src.mcp_client.set_file_slice` (line 1120) +- `src.mcp_client.web_search_result` (line 1026) +- `src.mcp_client.ts_c_get_code_outline_result` (line 451) +- `src.mcp_client.list_directory` (line 191) +- `src.mcp_client._ast_get_definition` (line 424) +- `src.mcp_client.dispatch` (line 1772) +- `src.mcp_client.ts_cpp_update_definition` (line 1269) +- `src.mcp_client.get_file_summary` (line 1093) +- `src.mcp_client.py_update_definition` (line 1359) +- `src.mcp_client.py_set_signature` (line 1383) +- `src.mcp_client.py_get_definition_result` (line 646) +- `src.mcp_client.py_find_usages` (line 1431) +- `src.mcp_client.derive_code_path_result` (line 923) +- `src.mcp_client.get_git_diff` (line 1132) +- `src.mcp_client.py_get_signature` (line 1371) +- `src.mcp_client.py_get_var_declaration_result` (line 767) +- `src.mcp_client.get_tree_result` (line 992) +- `src.mcp_client.read_file` (line 203) +- `src.mcp_client.async_dispatch` (line 1939) + +### `src\mcp_tool_specs.py` (1 producer) + +- `src.mcp_tool_specs.tool_names` (line 79) + +### `src\models.py` (28 producers) + +- `src.models.to_dict` (line 1000) +- `src.models.to_dict` (line 855) +- `src.models.to_dict` (line 441) +- `src.models.parse_history_entries` (line 214) +- `src.models.to_dict` (line 596) +- `src.models.to_dict` (line 558) +- `src.models.to_dict` (line 288) +- `src.models._clean_nones` (line 179) +- `src.models.to_dict` (line 618) +- `src.models.to_dict` (line 938) +- `src.models.to_dict` (line 913) +- `src.models.to_dict` (line 971) +- `src.models.to_dict` (line 701) +- `src.models.model` (line 775) +- `src.models.to_dict` (line 886) +- `src.models.provider` (line 770) +- `src.models.to_dict` (line 646) +- `src.models.to_dict` (line 406) +- `src.models.get` (line 349) +- `src.models.to_dict` (line 737) +- `src.models.to_dict` (line 486) +- `src.models.to_dict` (line 794) +- `src.models.to_dict` (line 1059) +- `src.models._load_config_from_disk` (line 186) +- `src.models.to_dict` (line 672) +- `src.models.to_dict` (line 355) +- `src.models.to_dict` (line 1024) +- `src.models.__getattr__` (line 271) + +### `src\module_loader.py` (1 producer) + +- `src.module_loader._require_warmed` (line 35) + +### `src\openai_compatible.py` (1 producer) + +- `src.openai_compatible._to_dict_tool_call` (line 54) + +### `src\orchestrator_pm.py` (2 producers) + +- `src.orchestrator_pm.generate_tracks` (line 58) +- `src.orchestrator_pm.get_track_history_summary` (line 14) + +### `src\outline_tool.py` (3 producers) + +- `src.outline_tool.outline` (line 44) +- `src.outline_tool.get_outline` (line 127) +- `src.outline_tool.get_docstring` (line 56) + +### `src\paths.py` (2 producers) + +- `src.paths.info` (line 286) +- `src.paths.get_full_path_info` (line 281) + +### `src\performance_monitor.py` (1 producer) + +- `src.performance_monitor.get_metrics` (line 233) + +### `src\personas.py` (3 producers) + +- `src.personas.load_all` (line 29) +- `src.personas._load_file` (line 86) +- `src.personas.get_persona_scope` (line 61) + +### `src\presets.py` (3 producers) + +- `src.presets._load_file` (line 99) +- `src.presets.load_all` (line 24) +- `src.presets.get_preset_scope` (line 84) + +### `src\project_manager.py` (15 producers) + +- `src.project_manager.default_project` (line 123) +- `src.project_manager.get_all_tracks` (line 342) +- `src.project_manager.clean_nones` (line 220) +- `src.project_manager.default_discussion` (line 117) +- `src.project_manager.load_history` (line 209) +- `src.project_manager.format_discussion` (line 69) +- `src.project_manager.load_project` (line 186) +- `src.project_manager.get_git_commit` (line 104) +- `src.project_manager.calculate_track_progress` (line 420) +- `src.project_manager.str_to_entry` (line 75) +- `src.project_manager.entry_to_str` (line 49) +- `src.project_manager.load_track_history` (line 314) +- `src.project_manager.now_ts` (line 39) +- `src.project_manager.migrate_from_legacy_config` (line 253) +- `src.project_manager.flat_config` (line 267) + +### `src\provider_state.py` (1 producer) + +- `src.provider_state.providers` (line 68) + +### `src\qwen_adapter.py` (1 producer) + +- `src.qwen_adapter.build_dashscope_tools` (line 13) + +### `src\rag_engine.py` (3 producers) + +- `src.rag_engine._read_file_content_result` (line 278) +- `src.rag_engine.get_all_indexed_paths` (line 382) +- `src.rag_engine._chunk_text` (line 210) + +### `src\result_types.py` (1 producer) + +- `src.result_types.ui_message` (line 27) + +### `src\session_logger.py` (3 producers) + +- `src.session_logger.log_tool_output` (line 211) +- `src.session_logger._now_ts` (line 57) +- `src.session_logger.log_tool_call` (line 166) + +### `src\shell_runner.py` (3 producers) + +- `src.shell_runner._build_subprocess_env` (line 43) +- `src.shell_runner._load_env_config` (line 27) +- `src.shell_runner.run_powershell` (line 58) + +### `src\startup_profiler.py` (1 producer) + +- `src.startup_profiler.snapshot` (line 64) + +### `src\summarize.py` (7 producers) + +- `src.summarize._summarise_markdown` (line 105) +- `src.summarize._summarise_toml` (line 78) +- `src.summarize._summarise_generic` (line 121) +- `src.summarize.summarise_file` (line 159) +- `src.summarize._summarise_python` (line 31) +- `src.summarize.build_summary_markdown` (line 212) +- `src.summarize.summarise_items` (line 194) + +### `src\summary_cache.py` (3 producers) + +- `src.summary_cache.get_summary` (line 57) +- `src.summary_cache.get_file_hash` (line 10) +- `src.summary_cache.get_stats` (line 102) + +### `src\synthesis_formatter.py` (1 producer) + +- `src.synthesis_formatter.format_takes_diff` (line 1) + +### `src\theme_2.py` (6 producers) + +- `src.theme_2.get_current_palette` (line 117) +- `src.theme_2.get_current_font_path` (line 123) +- `src.theme_2._build_semantic_colour_dict` (line 52) +- `src.theme_2.get_palette_names` (line 291) +- `src.theme_2.get_font_loading_params` (line 377) +- `src.theme_2.get_syntax_palette_for_theme` (line 351) + +### `src\theme_models.py` (4 producers) + +- `src.theme_models.to_dict` (line 137) +- `src.theme_models.to_dict` (line 107) +- `src.theme_models.load_themes_from_toml` (line 200) +- `src.theme_models.load_themes_from_dir` (line 181) + +### `src\tool_bias.py` (1 producer) + +- `src.tool_bias.generate_tooling_strategy` (line 43) + +### `src\tool_presets.py` (4 producers) + +- `src.tool_presets.load_all_bias_profiles` (line 91) +- `src.tool_presets.load_all_presets` (line 42) +- `src.tool_presets._read_raw` (line 28) +- `src.tool_presets.load_all` (line 63) + +### `src\vendor_capabilities.py` (1 producer) + +- `src.vendor_capabilities.list_models_for_vendor` (line 44) + +### `src\warmup.py` (3 producers) + +- `src.warmup.status` (line 120) +- `src.warmup.canaries` (line 128) +- `src.warmup._snapshot` (line 355) + +### `src\workspace_manager.py` (2 producers) + +- `src.workspace_manager.load_all_profiles` (line 30) +- `src.workspace_manager._load_file` (line 72) + +## Consumers (751) + +### `src\aggregate.py` (14 consumers) + +- `src.aggregate.run` (line 479) +- `src.aggregate.group_files_by_dir` (line 86) +- `src.aggregate.compute_file_stats` (line 104) +- `src.aggregate.build_discussion_text` (line 373) +- `src.aggregate.build_tier3_context` (line 382) +- `src.aggregate._build_files_section_from_items` (line 300) +- `src.aggregate.resolve_paths` (line 68) +- `src.aggregate.build_screenshots_section` (line 142) +- `src.aggregate.find_next_increment` (line 50) +- `src.aggregate.build_discussion_section` (line 125) +- `src.aggregate.build_markdown_no_history` (line 366) +- `src.aggregate.build_markdown` (line 475) +- `src.aggregate.build_markdown_from_items` (line 348) +- `src.aggregate.is_absolute_with_drive` (line 60) + +### `src\ai_client.py` (74 consumers) + +- `src.ai_client._repair_minimax_history` (line 2462) +- `src.ai_client.run_tier4_patch_generation` (line 3157) +- `src.ai_client._classify_minimax_error` (line 375) +- `src.ai_client._repair_deepseek_history` (line 2138) +- `src.ai_client.send` (line 3208) +- `src.ai_client.run_with_tool_loop` (line 833) +- `src.ai_client._list_minimax_models_result` (line 2436) +- `src.ai_client._classify_anthropic_error` (line 315) +- `src.ai_client._content_block_to_dict` (line 1200) +- `src.ai_client._send_llama` (line 2858) +- `src.ai_client._set_bias_profile_result` (line 590) +- `src.ai_client.set_custom_system_prompt` (line 201) +- `src.ai_client._run_tier4_patch_generation_result` (line 3118) +- `src.ai_client.set_current_tier` (line 163) +- `src.ai_client.set_bias_profile` (line 611) +- `src.ai_client._count_gemini_tokens_for_stats_result` (line 3163) +- `src.ai_client._append_comms` (line 257) +- `src.ai_client._dashscope_exception_from_response` (line 2750) +- `src.ai_client._send_cli_round_result` (line 1746) +- `src.ai_client._run_tier4_analysis_result` (line 3042) +- `src.ai_client._run_script` (line 1038) +- `src.ai_client._estimate_message_tokens` (line 1218) +- `src.ai_client.get_token_stats` (line 3185) +- `src.ai_client.set_provider` (line 417) +- `src.ai_client._truncate_tool_output` (line 1047) +- `src.ai_client._get_gemini_history_list` (line 1795) +- `src.ai_client.set_base_system_prompt` (line 206) +- `src.ai_client._strip_cache_controls` (line 1291) +- `src.ai_client._send_gemini_cli` (line 2019) +- `src.ai_client._add_bleed_derived` (line 3332) +- `src.ai_client._send_deepseek` (line 2165) +- `src.ai_client.set_project_context_marker` (line 214) +- `src.ai_client._chunk_text` (line 1278) +- `src.ai_client._extract_dashscope_tool_calls` (line 2754) +- `src.ai_client._send_qwen` (line 2773) +- `src.ai_client._add_history_cache_breakpoint` (line 1299) +- `src.ai_client._execute_tool_calls_concurrently` (line 758) +- `src.ai_client._parse_tool_args_result` (line 741) +- `src.ai_client._send_grok` (line 2530) +- `src.ai_client._list_deepseek_models` (line 2135) +- `src.ai_client.run_subagent_summarization` (line 3356) +- `src.ai_client.ollama_chat` (line 2938) +- `src.ai_client.run_discussion_compression` (line 3409) +- `src.ai_client._strip_private_keys` (line 1464) +- `src.ai_client._trim_anthropic_history` (line 1353) +- `src.ai_client._build_chunked_context_blocks` (line 1281) +- `src.ai_client._classify_gemini_error` (line 333) +- `src.ai_client._send_minimax` (line 2616) +- `src.ai_client.set_agent_tools` (line 532) +- `src.ai_client.run_tier4_patch_callback` (line 3115) +- `src.ai_client.set_tool_preset` (line 576) +- `src.ai_client._invalidate_token_estimate` (line 1240) +- `src.ai_client._execute_single_tool_call_async` (line 945) +- `src.ai_client.run_tier4_analysis` (line 3082) +- `src.ai_client._send_llama_native` (line 2958) +- `src.ai_client._try_warm_sdk_result` (line 298) +- `src.ai_client._run_tier4_patch_callback_result` (line 3089) +- `src.ai_client._strip_stale_file_refreshes` (line 1253) +- `src.ai_client._set_minimax_provider_result` (line 398) +- `src.ai_client._should_cache_gemini_result` (line 1679) +- `src.ai_client._dashscope_call` (line 2716) +- `src.ai_client._extract_gemini_thoughts_result` (line 1768) +- `src.ai_client._classify_deepseek_error` (line 349) +- `src.ai_client._send_anthropic` (line 1405) +- `src.ai_client._estimate_prompt_tokens` (line 1243) +- `src.ai_client.list_models` (line 506) +- `src.ai_client._list_gemini_models_result` (line 1626) +- `src.ai_client._repair_anthropic_history` (line 1381) +- `src.ai_client._create_gemini_cache_result` (line 1706) +- `src.ai_client._set_tool_preset_result` (line 539) +- `src.ai_client._extract_minimax_reasoning` (line 2677) +- `src.ai_client._pre_dispatch` (line 2089) +- `src.ai_client._send_gemini` (line 1802) +- `src.ai_client._trim_minimax_history` (line 2482) + +### `src\api_hook_client.py` (26 consumers) + +- `src.api_hook_client.request_confirmation` (line 244) +- `src.api_hook_client._make_request` (line 65) +- `src.api_hook_client.post_session` (line 117) +- `src.api_hook_client.post_gui` (line 149) +- `src.api_hook_client.select_tab` (line 263) +- `src.api_hook_client.drag` (line 230) +- `src.api_hook_client.click` (line 223) +- `src.api_hook_client.get_node_status` (line 532) +- `src.api_hook_client.push_event` (line 156) +- `src.api_hook_client.__init__` (line 58) +- `src.api_hook_client.wait_for_project_switch` (line 389) +- `src.api_hook_client.trigger_patch` (line 274) +- `src.api_hook_client.wait_for_event` (line 136) +- `src.api_hook_client.post_project` (line 470) +- `src.api_hook_client.spawn_mma_worker` (line 553) +- `src.api_hook_client.get_value` (line 172) +- `src.api_hook_client.kill_mma_worker` (line 561) +- `src.api_hook_client.approve_mma_ticket` (line 583) +- `src.api_hook_client.post_project` (line 473) +- `src.api_hook_client.set_value` (line 212) +- `src.api_hook_client.get_text_value` (line 204) +- `src.api_hook_client.select_list_item` (line 256) +- `src.api_hook_client.right_click` (line 237) +- `src.api_hook_client.inject_context` (line 484) +- `src.api_hook_client.get_indicator_state` (line 303) +- `src.api_hook_client.mutate_mma_dag` (line 576) + +### `src\api_hooks.py` (10 consumers) + +- `src.api_hooks._parse_float_result` (line 100) +- `src.api_hooks.__init__` (line 857) +- `src.api_hooks._get_app_attr` (line 56) +- `src.api_hooks._serialize_for_api` (line 142) +- `src.api_hooks._has_app_attr` (line 66) +- `src.api_hooks._safe_controller_result` (line 81) +- `src.api_hooks.log_message` (line 853) +- `src.api_hooks.__init__` (line 910) +- `src.api_hooks._set_app_attr` (line 72) +- `src.api_hooks.__init__` (line 133) + +### `src\api_hooks_helpers.py` (3 consumers) + +- `src.api_hooks_helpers._has_app_attr` (line 13) +- `src.api_hooks_helpers._set_app_attr` (line 19) +- `src.api_hooks_helpers._get_app_attr` (line 3) + +### `src\app_controller.py` (123 consumers) + +- `src.app_controller._topological_sort_tickets_result` (line 4708) +- `src.app_controller._handle_set_mma_status` (line 525) +- `src.app_controller.ui_file_paths` (line 1768) +- `src.app_controller._handle_drag` (line 613) +- `src.app_controller.inject_context` (line 2523) +- `src.app_controller._api_delete_session` (line 385) +- `src.app_controller._cb_load_track_result` (line 5013) +- `src.app_controller.confirm_action` (line 2877) +- `src.app_controller.current_provider` (line 2784) +- `src.app_controller.kill_worker` (line 4841) +- `src.app_controller._handle_custom_callback` (line 543) +- `src.app_controller._flush_to_project_result` (line 2180) +- `src.app_controller._cb_ticket_retry` (line 4809) +- `src.app_controller._handle_clear_summary_cache` (line 3372) +- `src.app_controller._handle_bead_updated` (line 721) +- `src.app_controller.approve_ticket` (line 4864) +- `src.app_controller._handle_mma_state_update` (line 460) +- `src.app_controller._handle_ticket_completed` (line 710) +- `src.app_controller._switch_project` (line 3193) +- `src.app_controller._set_mcp_config_json_result` (line 1745) +- `src.app_controller._switch_discussion` (line 3749) +- `src.app_controller.cb_load_prior_log` (line 2120) +- `src.app_controller._api_confirm_action` (line 346) +- `src.app_controller._set_rag_status` (line 3434) +- `src.app_controller._on_comms_entry` (line 4282) +- `src.app_controller._cb_save_bias_profile` (line 3671) +- `src.app_controller._cb_apply_view_preset` (line 3714) +- `src.app_controller._handle_clear_ask` (line 641) +- `src.app_controller._handle_hide_patch_modal` (line 751) +- `src.app_controller._api_post_api_session` (line 178) +- `src.app_controller._handle_ai_response` (line 428) +- `src.app_controller._start_track_logic_result` (line 4728) +- `src.app_controller._confirm_and_run` (line 4402) +- `src.app_controller._offload_entry_payload` (line 4240) +- `src.app_controller._api_get_key` (line 100) +- `src.app_controller._update_gcli_adapter` (line 1831) +- `src.app_controller.parse_symbols` (line 63) +- `src.app_controller.__init__` (line 5172) +- `src.app_controller._cb_create_track` (line 4944) +- `src.app_controller._handle_show_patch_modal` (line 745) +- `src.app_controller.mutate_dag` (line 4877) +- `src.app_controller._load_project_from_path_result` (line 2446) +- `src.app_controller._handle_right_click` (line 621) +- `src.app_controller._handle_ticket_started` (line 689) +- `src.app_controller._do_project_switch` (line 3146) +- `src.app_controller.rag_emb_provider` (line 1690) +- `src.app_controller._refresh_api_metrics` (line 3074) +- `src.app_controller._on_tool_log` (line 4230) +- `src.app_controller._cb_ticket_skip` (line 4819) +- `src.app_controller._rename_discussion` (line 4115) +- `src.app_controller._start_track_logic` (line 4721) +- `src.app_controller._handle_click` (line 583) +- `src.app_controller.__init__` (line 5194) +- `src.app_controller._resolve_log_ref` (line 2145) +- `src.app_controller.rag_mcp_tool` (line 1721) +- `src.app_controller._cb_delete_bias_profile` (line 3678) +- `src.app_controller.rag_source` (line 1680) +- `src.app_controller._handle_set_ai_status` (line 521) +- `src.app_controller._record_startup_timeline_error` (line 1412) +- `src.app_controller._on_api_event` (line 4260) +- `src.app_controller._cb_new_project_automated` (line 3131) +- `src.app_controller._rag_search_result` (line 3488) +- `src.app_controller.start_services` (line 2560) +- `src.app_controller._cb_save_view_preset` (line 3696) +- `src.app_controller._api_post_gui` (line 162) +- `src.app_controller._cb_delete_workspace_profile` (line 2921) +- `src.app_controller._extract_tool_name` (line 4460) +- `src.app_controller._symbol_resolution_result` (line 3506) +- `src.app_controller._cb_delete_view_preset` (line 3724) +- `src.app_controller.get_api_key` (line 2823) +- `src.app_controller.get_session` (line 2883) +- `src.app_controller._cb_save_persona` (line 3682) +- `src.app_controller._save_fallback_project_result` (line 2461) +- `src.app_controller._handle_select_list_item` (line 628) +- `src.app_controller._fetch_models` (line 3565) +- `src.app_controller._handle_set_comms_dirty` (line 733) +- `src.app_controller._handle_mma_spawn_approval` (line 662) +- `src.app_controller._test_callback_func_write_to_file` (line 1932) +- `src.app_controller._cb_load_track` (line 5000) +- `src.app_controller.__getattr__` (line 1273) +- `src.app_controller._report_worker_error` (line 3528) +- `src.app_controller.__init__` (line 78) +- `src.app_controller._list_models_for_provider_result` (line 3544) +- `src.app_controller._api_get_session` (line 374) +- `src.app_controller._on_warmup_complete_for_timeline` (line 1504) +- `src.app_controller.rag_collection_name` (line 1728) +- `src.app_controller._cb_save_workspace_profile` (line 2910) +- `src.app_controller.mcp_config_json` (line 1737) +- `src.app_controller.post_gui` (line 2841) +- `src.app_controller._handle_set_value` (line 562) +- `src.app_controller._on_ai_stream` (line 4271) +- `src.app_controller._spawn_worker` (line 4829) +- `src.app_controller.post_api_session` (line 2850) +- `src.app_controller._on_performance_alert` (line 3038) +- `src.app_controller._handle_mma_stream` (line 529) +- `src.app_controller._cb_load_workspace_profile` (line 2930) +- `src.app_controller.get_symbol_definition` (line 69) +- `src.app_controller._handle_set_tool_log_dirty` (line 737) +- `src.app_controller._append_tool_log` (line 4381) +- `src.app_controller.ai_status` (line 1602) +- `src.app_controller._handle_mma_step_approval` (line 648) +- `src.app_controller.current_model` (line 2800) +- `src.app_controller._apply_preset` (line 3616) +- `src.app_controller._handle_ask` (line 635) +- `src.app_controller.rag_mcp_server` (line 1714) +- `src.app_controller._cb_start_track` (line 4662) +- `src.app_controller._init_ai_and_hooks` (line 2718) +- `src.app_controller.mma_status` (line 1610) +- `src.app_controller._delete_discussion` (line 4131) +- `src.app_controller._handle_refresh_api_metrics` (line 517) +- `src.app_controller._parse_token_history_first_ts_result` (line 2232) +- `src.app_controller._handle_show_track_proposal` (line 538) +- `src.app_controller.set_vendor_quota` (line 3101) +- `src.app_controller._cb_delete_persona` (line 3689) +- `src.app_controller._on_sigint` (line 780) +- `src.app_controller._deserialize_active_track_result` (line 2195) +- `src.app_controller.load_context_preset` (line 3394) +- `src.app_controller._create_discussion` (line 4081) +- `src.app_controller.resolve_pending_action` (line 4442) +- `src.app_controller._handle_mma_respond` (line 4972) +- `src.app_controller.delete_session` (line 2889) +- `src.app_controller._handle_refresh_from_project` (line 741) +- `src.app_controller._execute_gui_task_result` (line 1866) + +### `src\beads_client.py` (3 consumers) + +- `src.beads_client.create_bead` (line 42) +- `src.beads_client.update_bead` (line 55) +- `src.beads_client._write_beads` (line 82) + +### `src\code_path_audit.py` (26 consumers) + +- `src.code_path_audit.is_hot_cold_split` (line 425) +- `src.code_path_audit.P1_pass` (line 249) +- `src.code_path_audit.load_frequency_overrides` (line 494) +- `src.code_path_audit.load_memory_dim_overrides` (line 378) +- `src.code_path_audit.add_field_access` (line 169) +- `src.code_path_audit.synthesize_aggregate_profile` (line 930) +- `src.code_path_audit.run_all_cross_audit_reads` (line 790) +- `src.code_path_audit.read_input_json` (line 657) +- `src.code_path_audit.file_origin_memory_dim` (line 391) +- `src.code_path_audit.compute_decomposition_cost` (line 627) +- `src.code_path_audit.detect_frequency_from_entry_point` (line 478) +- `src.code_path_audit.aggregate_cross_audit_findings` (line 752) +- `src.code_path_audit.generate_rationale` (line 606) +- `src.code_path_audit.find_enclosing_function` (line 727) +- `src.code_path_audit.build_pcg` (line 300) +- `src.code_path_audit.dominant_pattern` (line 433) +- `src.code_path_audit._resolve_aliases` (line 224) +- `src.code_path_audit.code_path_audit_v2` (line 1124) +- `src.code_path_audit.classify_memory_dim` (line 399) +- `src.code_path_audit.P2_pass` (line 264) +- `src.code_path_audit.run_audit` (line 1036) +- `src.code_path_audit.add_producer` (line 163) +- `src.code_path_audit.P3_pass` (line 280) +- `src.code_path_audit.estimate_call_frequency` (line 507) +- `src.code_path_audit.add_consumer` (line 166) +- `src.code_path_audit.detect_access_pattern` (line 444) + +### `src\code_path_audit_analysis.py` (10 consumers) + +- `src.code_path_audit_analysis.estimate_struct_size` (line 257) +- `src.code_path_audit_analysis.extract_real_optimization_candidates` (line 327) +- `src.code_path_audit_analysis.compute_real_decomposition_cost` (line 276) +- `src.code_path_audit_analysis._analyze_function_field_accesses` (line 41) +- `src.code_path_audit_analysis.analyze_consumer_fields` (line 78) +- `src.code_path_audit_analysis.analyze_producer_size` (line 117) +- `src.code_path_audit_analysis._field_names_for_aggregate` (line 32) +- `src.code_path_audit_analysis.aggregate_pattern_from_consumers` (line 181) +- `src.code_path_audit_analysis.compute_real_type_alias_coverage` (line 222) +- `src.code_path_audit_analysis.analyze_consumer_pattern` (line 164) + +### `src\code_path_audit_cross_audit.py` (7 consumers) + +- `src.code_path_audit_cross_audit._aggregate_for_fqname` (line 51) +- `src.code_path_audit_cross_audit.aggregate_findings` (line 93) +- `src.code_path_audit_cross_audit._all_function_refs` (line 24) +- `src.code_path_audit_cross_audit._normalize_path` (line 66) +- `src.code_path_audit_cross_audit._file_to_aggregates` (line 36) +- `src.code_path_audit_cross_audit.build_cross_audit_findings_for_aggregate` (line 130) +- `src.code_path_audit_cross_audit.map_finding_to_aggregates` (line 71) + +### `src\code_path_audit_gen.py` (2 consumers) + +- `src.code_path_audit_gen.strip_h1` (line 17) +- `src.code_path_audit_gen.generate_audit_report` (line 24) + +### `src\code_path_audit_ssdl.py` (8 consumers) + +- `src.code_path_audit_ssdl._resolve_filepath` (line 31) +- `src.code_path_audit_ssdl.count_branches_in_function` (line 58) +- `src.code_path_audit_ssdl.render_ssdl_rollup` (line 221) +- `src.code_path_audit_ssdl.detect_nil_check_pattern` (line 84) +- `src.code_path_audit_ssdl.render_organization_deductions` (line 259) +- `src.code_path_audit_ssdl.render_ssdl_sketch` (line 175) +- `src.code_path_audit_ssdl.compute_effective_codepaths` (line 39) +- `src.code_path_audit_ssdl.suggest_defusing_technique` (line 128) + +### `src\command_palette.py` (11 consumers) + +- `src.command_palette._starts_at_word_boundary` (line 85) +- `src.command_palette._count_gaps` (line 95) +- `src.command_palette._close_palette` (line 107) +- `src.command_palette._is_subsequence` (line 67) +- `src.command_palette._execute` (line 116) +- `src.command_palette.get` (line 50) +- `src.command_palette.fuzzy_match` (line 54) +- `src.command_palette._compute_score` (line 75) +- `src.command_palette.render_palette_modal` (line 128) +- `src.command_palette._is_contiguous` (line 91) +- `src.command_palette.register` (line 32) + +### `src\commands.py` (4 consumers) + +- `src.commands.__getattr__` (line 43) +- `src.commands.register` (line 39) +- `src.commands._toggle_window` (line 64) +- `src.commands._toggle_attr` (line 70) + +### `src\conductor_tech_lead.py` (2 consumers) + +- `src.conductor_tech_lead.topological_sort` (line 107) +- `src.conductor_tech_lead.generate_tickets` (line 45) + +### `src\context_presets.py` (3 consumers) + +- `src.context_presets.load_all` (line 10) +- `src.context_presets.save_preset` (line 22) +- `src.context_presets.delete_preset` (line 28) + +### `src\cost_tracker.py` (1 consumer) + +- `src.cost_tracker.estimate_cost` (line 66) + +### `src\dag_engine.py` (2 consumers) + +- `src.dag_engine.approve_task` (line 206) +- `src.dag_engine.update_task_status` (line 217) + +### `src\diff_viewer.py` (4 consumers) + +- `src.diff_viewer.apply_patch_to_file` (line 126) +- `src.diff_viewer.parse_diff` (line 49) +- `src.diff_viewer.parse_hunk_header` (line 27) +- `src.diff_viewer.get_line_color` (line 117) + +### `src\events.py` (5 consumers) + +- `src.events.__init__` (line 156) +- `src.events.emit` (line 66) +- `src.events._make_serializable` (line 170) +- `src.events.put` (line 100) +- `src.events.on` (line 54) + +### `src\external_editor.py` (5 consumers) + +- `src.external_editor.launch_diff` (line 37) +- `src.external_editor.get_editor` (line 22) +- `src.external_editor.create_temp_modified_file` (line 147) +- `src.external_editor.build_diff_command` (line 30) +- `src.external_editor.launch_editor` (line 50) + +### `src\file_cache.py` (17 consumers) + +- `src.file_cache.update_definition` (line 790) +- `src.file_cache.get_skeleton` (line 207) +- `src.file_cache.get_targeted_view` (line 371) +- `src.file_cache.get_signature` (line 636) +- `src.file_cache.get_cached_tree` (line 100) +- `src.file_cache.deep_search` (line 858) +- `src.file_cache.deep_search` (line 705) +- `src.file_cache.walk` (line 799) +- `src.file_cache.get_curated_view` (line 291) +- `src.file_cache.walk` (line 646) +- `src.file_cache.get_definition` (line 538) +- `src.file_cache.parse` (line 93) +- `src.file_cache.deep_search` (line 608) +- `src.file_cache.get_code_outline` (line 748) +- `src.file_cache.__init__` (line 78) +- `src.file_cache._get_mtime_safe` (line 48) +- `src.file_cache.walk` (line 549) + +### `src\fuzzy_anchor.py` (3 consumers) + +- `src.fuzzy_anchor.create_slice` (line 20) +- `src.fuzzy_anchor.resolve_slice` (line 40) +- `src.fuzzy_anchor.get_context` (line 9) + +### `src\gemini_cli_adapter.py` (3 consumers) + +- `src.gemini_cli_adapter.__init__` (line 51) +- `src.gemini_cli_adapter.send` (line 61) +- `src.gemini_cli_adapter.count_tokens` (line 191) + +### `src\gui_2.py` (44 consumers) + +- `src.gui_2.delete_context_preset` (line 989) +- `src.gui_2._render_window_if_open` (line 1113) +- `src.gui_2.render_text_viewer` (line 154) +- `src.gui_2.ui_screenshot_paths` (line 1018) +- `src.gui_2._diag_layout_state_ini_text_result` (line 8373) +- `src.gui_2.current_model` (line 784) +- `src.gui_2.render_discussion_entry` (line 4720) +- `src.gui_2._load_fonts_main_result` (line 7578) +- `src.gui_2.render_thinking_trace` (line 4672) +- `src.gui_2.render_path_field` (line 2494) +- `src.gui_2._cb_unblock_ticket` (line 1426) +- `src.gui_2._cb_block_ticket` (line 1407) +- `src.gui_2.render_tier_stream_panel` (line 6905) +- `src.gui_2.cb_load_prior_log` (line 1235) +- `src.gui_2.ui_file_paths` (line 999) +- `src.gui_2._tier_stream_scroll_sync_result` (line 1644) +- `src.gui_2._set_context_files` (line 542) +- `src.gui_2._ticket_id_max_int_result` (line 1694) +- `src.gui_2.__init__` (line 52) +- `src.gui_2.__getattr__` (line 742) +- `src.gui_2.__getattr__` (line 73) +- `src.gui_2._capture_workspace_profile` (line 881) +- `src.gui_2.render_heavy_text` (line 6400) +- `src.gui_2._simulate_save_preset` (line 547) +- `src.gui_2._on_warmup_complete_callback` (line 4979) +- `src.gui_2._on_warmup_complete_callback_result` (line 1609) +- `src.gui_2._render_ast_inspector_outline_result` (line 7863) +- `src.gui_2.current_provider` (line 776) +- `src.gui_2.load_context_preset` (line 972) +- `src.gui_2.truncate_entries` (line 173) +- `src.gui_2._set_external_editor_default` (line 1242) +- `src.gui_2.render_selectable_label` (line 161) +- `src.gui_2._save_context_preset_force` (line 366) +- `src.gui_2._cb_kill_ticket` (line 1403) +- `src.gui_2.__init__` (line 7539) +- `src.gui_2._drain_normalize_errors` (line 7417) +- `src.gui_2._render_ast_inspector_file_content_result` (line 7896) +- `src.gui_2.request_patch_from_tier4` (line 1379) +- `src.gui_2._test_callback_func_write_to_file` (line 1030) +- `src.gui_2.request_patch_from_tier4_result` (line 8089) +- `src.gui_2.render_discussion_entry_read_mode` (line 4824) +- `src.gui_2._resolve_font_path_result` (line 227) +- `src.gui_2._populate_auto_slices_outline_result` (line 7926) +- `src.gui_2.__setattr__` (line 749) + +### `src\history.py` (5 consumers) + +- `src.history.redo` (line 103) +- `src.history.from_dict` (line 45) +- `src.history.push` (line 80) +- `src.history.undo` (line 92) +- `src.history.jump_to_undo` (line 129) + +### `src\hot_reloader.py` (4 consumers) + +- `src.hot_reloader.capture_state` (line 33) +- `src.hot_reloader.reload` (line 42) +- `src.hot_reloader.restore_state` (line 37) +- `src.hot_reloader.reload_all` (line 69) + +### `src\imgui_scopes.py` (26 consumers) + +- `src.imgui_scopes.__init__` (line 262) +- `src.imgui_scopes.__init__` (line 11) +- `src.imgui_scopes.id` (line 37) +- `src.imgui_scopes.menu` (line 62) +- `src.imgui_scopes.__init__` (line 189) +- `src.imgui_scopes.window` (line 260) +- `src.imgui_scopes.node` (line 93) +- `src.imgui_scopes.style_var` (line 155) +- `src.imgui_scopes.tab_bar` (line 187) +- `src.imgui_scopes.tab_item` (line 204) +- `src.imgui_scopes.__init__` (line 39) +- `src.imgui_scopes.tree_node_ex` (line 243) +- `src.imgui_scopes.__init__` (line 206) +- `src.imgui_scopes.__init__` (line 64) +- `src.imgui_scopes.__init__` (line 143) +- `src.imgui_scopes.__init__` (line 124) +- `src.imgui_scopes.style_color` (line 141) +- `src.imgui_scopes.__init__` (line 157) +- `src.imgui_scopes.__init__` (line 108) +- `src.imgui_scopes.__init__` (line 245) +- `src.imgui_scopes.popup_modal` (line 122) +- `src.imgui_scopes.child` (line 9) +- `src.imgui_scopes.table` (line 169) +- `src.imgui_scopes.__init__` (line 171) +- `src.imgui_scopes.__init__` (line 95) +- `src.imgui_scopes.popup` (line 106) + +### `src\log_pruner.py` (1 consumer) + +- `src.log_pruner.__init__` (line 18) + +### `src\log_registry.py` (9 consumers) + +- `src.log_registry.update_auto_whitelist_status` (line 329) +- `src.log_registry.__init__` (line 142) +- `src.log_registry.from_dict` (line 113) +- `src.log_registry.register_session` (line 223) +- `src.log_registry.set_session_start_time` (line 283) +- `src.log_registry.get` (line 105) +- `src.log_registry.is_session_whitelisted` (line 313) +- `src.log_registry.update_session_metadata` (line 249) +- `src.log_registry.__getitem__` (line 93) + +### `src\markdown_helper.py` (14 consumers) + +- `src.markdown_helper.render_code` (line 407) +- `src.markdown_helper._normalize_list_continuations` (line 254) +- `src.markdown_helper._is_likely_lang_tag` (line 375) +- `src.markdown_helper.render_unindented` (line 303) +- `src.markdown_helper._get_language_id` (line 26) +- `src.markdown_helper.render_unindented` (line 404) +- `src.markdown_helper._on_open_link` (line 108) +- `src.markdown_helper.render_code` (line 370) +- `src.markdown_helper._render_code_block` (line 307) +- `src.markdown_helper._normalize_nested_list_endings` (line 228) +- `src.markdown_helper.detect_language` (line 378) +- `src.markdown_helper.render` (line 398) +- `src.markdown_helper.render` (line 128) +- `src.markdown_helper._normalize_bullet_delimiters` (line 215) + +### `src\markdown_table.py` (3 consumers) + +- `src.markdown_table.parse_tables` (line 47) +- `src.markdown_table._is_table_at` (line 42) +- `src.markdown_table._split_row` (line 36) + +### `src\mcp_client.py` (94 consumers) + +- `src.mcp_client.py_get_symbol_info` (line 1335) +- `src.mcp_client.ts_c_get_definition_result` (line 466) +- `src.mcp_client.get_git_diff_result` (line 397) +- `src.mcp_client.handle_endtag` (line 1568) +- `src.mcp_client.ts_c_update_definition_result` (line 496) +- `src.mcp_client.py_update_definition_result` (line 663) +- `src.mcp_client.set_file_slice_result` (line 374) +- `src.mcp_client.ts_cpp_get_definition_result` (line 546) +- `src.mcp_client.py_get_symbol_info_result` (line 629) +- `src.mcp_client.handle_data` (line 1551) +- `src.mcp_client.py_get_skeleton` (line 1311) +- `src.mcp_client.py_get_code_outline_result` (line 612) +- `src.mcp_client.get_tree` (line 1505) +- `src.mcp_client._resolve_and_check_result` (line 216) +- `src.mcp_client.ts_c_get_definition` (line 1177) +- `src.mcp_client.py_check_syntax_result` (line 880) +- `src.mcp_client._send_request` (line 1678) +- `src.mcp_client.py_set_signature_result` (line 714) +- `src.mcp_client._build_tree` (line 1002) +- `src.mcp_client._ast_get_skeleton` (line 416) +- `src.mcp_client.py_get_docstring_result` (line 898) +- `src.mcp_client.fetch_url_result` (line 1043) +- `src.mcp_client.fetch_url` (line 1590) +- `src.mcp_client.ts_c_get_signature_result` (line 481) +- `src.mcp_client.ts_c_get_skeleton` (line 1149) +- `src.mcp_client._ast_get_code_outline` (line 420) +- `src.mcp_client.py_get_imports_result` (line 853) +- `src.mcp_client.search_files_result` (line 284) +- `src.mcp_client.set_file_slice` (line 1120) +- `src.mcp_client.web_search_result` (line 1026) +- `src.mcp_client.handle_endtag` (line 1536) +- `src.mcp_client.ts_c_get_code_outline_result` (line 451) +- `src.mcp_client.list_directory` (line 191) +- `src.mcp_client._ast_get_definition` (line 424) +- `src.mcp_client.dispatch` (line 1772) +- `src.mcp_client.ts_cpp_update_definition` (line 1269) +- `src.mcp_client.get_file_summary` (line 1093) +- `src.mcp_client.py_update_definition` (line 1359) +- `src.mcp_client.py_set_signature` (line 1383) +- `src.mcp_client._ast_update_definition` (line 432) +- `src.mcp_client.py_get_definition_result` (line 646) +- `src.mcp_client.py_find_usages` (line 1431) +- `src.mcp_client.derive_code_path_result` (line 923) +- `src.mcp_client.configure` (line 108) +- `src.mcp_client.get_git_diff` (line 1132) +- `src.mcp_client.py_get_signature` (line 1371) +- `src.mcp_client.py_get_var_declaration_result` (line 767) +- `src.mcp_client.get_tree_result` (line 992) +- `src.mcp_client.find_in_scope` (line 1289) +- `src.mcp_client.read_file` (line 203) +- `src.mcp_client.py_get_hierarchy` (line 1467) +- `src.mcp_client.async_dispatch` (line 1939) +- `src.mcp_client.handle_data` (line 1572) +- `src.mcp_client.ts_cpp_get_code_outline` (line 1231) +- `src.mcp_client.edit_file_result` (line 312) +- `src.mcp_client.call_tool` (line 1704) +- `src.mcp_client.py_get_definition` (line 1347) +- `src.mcp_client.edit_file` (line 1079) +- `src.mcp_client.get_file_slice_result` (line 357) +- `src.mcp_client.derive_code_path` (line 1491) +- `src.mcp_client.py_get_class_summary` (line 1395) +- `src.mcp_client.py_get_imports` (line 1443) +- `src.mcp_client.py_set_var_declaration_result` (line 789) +- `src.mcp_client.py_get_code_outline` (line 1323) +- `src.mcp_client.ts_c_get_skeleton_result` (line 436) +- `src.mcp_client.py_get_signature_result` (line 684) +- `src.mcp_client.py_check_syntax` (line 1455) +- `src.mcp_client.handle_starttag` (line 1527) +- `src.mcp_client.py_get_docstring` (line 1479) +- `src.mcp_client.py_get_class_summary_result` (line 737) +- `src.mcp_client.async_dispatch` (line 1752) +- `src.mcp_client._get_symbol_node` (line 1285) +- `src.mcp_client.ts_cpp_update_definition_result` (line 576) +- `src.mcp_client.ts_cpp_get_definition` (line 1245) +- `src.mcp_client.ts_cpp_get_skeleton` (line 1217) +- `src.mcp_client.list_directory_result` (line 256) +- `src.mcp_client.web_search` (line 1578) +- `src.mcp_client.ts_cpp_get_skeleton_result` (line 515) +- `src.mcp_client.ts_c_update_definition` (line 1201) +- `src.mcp_client.py_set_var_declaration` (line 1419) +- `src.mcp_client.ts_c_get_code_outline` (line 1163) +- `src.mcp_client.get_file_slice` (line 1108) +- `src.mcp_client.ts_cpp_get_signature` (line 1257) +- `src.mcp_client._ast_get_signature` (line 428) +- `src.mcp_client.get_file_summary_result` (line 340) +- `src.mcp_client.py_find_usages_result` (line 811) +- `src.mcp_client.search_files` (line 177) +- `src.mcp_client.ts_c_get_signature` (line 1189) +- `src.mcp_client.py_get_var_declaration` (line 1407) +- `src.mcp_client.ts_cpp_get_code_outline_result` (line 530) +- `src.mcp_client.py_get_skeleton_result` (line 595) +- `src.mcp_client.ts_cpp_get_signature_result` (line 561) +- `src.mcp_client.handle_starttag` (line 1564) +- `src.mcp_client.read_file_result` (line 239) + +### `src\mcp_tool_specs.py` (1 consumer) + +- `src.mcp_tool_specs.get_tool_spec` (line 69) + +### `src\models.py` (29 consumers) + +- `src.models.from_dict` (line 893) +- `src.models.from_dict` (line 866) +- `src.models.from_dict` (line 683) +- `src.models.load_mcp_config` (line 1084) +- `src.models.get` (line 349) +- `src.models.from_dict` (line 656) +- `src.models.from_dict` (line 454) +- `src.models.from_dict` (line 416) +- `src.models.from_dict` (line 378) +- `src.models._save_config_to_disk` (line 199) +- `src.models.from_dict` (line 1038) +- `src.models.from_dict` (line 575) +- `src.models.__getattr__` (line 271) +- `src.models.from_dict` (line 1072) +- `src.models.from_dict` (line 949) +- `src.models.parse_history_entries` (line 214) +- `src.models.from_dict` (line 1007) +- `src.models.from_dict` (line 747) +- `src.models.from_dict` (line 630) +- `src.models.from_dict` (line 603) +- `src.models.from_dict` (line 982) +- `src.models.mark_manual_block` (line 326) +- `src.models.from_dict` (line 295) +- `src.models._clean_nones` (line 179) +- `src.models.from_dict` (line 712) +- `src.models.mark_blocked` (line 319) +- `src.models.from_dict` (line 920) +- `src.models.from_dict` (line 506) +- `src.models.from_dict` (line 814) + +### `src\module_loader.py` (1 consumer) + +- `src.module_loader._require_warmed` (line 35) + +### `src\multi_agent_conductor.py` (16 consumers) + +- `src.multi_agent_conductor.run` (line 240) +- `src.multi_agent_conductor.update_task_status` (line 166) +- `src.multi_agent_conductor.approve_task` (line 158) +- `src.multi_agent_conductor.stream_callback` (line 569) +- `src.multi_agent_conductor._queue_put` (line 362) +- `src.multi_agent_conductor._push_state` (line 192) +- `src.multi_agent_conductor.parse_json_tickets` (line 208) +- `src.multi_agent_conductor.run_worker_lifecycle` (line 433) +- `src.multi_agent_conductor.confirm_spawn` (line 391) +- `src.multi_agent_conductor.clutch_callback` (line 558) +- `src.multi_agent_conductor.kill_worker` (line 174) +- `src.multi_agent_conductor._count_tokens` (line 492) +- `src.multi_agent_conductor.confirm_execution` (line 367) +- `src.multi_agent_conductor.spawn` (line 64) +- `src.multi_agent_conductor.worker_comms_callback` (line 574) +- `src.multi_agent_conductor.update_usage` (line 137) + +### `src\openai_compatible.py` (5 consumers) + +- `src.openai_compatible._to_typed_tool_call` (line 43) +- `src.openai_compatible._send_blocking` (line 116) +- `src.openai_compatible._classify_openai_compatible_error` (line 58) +- `src.openai_compatible.send_openai_compatible` (line 80) +- `src.openai_compatible._send_streaming` (line 133) + +### `src\openai_schemas.py` (1 consumer) + +- `src.openai_schemas.__init__` (line 82) + +### `src\orchestrator_pm.py` (1 consumer) + +- `src.orchestrator_pm.generate_tracks` (line 58) + +### `src\outline_tool.py` (2 consumers) + +- `src.outline_tool.outline` (line 44) +- `src.outline_tool.get_outline` (line 127) + +### `src\patch_modal.py` (2 consumers) + +- `src.patch_modal.apply_patch` (line 57) +- `src.patch_modal.request_patch_approval` (line 19) + +### `src\paths.py` (5 consumers) + +- `src.paths._resolve_path` (line 104) +- `src.paths.get_conductor_dir` (line 271) +- `src.paths.get_tracks_dir` (line 242) +- `src.paths.get_track_state_dir` (line 246) +- `src.paths.get_archive_dir` (line 250) + +### `src\performance_monitor.py` (8 consumers) + +- `src.performance_monitor.start_component` (line 207) +- `src.performance_monitor.end_component` (line 216) +- `src.performance_monitor.scope` (line 281) +- `src.performance_monitor.__exit__` (line 77) +- `src.performance_monitor.__init__` (line 71) +- `src.performance_monitor._get_avg` (line 155) +- `src.performance_monitor._add_to_history` (line 140) +- `src.performance_monitor.get_history` (line 269) + +### `src\personas.py` (5 consumers) + +- `src.personas._get_path` (line 16) +- `src.personas.delete_persona` (line 76) +- `src.personas._save_file` (line 98) +- `src.personas.save_persona` (line 49) +- `src.personas.get_persona_scope` (line 61) + +### `src\presets.py` (4 consumers) + +- `src.presets.get_preset_scope` (line 84) +- `src.presets.save_preset` (line 52) +- `src.presets._save_file` (line 117) +- `src.presets.delete_preset` (line 70) + +### `src\project_manager.py` (16 consumers) + +- `src.project_manager.format_discussion` (line 69) +- `src.project_manager.promote_take` (line 471) +- `src.project_manager.get_git_commit` (line 104) +- `src.project_manager.str_to_entry` (line 75) +- `src.project_manager.entry_to_str` (line 49) +- `src.project_manager.flat_config` (line 267) +- `src.project_manager.load_track_state` (line 300) +- `src.project_manager.migrate_from_legacy_config` (line 253) +- `src.project_manager.parse_ts` (line 42) +- `src.project_manager.default_project` (line 123) +- `src.project_manager.branch_discussion` (line 453) +- `src.project_manager.save_track_state` (line 289) +- `src.project_manager.save_track_history` (line 329) +- `src.project_manager.save_project` (line 229) +- `src.project_manager.clean_nones` (line 220) +- `src.project_manager.load_track_history` (line 314) + +### `src\provider_state.py` (1 consumer) + +- `src.provider_state.get_history` (line 57) + +### `src\qwen_adapter.py` (2 consumers) + +- `src.qwen_adapter.classify_dashscope_error` (line 26) +- `src.qwen_adapter.build_dashscope_tools` (line 13) + +### `src\rag_engine.py` (18 consumers) + +- `src.rag_engine.add_documents` (line 196) +- `src.rag_engine._check_existing_index_result` (line 260) +- `src.rag_engine.delete_documents` (line 374) +- `src.rag_engine.__init__` (line 60) +- `src.rag_engine._search_mcp` (line 339) +- `src.rag_engine._read_file_content_result` (line 278) +- `src.rag_engine.delete_documents_by_path` (line 390) +- `src.rag_engine._chunk_code_result` (line 226) +- `src.rag_engine.__init__` (line 69) +- `src.rag_engine._get_file_mtime_result` (line 250) +- `src.rag_engine.search` (line 349) +- `src.rag_engine.index_file` (line 289) +- `src.rag_engine.embed` (line 72) +- `src.rag_engine.__init__` (line 105) +- `src.rag_engine.embed` (line 64) +- `src.rag_engine.embed` (line 56) +- `src.rag_engine._chunk_text` (line 210) +- `src.rag_engine._parse_search_response_result` (line 88) + +### `src\session_logger.py` (7 consumers) + +- `src.session_logger.open_session` (line 60) +- `src.session_logger.log_cli_call` (line 234) +- `src.session_logger.log_tool_call` (line 166) +- `src.session_logger.reset_session` (line 135) +- `src.session_logger.log_comms` (line 152) +- `src.session_logger.log_api_hook` (line 140) +- `src.session_logger.log_tool_output` (line 211) + +### `src\shell_runner.py` (1 consumer) + +- `src.shell_runner.run_powershell` (line 58) + +### `src\startup_profiler.py` (2 consumers) + +- `src.startup_profiler.phase` (line 49) +- `src.startup_profiler._log_phase_output` (line 17) + +### `src\summarize.py` (7 consumers) + +- `src.summarize._summarise_generic` (line 121) +- `src.summarize.summarise_file` (line 159) +- `src.summarize._summarise_python` (line 31) +- `src.summarize.build_summary_markdown` (line 212) +- `src.summarize.summarise_items` (line 194) +- `src.summarize._summarise_markdown` (line 105) +- `src.summarize._summarise_toml` (line 78) + +### `src\summary_cache.py` (4 consumers) + +- `src.summary_cache.__init__` (line 22) +- `src.summary_cache.get_file_hash` (line 10) +- `src.summary_cache.get_summary` (line 57) +- `src.summary_cache.set_summary` (line 70) + +### `src\synthesis_formatter.py` (1 consumer) + +- `src.synthesis_formatter.format_takes_diff` (line 1) + +### `src\theme_2.py` (17 consumers) + +- `src.theme_2.get_gamma` (line 89) +- `src.theme_2._get_tm` (line 84) +- `src.theme_2._tone_map` (line 100) +- `src.theme_2.get_syntax_palette_for_theme` (line 351) +- `src.theme_2.save_to_config` (line 302) +- `src.theme_2.reset_tone_mapping` (line 95) +- `src.theme_2.get_color` (line 153) +- `src.theme_2.get_role_tint` (line 204) +- `src.theme_2.render_post_fx` (line 401) +- `src.theme_2.set_gamma` (line 93) +- `src.theme_2.set_brightness` (line 91) +- `src.theme_2.get_brightness` (line 87) +- `src.theme_2.apply_syntax_palette` (line 359) +- `src.theme_2.get_contrast` (line 88) +- `src.theme_2.load_from_config` (line 320) +- `src.theme_2.set_contrast` (line 92) +- `src.theme_2.apply` (line 213) + +### `src\theme_models.py` (6 consumers) + +- `src.theme_models.load_theme_file` (line 166) +- `src.theme_models.from_dict` (line 145) +- `src.theme_models.load_themes_from_toml` (line 200) +- `src.theme_models.load_themes_from_dir` (line 181) +- `src.theme_models.from_dict` (line 100) +- `src.theme_models.with_scope` (line 127) + +### `src\theme_nerv_fx.py` (1 consumer) + +- `src.theme_nerv_fx.update` (line 79) + +### `src\thinking_parser.py` (3 consumers) + +- `src.thinking_parser.extract_tags` (line 22) +- `src.thinking_parser.extract_colon_blocks` (line 41) +- `src.thinking_parser.parse_thinking_trace` (line 8) + +### `src\tool_presets.py` (6 consumers) + +- `src.tool_presets._get_path` (line 15) +- `src.tool_presets.delete_bias_profile` (line 129) +- `src.tool_presets.save_bias_profile` (line 118) +- `src.tool_presets.save_preset` (line 70) +- `src.tool_presets.delete_preset` (line 81) +- `src.tool_presets._write_raw` (line 37) + +### `src\vendor_capabilities.py` (2 consumers) + +- `src.vendor_capabilities.get_capabilities` (line 37) +- `src.vendor_capabilities.list_models_for_vendor` (line 44) + +### `src\warmup.py` (7 consumers) + +- `src.warmup._log_stderr` (line 314) +- `src.warmup._warmup_one` (line 170) +- `src.warmup.submit` (line 92) +- `src.warmup._record_success` (line 192) +- `src.warmup._record_failure` (line 231) +- `src.warmup._fire_callback` (line 328) +- `src.warmup._log_canary` (line 266) + +### `src\workspace_manager.py` (4 consumers) + +- `src.workspace_manager.save_profile` (line 50) +- `src.workspace_manager.delete_profile` (line 62) +- `src.workspace_manager._get_path` (line 20) +- `src.workspace_manager._save_file` (line 81) + +## Field access matrix + +| consumer | _abort_events | _active_workers | _component_starts | _current_provider | _dirty | _disc_entries_lock | _drag_actions | _flags | _get_name | _get_path | _id | _load_active_tickets | _load_file | _lock | _mma_status | _pause_event | _predefined_callbacks | _push_state | _read_raw | _ready_tasks | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| `_starts_at_word_boundary` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `run` | 1 | 1 | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | 7 | . | 2 | +| `__init__` | . | . | . | . | . | . | . | 1 | . | . | 1 | . | . | . | . | . | . | . | . | . | +| `add_documents` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_topological_sort_tickets_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `delete_context_preset` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `__init__` | . | . | . | . | . | . | . | 1 | . | . | 1 | . | . | . | . | . | . | . | . | . | +| `_get_path` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_get_path` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `render_code` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `py_get_symbol_info` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `get_gamma` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `start_component` | . | . | 1 | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `load_all` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `id` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `estimate_struct_size` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_handle_set_mma_status` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | +| `ts_c_get_definition_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_check_existing_index_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_normalize_list_continuations` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `update_task_status` | . | . | . | . | 1 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `approve_task` | . | . | . | . | 1 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `ui_file_paths` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_is_likely_lang_tag` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_handle_drag` | . | . | . | . | . | . | 2 | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_render_window_if_open` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `update_definition` | . | . | . | . | . | . | . | . | 2 | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `inject_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `render_text_viewer` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_summarise_generic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `save_profile` | . | . | . | . | . | . | . | . | . | 1 | . | . | 1 | . | . | . | . | . | . | . | +| `menu` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_api_delete_session` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_cb_load_track_result` | . | . | . | . | . | 1 | . | . | . | . | . | 1 | . | . | . | . | . | . | . | . | +| `delete_bias_profile` | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . | . | . | 1 | . | +| `run` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `confirm_action` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_repair_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `get_skeleton` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `capture_state` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `current_provider` | . | . | . | 1 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `kill_worker` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `get_git_diff_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `delete_persona` | . | . | . | . | . | . | . | . | . | 1 | . | . | 1 | . | . | . | . | . | . | . | +| `get_targeted_view` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_handle_custom_callback` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 2 | . | . | . | + +_... 46 more fields_ + +## Access pattern + +**Dominant pattern:** whole_struct +**Evidence count:** 50 + +**Per-function pattern distribution:** + +- `whole_struct`: 24 functions (48%) +- `field_by_field`: 14 functions (28%) +- `mixed`: 12 functions (24%) + +## SSDL Sketch for `Metadata` + +``` +[Q:Metadata entry-point] -> [Q:PCG lookup] + -> [1: _starts_at_word_boundary] [B:check] (branches=4) + -> [2: run] [B:is None?] (branches=31) [N:safe] + -> [3: __init__] [B:check] (branches=2) + -> [4: add_documents] [B:check] (branches=2) + -> [5: _topological_sort_tickets_result] [B:check] (branches=2) + -> [6: delete_context_preset] [B:check] (branches=1) + -> [7: __init__] [B:check] (branches=2) + -> [8: _get_path] [B:check] (branches=3) + -> [9: _get_path] [B:check] (branches=3) + -> [10: render_code] [B:check] (branches=0) + -> [11: py_get_symbol_info] [B:check] (branches=1) + -> [12: format_discussion] [B:check] (branches=0) + -> [13: get_gamma] [B:check] (branches=0) + -> [14: start_component] [B:check] (branches=2) + -> [15: from_dict] [B:check] (branches=0) + -> [16: load_all] [B:check] (branches=3) + -> [17: id] [B:check] (branches=0) + -> [18: estimate_struct_size] [B:check] (branches=3) + -> [19: _handle_set_mma_status] [B:check] (branches=0) + -> [20: ts_c_get_definition_result] [B:check] (branches=5) + -> [21: _check_existing_index_result] [B:check] (branches=6) + -> [22: _normalize_list_continuations] [B:check] (branches=9) + -> [23: update_task_status] [B:check] (branches=0) + -> [24: approve_task] [B:check] (branches=0) + -> [25: ui_file_paths] [B:check] (branches=0) + -> [26: _is_likely_lang_tag] [B:check] (branches=1) + -> [27: _handle_drag] [B:check] (branches=1) + -> [28: _render_window_if_open] [B:check] (branches=4) + -> [29: update_definition] [B:check] (branches=42) + -> [30: from_dict] [B:check] (branches=0) + -> [31: inject_context] [B:check] (branches=3) + -> [32: render_text_viewer] [B:check] (branches=3) + -> [33: _summarise_generic] [B:check] (branches=10) + -> [34: save_profile] [B:check] (branches=1) + -> [35: menu] [B:check] (branches=0) + -> [36: _api_delete_session] [B:check] (branches=2) + -> [37: from_dict] [B:check] (branches=0) + -> [38: _cb_load_track_result] [B:check] (branches=6) + -> [39: delete_bias_profile] [B:check] (branches=2) + -> [40: run] [B:check] (branches=1) + -> [41: confirm_action] [B:check] (branches=0) + -> [42: _repair_minimax_history] [B:check] (branches=10) + -> [43: get_skeleton] [B:check] (branches=27) + -> [44: capture_state] [B:check] (branches=0) + -> [45: current_provider] [B:check] (branches=0) + -> [46: kill_worker] [B:check] (branches=1) + -> [47: get_git_diff_result] [B:check] (branches=6) + -> [48: delete_persona] [B:check] (branches=2) + -> [49: get_targeted_view] [B:check] (branches=56) + -> [50: _handle_custom_callback] [B:check] (branches=4) + -> [51: __init__] [B:check] (branches=0) + -> [52: run_tier4_patch_generation] [B:check] (branches=0) + -> [53: is_hot_cold_split] [B:check] (branches=1) + -> [54: handle_endtag] [B:check] (branches=5) + -> [55: ts_c_update_definition_result] [B:check] (branches=6) + -> [56: _log_stderr] [B:check] (branches=2) + -> [57: load_mcp_config] [B:check] (branches=4) + -> [58: delete_documents] [B:check] (branches=2) + -> [59: end_component] [B:is None?] (branches=8) [N:safe] + -> [60: py_update_definition_result] [B:check] (branches=6) + -> [61: get] [B:check] (branches=0) + -> [62: _has_app_attr] [B:check] (branches=3) + -> [63: set_file_slice_result] [B:check] (branches=7) + -> [64: _classify_minimax_error] [B:is None?] (branches=21) [N:safe] + -> [65: _repair_deepseek_history] [B:check] (branches=6) + -> [66: _flush_to_project_result] [B:check] (branches=2) + -> [67: ts_cpp_get_definition_result] [B:check] (branches=5) + -> [68: py_get_symbol_info_result] [B:check] (branches=5) + -> [69: send] [B:check] (branches=19) + -> [70: ui_screenshot_paths] [B:check] (branches=0) + -> [71: handle_data] [B:check] (branches=2) + -> [72: run_with_tool_loop] [B:is None?] (branches=23) [N:safe] + -> [73: _parse_float_result] [B:check] (branches=2) + -> [74: _aggregate_for_fqname] [B:check] (branches=4) + -> [75: _cb_ticket_retry] [B:check] (branches=2) + -> [76: _handle_clear_summary_cache] [B:check] (branches=0) + -> [77: _handle_bead_updated] [B:check] (branches=4) + -> [78: approve_ticket] [B:check] (branches=4) + -> [79: _count_gaps] [B:check] (branches=5) + -> [80: get_signature] [B:check] (branches=46) + -> [81: outline] [B:check] (branches=26) + -> [82: P1_pass] [B:is None?] (branches=5) [N:safe] + -> [83: redo] [B:check] (branches=1) + -> [84: from_dict] [B:check] (branches=0) + -> [85: py_get_skeleton] [B:check] (branches=1) + -> [86: request_confirmation] [B:check] (branches=0) + -> [87: _list_minimax_models_result] [B:check] (branches=4) + -> [88: load_theme_file] [B:check] (branches=5) + -> [89: __init__] [B:check] (branches=0) + -> [90: _make_request] [B:check] (branches=8) + -> [91: _diag_layout_state_ini_text_result] [B:check] (branches=3) + -> [92: _close_palette] [B:check] (branches=0) + -> [93: _resolve_path] [B:check] (branches=6) + -> [94: from_dict] [B:check] (branches=4) + -> [95: __init__] [B:check] (branches=2) + -> [96: from_dict] [B:check] (branches=0) + -> [97: _handle_mma_state_update] [B:is None?] (branches=27) [N:safe] + -> [98: open_session] [B:is None?] (branches=5) [N:safe] + -> [99: py_get_code_outline_result] [B:check] (branches=6) + -> [100: render_unindented] [B:check] (branches=0) + -> [101: window] [B:check] (branches=0) + -> [102: _handle_ticket_completed] [B:check] (branches=3) + -> [103: summarise_file] [B:check] (branches=7) + -> [104: post_session] [B:check] (branches=1) + -> [105: get_tree] [B:check] (branches=1) + -> [106: _classify_anthropic_error] [B:check] (branches=15) + -> [107: _content_block_to_dict] [B:check] (branches=5) + -> [108: _resolve_and_check_result] [B:check] (branches=5) + -> [109: scope] [B:check] (branches=0) + -> [110: _is_subsequence] [B:check] (branches=3) + -> [111: _to_typed_tool_call] [B:check] (branches=3) + -> [112: _resolve_filepath] [B:check] (branches=1) + -> [113: ts_c_get_definition] [B:check] (branches=1) + -> [114: _switch_project] [B:check] (branches=7) + -> [115: _set_mcp_config_json_result] [B:check] (branches=2) + -> [116: current_model] [B:check] (branches=0) + -> [117: __getattr__] [B:check] (branches=0) + -> [118: post_gui] [B:check] (branches=1) + -> [119: py_check_syntax_result] [B:check] (branches=7) + -> [120: select_tab] [B:check] (branches=0) + -> [121: load_frequency_overrides] [B:check] (branches=4) + -> [122: extract_tags] [B:check] (branches=0) + -> [123: stream_callback] [B:check] (branches=1) + -> [124: promote_take] [B:check] (branches=4) + -> [125: aggregate_findings] [B:check] (branches=9) + -> [126: _send_request] [B:check] (branches=2) + -> [127: _switch_discussion] [B:check] (branches=4) + -> [128: count_branches_in_function] [B:is None?] (branches=9) [N:safe] + -> [129: _send_llama] [B:check] (branches=13) + -> [130: from_dict] [B:check] (branches=0) + -> [131: render_discussion_entry] [B:check] (branches=21) + -> [132: __init__] [B:check] (branches=0) + -> [133: _set_bias_profile_result] [B:check] (branches=5) + -> [134: get_git_commit] [B:check] (branches=2) + -> [135: _warmup_one] [B:is None?] (branches=7) [N:safe] + -> [136: _load_fonts_main_result] [B:check] (branches=3) + -> [137: node] [B:check] (branches=0) + -> [138: submit] [B:check] (branches=4) + -> [139: py_set_signature_result] [B:check] (branches=7) + -> [140: from_dict] [B:check] (branches=0) + -> [141: _build_tree] [B:check] (branches=8) + -> [142: str_to_entry] [B:check] (branches=5) + -> [143: extract_real_optimization_candidates] [B:check] (branches=4) + -> [144: create_bead] [B:check] (branches=0) + -> [145: cb_load_prior_log] [B:is None?] (branches=13) [N:safe] + -> [146: register] [B:check] (branches=0) + -> [147: load_memory_dim_overrides] [B:check] (branches=4) + -> [148: add_field_access] [B:check] (branches=0) + -> [149: from_dict] [B:check] (branches=0) + -> [150: _ast_get_skeleton] [B:check] (branches=0) + -> [151: __init__] [B:check] (branches=1) + -> [152: _toggle_window] [B:check] (branches=2) + -> [153: py_get_docstring_result] [B:check] (branches=10) + -> [154: launch_diff] [B:check] (branches=3) + -> [155: render_thinking_trace] [B:check] (branches=12) + -> [156: __init__] [B:check] (branches=0) + -> [157: style_var] [B:check] (branches=0) + -> [158: set_custom_system_prompt] [B:check] (branches=0) + -> [159: drag] [B:check] (branches=0) + -> [160: _api_confirm_action] [B:is None?] (branches=4) [N:safe] + -> [161: fetch_url_result] [B:check] (branches=8) + -> [162: synthesize_aggregate_profile] [B:is None?] (branches=4) [N:safe] + -> [163: create_slice] [B:check] (branches=0) + -> [164: _set_rag_status] [B:check] (branches=1) + -> [165: _get_app_attr] [B:check] (branches=3) + -> [166: entry_to_str] [B:check] (branches=3) + -> [167: load_themes_from_toml] [B:check] (branches=10) + -> [168: parse_tables] [B:check] (branches=7) + -> [169: _on_comms_entry] [B:check] (branches=32) + -> [170: fetch_url] [B:check] (branches=1) + -> [171: get_cached_tree] [B:check] (branches=4) + -> [172: _summarise_python] [B:check] (branches=21) + -> [173: tab_bar] [B:check] (branches=0) + -> [174: _queue_put] [B:is None?] (branches=1) [N:safe] + -> [175: _all_function_refs] [B:check] (branches=2) + -> [176: _run_tier4_patch_generation_result] [B:check] (branches=5) + -> [177: tab_item] [B:check] (branches=0) + -> [178: _send_blocking] [B:check] (branches=4) + -> [179: format_takes_diff] [B:check] (branches=10) + -> [180: _get_tm] [B:check] (branches=0) + -> [181: ts_c_get_signature_result] [B:check] (branches=5) + -> [182: _get_language_id] [B:check] (branches=7) + -> [183: _cb_save_bias_profile] [B:check] (branches=0) + -> [184: ts_c_get_skeleton] [B:check] (branches=1) + -> [185: set_current_tier] [B:check] (branches=0) + -> [186: _cb_apply_view_preset] [B:check] (branches=1) + -> [187: build_summary_markdown] [B:check] (branches=2) + -> [188: _save_config_to_disk] [B:check] (branches=1) + -> [189: set_bias_profile] [B:check] (branches=2) + -> [190: _ast_get_code_outline] [B:check] (branches=0) + -> [191: render_path_field] [B:check] (branches=5) + -> [192: __init__] [B:check] (branches=2) + -> [193: py_get_imports_result] [B:check] (branches=13) + -> [194: search_files_result] [B:check] (branches=9) + -> [195: _handle_clear_ask] [B:check] (branches=1) + -> [196: _cb_unblock_ticket] [B:check] (branches=10) + -> [197: render_unindented] [B:check] (branches=0) + -> [198: set_file_slice] [B:check] (branches=1) + -> [199: from_dict] [B:check] (branches=0) + -> [200: click] [B:check] (branches=0) + -> [201: _handle_hide_patch_modal] [B:check] (branches=0) + -> [202: get_node_status] [B:check] (branches=1) + -> [203: emit] [B:check] (branches=2) + -> [204: run_powershell] [B:check] (branches=21) + -> [205: _serialize_for_api] [B:check] (branches=4) + -> [206: group_files_by_dir] [B:check] (branches=3) + -> [207: _api_post_api_session] [B:check] (branches=1) + -> [208: tree_node_ex] [B:check] (branches=0) + -> [209: _handle_ai_response] [B:check] (branches=12) + -> [210: web_search_result] [B:check] (branches=5) + -> [211: summarise_items] [B:is None?] (branches=3) [N:safe] + -> [212: handle_endtag] [B:check] (branches=5) + -> [213: get_preset_scope] [B:check] (branches=3) + -> [214: _save_file] [B:check] (branches=1) + -> [215: estimate_cost] [B:check] (branches=3) + -> [216: ts_c_get_code_outline_result] [B:check] (branches=5) + -> [217: get_conductor_dir] [B:check] (branches=2) + -> [218: _tone_map] [B:check] (branches=0) + -> [219: run_all_cross_audit_reads] [B:check] (branches=4) + -> [220: read_input_json] [B:check] (branches=5) + -> [221: push] [B:check] (branches=1) + -> [222: topological_sort] [B:check] (branches=3) + -> [223: list_directory] [B:check] (branches=1) + -> [224: _start_track_logic_result] [B:check] (branches=10) + -> [225: _ast_get_definition] [B:check] (branches=0) + -> [226: _count_gemini_tokens_for_stats_result] [B:is None?] (branches=4) [N:safe] + -> [227: _set_app_attr] [B:check] (branches=2) + -> [228: _confirm_and_run] [B:check] (branches=12) + -> [229: get_history] [B:check] (branches=1) + -> [230: file_origin_memory_dim] [B:check] (branches=3) + -> [231: update_auto_whitelist_status] [B:check] (branches=18) + -> [232: _offload_entry_payload] [B:check] (branches=10) + -> [233: _cb_block_ticket] [B:check] (branches=7) + -> [234: _api_get_key] [B:check] (branches=3) + -> [235: get_outline] [B:check] (branches=1) + -> [236: _update_gcli_adapter] [B:check] (branches=1) + -> [237: extract_colon_blocks] [B:check] (branches=1) + -> [238: _append_comms] [B:is None?] (branches=1) [N:safe] + -> [239: _on_open_link] [B:check] (branches=5) + -> [240: approve_task] [B:check] (branches=3) + -> [241: dispatch] [B:check] (branches=60) + -> [242: _push_state] [B:check] (branches=1) + -> [243: _search_mcp] [B:check] (branches=1) + -> [244: ts_cpp_update_definition] [B:check] (branches=1) + -> [245: log_cli_call] [B:is None?] (branches=3) [N:safe] + -> [246: get_file_summary] [B:check] (branches=1) + -> [247: py_update_definition] [B:check] (branches=1) + -> [248: parse_symbols] [B:check] (branches=0) + -> [249: py_set_signature] [B:check] (branches=1) + -> [250: get_syntax_palette_for_theme] [B:check] (branches=1) + -> [251: _ast_update_definition] [B:check] (branches=0) + -> [252: load_themes_from_dir] [B:check] (branches=6) + -> [253: __init__] [B:check] (branches=0) + -> [254: _dashscope_exception_from_response] [B:check] (branches=0) + -> [255: __init__] [B:is None?] (branches=0) [N:safe] + -> [256: from_dict] [B:check] (branches=0) + -> [257: render_tier_stream_panel] [B:is None?] (branches=16) [N:safe] + -> [258: _cb_create_track] [B:check] (branches=4) + -> [259: __exit__] [B:check] (branches=0) + -> [260: push_event] [B:check] (branches=0) + -> [261: _handle_show_patch_modal] [B:check] (branches=0) + -> [262: _read_file_content_result] [B:check] (branches=3) + -> [263: __init__] [B:check] (branches=0) + -> [264: get_editor] [B:check] (branches=1) + -> [265: _send_cli_round_result] [B:check] (branches=3) + -> [266: py_get_definition_result] [B:check] (branches=5) + -> [267: parse_json_tickets] [B:check] (branches=5) + -> [268: wait_for_project_switch] [B:is None?] (branches=8) [N:safe] + -> [269: deep_search] [B:check] (branches=7) + -> [270: run_worker_lifecycle] [B:check] (branches=60) + -> [271: render_code] [B:check] (branches=0) + -> [272: _run_tier4_analysis_result] [B:check] (branches=5) + -> [273: py_find_usages] [B:check] (branches=1) + -> [274: trigger_patch] [B:check] (branches=1) + -> [275: save_to_config] [B:check] (branches=1) + -> [276: from_dict] [B:is None?] (branches=2) [N:safe] + -> [277: reset_tone_mapping] [B:check] (branches=2) + -> [278: derive_code_path_result] [B:check] (branches=34) + -> [279: configure] [B:is None?] (branches=7) [N:safe] + -> [280: compute_decomposition_cost] [B:check] (branches=0) + -> [281: update] [B:check] (branches=0) + -> [282: _run_script] [B:is None?] (branches=3) [N:safe] + -> [283: mutate_dag] [B:is None?] (branches=8) [N:safe] + -> [284: flat_config] [B:check] (branches=2) + -> [285: _load_project_from_path_result] [B:check] (branches=2) + -> [286: __init__] [B:check] (branches=2) + -> [287: apply_patch_to_file] [B:check] (branches=14) + -> [288: reload] [B:check] (branches=4) + -> [289: load_track_state] [B:check] (branches=4) + -> [290: _execute] [B:check] (branches=3) + -> [291: _handle_right_click] [B:check] (branches=1) + -> [292: _handle_ticket_started] [B:check] (branches=8) + -> [293: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe] + -> [294: save_preset] [B:check] (branches=3) + -> [295: _do_project_switch] [B:check] (branches=9) + -> [296: cb_load_prior_log] [B:is None?] (branches=2) [N:safe] + -> [297: wait_for_event] [B:check] (branches=4) + -> [298: rag_emb_provider] [B:check] (branches=0) + -> [299: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe] + -> [300: deep_search] [B:check] (branches=7) + -> [301: _on_tool_log] [B:check] (branches=1) + -> [302: delete_documents_by_path] [B:check] (branches=3) + -> [303: _make_serializable] [B:check] (branches=5) + -> [304: compute_real_decomposition_cost] [B:check] (branches=7) + -> [305: get_git_diff] [B:check] (branches=1) + -> [306: _cb_ticket_skip] [B:check] (branches=2) + -> [307: migrate_from_legacy_config] [B:check] (branches=2) + -> [308: ui_file_paths] [B:check] (branches=0) + -> [309: _rename_discussion] [B:check] (branches=3) + -> [310: _tier_stream_scroll_sync_result] [B:check] (branches=3) + -> [311: py_get_signature] [B:check] (branches=1) + -> [312: py_get_var_declaration_result] [B:check] (branches=8) + -> [313: get_tree_result] [B:check] (branches=13) + -> [314: get] [B:check] (branches=0) + -> [315: __getattr__] [B:check] (branches=2) + -> [316: __init__] [B:is None?] (branches=1) [N:safe] + -> [317: __init__] [B:check] (branches=0) + -> [318: register_session] [B:check] (branches=2) + -> [319: create_temp_modified_file] [B:check] (branches=1) + -> [320: find_in_scope] [B:check] (branches=10) + -> [321: read_file] [B:check] (branches=1) + -> [322: detect_frequency_from_entry_point] [B:check] (branches=6) + -> [323: aggregate_cross_audit_findings] [B:is None?] (branches=2) [N:safe] + -> [324: log_tool_call] [B:is None?] (branches=8) [N:safe] + -> [325: _chunk_code_result] [B:check] (branches=4) + -> [326: generate_rationale] [B:check] (branches=0) + -> [327: py_get_hierarchy] [B:check] (branches=1) + -> [328: async_dispatch] [B:check] (branches=2) + -> [329: get_token_stats] [B:check] (branches=3) + -> [330: get_color] [B:check] (branches=7) + -> [331: set_provider] [B:check] (branches=7) + -> [332: _start_track_logic] [B:check] (branches=1) + -> [333: _handle_click] [B:check] (branches=9) + -> [334: render_ssdl_rollup] [B:check] (branches=5) + -> [335: compute_file_stats] [B:check] (branches=6) + -> [336: _record_success] [B:is None?] (branches=14) [N:safe] + -> [337: post_project] [B:check] (branches=0) + -> [338: get_file_hash] [B:check] (branches=0) + -> [339: parse_diff] [B:is None?] (branches=20) [N:safe] + -> [340: undo] [B:check] (branches=1) + -> [341: get_summary] [B:check] (branches=2) + -> [342: set_session_start_time] [B:check] (branches=2) + -> [343: send] [B:check] (branches=30) + -> [344: _truncate_tool_output] [B:check] (branches=2) + -> [345: _get_gemini_history_list] [B:check] (branches=4) + -> [346: _has_app_attr] [B:check] (branches=3) + -> [347: build_discussion_text] [B:check] (branches=1) + -> [348: set_base_system_prompt] [B:check] (branches=0) + -> [349: __init__] [B:is None?] (branches=0) [N:safe] + -> [350: spawn_mma_worker] [B:check] (branches=1) + -> [351: _safe_controller_result] [B:is None?] (branches=4) [N:safe] + -> [352: handle_data] [B:check] (branches=2) + -> [353: _render_code_block] [B:is None?] (branches=11) [N:safe] + -> [354: _set_context_files] [B:check] (branches=0) + -> [355: __init__] [B:check] (branches=2) + -> [356: _record_failure] [B:is None?] (branches=14) [N:safe] + -> [357: from_dict] [B:check] (branches=0) + -> [358: _normalize_path] [B:check] (branches=0) + -> [359: build_tier3_context] [B:check] (branches=50) + -> [360: _strip_cache_controls] [B:check] (branches=4) + -> [361: _resolve_log_ref] [B:is None?] (branches=6) [N:safe] + -> [362: ts_cpp_get_code_outline] [B:check] (branches=1) + -> [363: _ticket_id_max_int_result] [B:check] (branches=2) + -> [364: rag_mcp_tool] [B:check] (branches=1) + -> [365: _cb_delete_bias_profile] [B:check] (branches=0) + -> [366: walk] [B:check] (branches=23) + -> [367: __init__] [B:check] (branches=2) + -> [368: confirm_spawn] [B:is None?] (branches=6) [N:safe] + -> [369: _save_file] [B:check] (branches=3) + -> [370: _normalize_nested_list_endings] [B:check] (branches=6) + -> [371: _send_gemini_cli] [B:is None?] (branches=23) [N:safe] + -> [372: get_curated_view] [B:check] (branches=24) + -> [373: save_bias_profile] [B:check] (branches=1) + -> [374: get_value] [B:check] (branches=10) + -> [375: parse_ts] [B:check] (branches=2) + -> [376: edit_file_result] [B:check] (branches=10) + -> [377: _add_bleed_derived] [B:check] (branches=0) + -> [378: _file_to_aggregates] [B:check] (branches=4) + -> [379: rag_source] [B:check] (branches=0) + -> [380: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe] + -> [381: get] [B:check] (branches=2) + -> [382: __init__] [B:check] (branches=0) + -> [383: get_tracks_dir] [B:check] (branches=0) + -> [384: from_dict] [B:check] (branches=4) + -> [385: build_diff_command] [B:check] (branches=0) + -> [386: _handle_set_ai_status] [B:check] (branches=0) + -> [387: resolve_paths] [B:check] (branches=4) + -> [388: clutch_callback] [B:check] (branches=5) + -> [389: call_tool] [B:check] (branches=2) + -> [390: _get_file_mtime_result] [B:check] (branches=2) + -> [391: _send_deepseek] [B:check] (branches=71) + -> [392: _analyze_function_field_accesses] [B:check] (branches=17) + -> [393: _get_app_attr] [B:check] (branches=3) + -> [394: py_get_definition] [B:check] (branches=1) + -> [395: save_preset] [B:check] (branches=1) + -> [396: find_enclosing_function] [B:check] (branches=2) + -> [397: edit_file] [B:check] (branches=1) + -> [398: count_tokens] [B:check] (branches=0) + -> [399: _record_startup_timeline_error] [B:check] (branches=1) + -> [400: parse_hunk_header] [B:check] (branches=2) + -> [401: _on_api_event] [B:check] (branches=2) + -> [402: from_dict] [B:check] (branches=0) + -> [403: __init__] [B:check] (branches=2) + -> [404: _cb_new_project_automated] [B:check] (branches=2) + -> [405: get_file_slice_result] [B:check] (branches=5) + -> [406: kill_worker] [B:check] (branches=4) + -> [407: _is_table_at] [B:check] (branches=2) + -> [408: parse_history_entries] [B:check] (branches=10) + -> [409: resolve_slice] [B:check] (branches=18) + -> [410: classify_dashscope_error] [B:check] (branches=5) + -> [411: delete_preset] [B:check] (branches=2) + -> [412: delete_profile] [B:check] (branches=2) + -> [413: _classify_openai_compatible_error] [B:check] (branches=10) + -> [414: get_capabilities] [B:check] (branches=2) + -> [415: default_project] [B:check] (branches=0) + -> [416: update_task_status] [B:check] (branches=1) + -> [417: derive_code_path] [B:check] (branches=1) + -> [418: get_line_color] [B:check] (branches=3) + -> [419: get_context] [B:check] (branches=3) + -> [420: _rag_search_result] [B:check] (branches=5) + -> [421: get_role_tint] [B:check] (branches=0) + -> [422: kill_mma_worker] [B:check] (branches=1) + -> [423: fuzzy_match] [B:check] (branches=2) + -> [424: _compute_score] [B:check] (branches=3) + -> [425: _summarise_markdown] [B:check] (branches=3) + -> [426: from_dict] [B:check] (branches=0) + -> [427: __init__] [B:check] (branches=0) + -> [428: start_services] [B:check] (branches=0) + -> [429: search] [B:check] (branches=8) + -> [430: __getattr__] [B:check] (branches=0) + -> [431: set_project_context_marker] [B:check] (branches=0) + -> [432: __getattr__] [B:check] (branches=0) + -> [433: _chunk_text] [B:check] (branches=0) + -> [434: _cb_save_view_preset] [B:check] (branches=2) + -> [435: _api_post_gui] [B:check] (branches=0) + -> [436: _cb_delete_workspace_profile] [B:check] (branches=2) + -> [437: _capture_workspace_profile] [B:check] (branches=3) + -> [438: _extract_tool_name] [B:check] (branches=13) + -> [439: _symbol_resolution_result] [B:check] (branches=4) + -> [440: __init__] [B:check] (branches=0) + -> [441: is_session_whitelisted] [B:is None?] (branches=1) [N:safe] + -> [442: _cb_delete_view_preset] [B:check] (branches=0) + -> [443: py_get_class_summary] [B:check] (branches=1) + -> [444: delete_preset] [B:check] (branches=3) + -> [445: walk] [B:check] (branches=23) + -> [446: approve_mma_ticket] [B:check] (branches=1) + -> [447: render_palette_modal] [B:check] (branches=22) + -> [448: render_heavy_text] [B:check] (branches=8) + -> [449: from_dict] [B:check] (branches=0) + -> [450: py_get_imports] [B:check] (branches=1) + -> [451: get_definition] [B:check] (branches=42) + -> [452: _extract_dashscope_tool_calls] [B:check] (branches=4) + -> [453: parse] [B:check] (branches=0) + -> [454: py_set_var_declaration_result] [B:check] (branches=8) + -> [455: from_dict] [B:check] (branches=0) + -> [456: phase] [B:check] (branches=3) + -> [457: _send_qwen] [B:check] (branches=9) + -> [458: update_bead] [B:check] (branches=2) + -> [459: from_dict] [B:check] (branches=0) + -> [460: _simulate_save_preset] [B:check] (branches=0) + -> [461: py_get_code_outline] [B:check] (branches=1) + -> [462: with_scope] [B:check] (branches=0) + -> [463: style_color] [B:check] (branches=0) + -> [464: render_post_fx] [B:check] (branches=0) + -> [465: get_api_key] [B:check] (branches=0) + -> [466: post_project] [B:check] (branches=0) + -> [467: _add_history_cache_breakpoint] [B:check] (branches=5) + -> [468: _execute_tool_calls_concurrently] [B:check] (branches=10) + -> [469: build_screenshots_section] [B:check] (branches=6) + -> [470: build_cross_audit_findings_for_aggregate] [B:check] (branches=7) + -> [471: _parse_tool_args_result] [B:check] (branches=2) + -> [472: set_gamma] [B:check] (branches=0) + -> [473: get_session] [B:check] (branches=0) + -> [474: _send_grok] [B:check] (branches=14) + -> [475: ts_c_get_skeleton_result] [B:check] (branches=5) + -> [476: set_brightness] [B:check] (branches=0) + -> [477: analyze_consumer_fields] [B:check] (branches=10) + -> [478: _cb_save_persona] [B:check] (branches=0) + -> [479: _save_fallback_project_result] [B:check] (branches=3) + -> [480: _handle_select_list_item] [B:check] (branches=2) + -> [481: _fetch_models] [B:check] (branches=11) + -> [482: strip_h1] [B:check] (branches=2) + -> [483: index_file] [B:check] (branches=13) + -> [484: _list_deepseek_models] [B:check] (branches=0) + -> [485: send_openai_compatible] [B:is None?] (branches=5) [N:safe] + -> [486: py_get_signature_result] [B:check] (branches=10) + -> [487: embed] [B:check] (branches=0) + -> [488: detect_language] [B:check] (branches=8) + -> [489: detect_nil_check_pattern] [B:is None?] (branches=11) [N:safe] + -> [490: run_subagent_summarization] [B:check] (branches=11) + -> [491: _handle_set_comms_dirty] [B:check] (branches=0) + -> [492: restore_state] [B:check] (branches=1) + -> [493: branch_discussion] [B:check] (branches=3) + -> [494: _handle_mma_spawn_approval] [B:check] (branches=8) + -> [495: apply_patch] [B:check] (branches=1) + -> [496: build_pcg] [B:check] (branches=12) + -> [497: list_models_for_vendor] [B:check] (branches=1) + -> [498: ollama_chat] [B:check] (branches=3) + -> [499: _test_callback_func_write_to_file] [B:check] (branches=1) + -> [500: _on_warmup_complete_callback] [B:is None?] (branches=5) [N:safe] + -> [501: _on_warmup_complete_callback_result] [B:check] (branches=6) + -> [502: from_dict] [B:check] (branches=0) + -> [503: __init__] [B:check] (branches=2) + -> [504: render_organization_deductions] [B:check] (branches=19) + -> [505: run_discussion_compression] [B:check] (branches=14) + -> [506: _split_row] [B:check] (branches=2) + -> [507: py_check_syntax] [B:check] (branches=1) + -> [508: mark_manual_block] [B:check] (branches=0) + -> [509: handle_starttag] [B:check] (branches=6) + -> [510: from_dict] [B:check] (branches=0) + -> [511: _cb_load_track] [B:check] (branches=2) + -> [512: launch_editor] [B:check] (branches=3) + -> [513: reset_session] [B:check] (branches=0) + -> [514: __getattr__] [B:check] (branches=4) + -> [515: _report_worker_error] [B:check] (branches=2) + -> [516: dominant_pattern] [B:check] (branches=2) + -> [517: _render_ast_inspector_outline_result] [B:check] (branches=6) + -> [518: __init__] [B:check] (branches=2) + -> [519: _clean_nones] [B:is None?] (branches=2) [N:safe] + -> [520: log_message] [B:check] (branches=0) + -> [521: _strip_private_keys] [B:check] (branches=0) + -> [522: _trim_anthropic_history] [B:check] (branches=13) + -> [523: _resolve_aliases] [B:is None?] (branches=7) [N:safe] + -> [524: _count_tokens] [B:check] (branches=0) + -> [525: save_preset] [B:check] (branches=1) + -> [526: _build_chunked_context_blocks] [B:check] (branches=2) + -> [527: py_get_docstring] [B:check] (branches=1) + -> [528: _classify_gemini_error] [B:check] (branches=21) + -> [529: find_next_increment] [B:check] (branches=3) + -> [530: code_path_audit_v2] [B:check] (branches=1) + -> [531: __init__] [B:is None?] (branches=0) [N:safe] + -> [532: current_provider] [B:check] (branches=0) + -> [533: py_get_class_summary_result] [B:check] (branches=10) + -> [534: analyze_producer_size] [B:is None?] (branches=21) [N:safe] + -> [535: _fire_callback] [B:check] (branches=3) + -> [536: _list_models_for_provider_result] [B:check] (branches=2) + -> [537: load_context_preset] [B:check] (branches=1) + -> [538: log_comms] [B:is None?] (branches=3) [N:safe] + -> [539: async_dispatch] [B:check] (branches=2) + -> [540: _api_get_session] [B:check] (branches=1) + -> [541: truncate_entries] [B:check] (branches=4) + -> [542: _get_symbol_node] [B:check] (branches=12) + -> [543: ts_cpp_update_definition_result] [B:check] (branches=6) + -> [544: map_finding_to_aggregates] [B:is None?] (branches=1) [N:safe] + -> [545: _set_external_editor_default] [B:check] (branches=2) + -> [546: set_value] [B:check] (branches=0) + -> [547: from_dict] [B:check] (branches=0) + -> [548: ts_cpp_get_definition] [B:check] (branches=1) + -> [549: _send_minimax] [B:check] (branches=11) + -> [550: set_agent_tools] [B:check] (branches=0) + -> [551: _on_warmup_complete_for_timeline] [B:check] (branches=0) + -> [552: rag_collection_name] [B:check] (branches=0) + -> [553: get_text_value] [B:is None?] (branches=0) [N:safe] + -> [554: _cb_save_workspace_profile] [B:check] (branches=2) + -> [555: mcp_config_json] [B:check] (branches=0) + -> [556: generate_tracks] [B:check] (branches=11) + -> [557: deep_search] [B:check] (branches=7) + -> [558: run_tier4_patch_callback] [B:check] (branches=0) + -> [559: render_selectable_label] [B:check] (branches=6) + -> [560: set_tool_preset] [B:check] (branches=2) + -> [561: post_gui] [B:check] (branches=0) + -> [562: _invalidate_token_estimate] [B:check] (branches=0) + -> [563: __init__] [B:check] (branches=2) + -> [564: select_list_item] [B:check] (branches=0) + -> [565: popup_modal] [B:check] (branches=0) + -> [566: _handle_set_value] [B:check] (branches=6) + -> [567: _on_ai_stream] [B:is None?] (branches=5) [N:safe] + -> [568: __init__] [B:check] (branches=0) + -> [569: _log_canary] [B:is None?] (branches=7) [N:safe] + -> [570: _save_context_preset_force] [B:check] (branches=2) + -> [571: classify_memory_dim] [B:check] (branches=2) + -> [572: _get_avg] [B:check] (branches=3) + -> [573: P2_pass] [B:is None?] (branches=6) [N:safe] + -> [574: get_brightness] [B:check] (branches=0) + -> [575: _add_to_history] [B:check] (branches=3) + -> [576: __init__] [B:check] (branches=0) + -> [577: _spawn_worker] [B:check] (branches=3) + -> [578: run_audit] [B:check] (branches=4) + -> [579: post_api_session] [B:check] (branches=0) + -> [580: build_discussion_section] [B:check] (branches=2) + -> [581: render_ssdl_sketch] [B:check] (branches=4) + -> [582: embed] [B:check] (branches=0) + -> [583: _cb_kill_ticket] [B:check] (branches=3) + -> [584: _on_performance_alert] [B:check] (branches=0) + -> [585: update_session_metadata] [B:check] (branches=1) + -> [586: _handle_mma_stream] [B:check] (branches=4) + -> [587: confirm_execution] [B:is None?] (branches=3) [N:safe] + -> [588: _cb_load_workspace_profile] [B:check] (branches=3) + -> [589: child] [B:check] (branches=0) + -> [590: ts_cpp_get_skeleton] [B:check] (branches=1) + -> [591: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe] + -> [592: mark_blocked] [B:check] (branches=0) + -> [593: reload_all] [B:check] (branches=2) + -> [594: log_api_hook] [B:is None?] (branches=3) [N:safe] + -> [595: request_patch_approval] [B:check] (branches=0) + -> [596: get_symbol_definition] [B:check] (branches=2) + -> [597: run_tier4_analysis] [B:check] (branches=0) + -> [598: _field_names_for_aggregate] [B:check] (branches=1) + -> [599: _send_llama_native] [B:check] (branches=12) + -> [600: get_history] [B:check] (branches=3) + -> [601: build_markdown_no_history] [B:check] (branches=0) + -> [602: save_track_state] [B:check] (branches=1) + -> [603: _try_warm_sdk_result] [B:check] (branches=2) + -> [604: apply_syntax_palette] [B:is None?] (branches=2) [N:safe] + -> [605: _set_app_attr] [B:check] (branches=2) + -> [606: list_directory_result] [B:check] (branches=9) + -> [607: delete_preset] [B:check] (branches=2) + -> [608: __init__] [B:check] (branches=0) + -> [609: save_track_history] [B:check] (branches=1) + -> [610: _handle_set_tool_log_dirty] [B:check] (branches=0) + -> [611: generate_audit_report] [B:check] (branches=13) + -> [612: _drain_normalize_errors] [B:is None?] (branches=6) [N:safe] + -> [613: _run_tier4_patch_callback_result] [B:check] (branches=6) + -> [614: _append_tool_log] [B:check] (branches=6) + -> [615: embed] [B:check] (branches=0) + -> [616: aggregate_pattern_from_consumers] [B:check] (branches=7) + -> [617: add_producer] [B:check] (branches=0) + -> [618: save_project] [B:is None?] (branches=7) [N:safe] + -> [619: ai_status] [B:check] (branches=0) + -> [620: web_search] [B:check] (branches=1) + -> [621: _is_contiguous] [B:check] (branches=0) + -> [622: P3_pass] [B:check] (branches=10) + -> [623: _handle_mma_step_approval] [B:check] (branches=6) + -> [624: ts_cpp_get_skeleton_result] [B:check] (branches=5) + -> [625: _strip_stale_file_refreshes] [B:check] (branches=12) + -> [626: ts_c_update_definition] [B:check] (branches=1) + -> [627: build_markdown] [B:check] (branches=0) + -> [628: _set_minimax_provider_result] [B:check] (branches=2) + -> [629: current_model] [B:check] (branches=0) + -> [630: _should_cache_gemini_result] [B:is None?] (branches=5) [N:safe] + -> [631: _render_ast_inspector_file_content_result] [B:check] (branches=2) + -> [632: build_markdown_from_items] [B:check] (branches=9) + -> [633: table] [B:check] (branches=0) + -> [634: get_code_outline] [B:is None?] (branches=8) [N:safe] + -> [635: render] [B:check] (branches=0) + -> [636: py_set_var_declaration] [B:check] (branches=1) + -> [637: _dashscope_call] [B:check] (branches=5) + -> [638: request_patch_from_tier4] [B:check] (branches=2) + -> [639: ts_c_get_code_outline] [B:check] (branches=1) + -> [640: _chunk_text] [B:check] (branches=3) + -> [641: _apply_preset] [B:check] (branches=4) + -> [642: is_absolute_with_drive] [B:check] (branches=2) + -> [643: _handle_ask] [B:check] (branches=0) + -> [644: get_file_slice] [B:check] (branches=1) + -> [645: rag_mcp_server] [B:check] (branches=1) + -> [646: estimate_call_frequency] [B:check] (branches=2) + -> [647: _log_phase_output] [B:check] (branches=2) + -> [648: set_summary] [B:check] (branches=2) + -> [649: ts_cpp_get_signature] [B:check] (branches=1) + -> [650: _get_path] [B:check] (branches=3) + -> [651: __init__] [B:check] (branches=2) + -> [652: _cb_start_track] [B:check] (branches=13) + -> [653: get_contrast] [B:check] (branches=0) + -> [654: right_click] [B:check] (branches=0) + -> [655: _extract_gemini_thoughts_result] [B:is None?] (branches=9) [N:safe] + -> [656: _classify_deepseek_error] [B:is None?] (branches=21) [N:safe] + -> [657: save_persona] [B:check] (branches=1) + -> [658: spawn] [B:check] (branches=6) + -> [659: _ast_get_signature] [B:check] (branches=0) + -> [660: add_consumer] [B:check] (branches=0) + -> [661: load_from_config] [B:check] (branches=1) + -> [662: generate_tickets] [B:check] (branches=12) + -> [663: _test_callback_func_write_to_file] [B:check] (branches=1) + -> [664: put] [B:check] (branches=3) + -> [665: render] [B:check] (branches=0) + -> [666: compute_effective_codepaths] [B:check] (branches=2) + -> [667: from_dict] [B:check] (branches=0) + -> [668: _write_raw] [B:check] (branches=1) + -> [669: _send_anthropic] [B:is None?] (branches=40) [N:safe] + -> [670: _init_ai_and_hooks] [B:check] (branches=2) + -> [671: __getitem__] [B:is None?] (branches=4) [N:safe] + -> [672: clean_nones] [B:is None?] (branches=2) [N:safe] + -> [673: _estimate_prompt_tokens] [B:check] (branches=2) + -> [674: mma_status] [B:check] (branches=0) + -> [675: get_file_summary_result] [B:check] (branches=6) + -> [676: set_contrast] [B:check] (branches=0) + -> [677: get_tool_spec] [B:check] (branches=1) + -> [678: on] [B:check] (branches=1) + -> [679: compute_real_type_alias_coverage] [B:check] (branches=6) + -> [680: py_find_usages_result] [B:check] (branches=19) + -> [681: request_patch_from_tier4_result] [B:check] (branches=6) + -> [682: apply] [B:check] (branches=10) + -> [683: _delete_discussion] [B:check] (branches=3) + -> [684: search_files] [B:check] (branches=1) + -> [685: inject_context] [B:check] (branches=1) + -> [686: __init__] [B:check] (branches=4) + -> [687: ts_c_get_signature] [B:check] (branches=1) + -> [688: _get_mtime_safe] [B:is None?] (branches=3) [N:safe] + -> [689: py_get_var_declaration] [B:check] (branches=1) + -> [690: worker_comms_callback] [B:check] (branches=7) + -> [691: register] [B:check] (branches=2) + -> [692: walk] [B:check] (branches=23) + -> [693: _parse_search_response_result] [B:check] (branches=5) + -> [694: parse_thinking_trace] [B:check] (branches=1) + -> [695: _require_warmed] [B:is None?] (branches=1) [N:safe] + -> [696: _handle_refresh_api_metrics] [B:check] (branches=1) + -> [697: _write_beads] [B:check] (branches=0) + -> [698: __init__] [B:check] (branches=2) + -> [699: __init__] [B:check] (branches=0) + -> [700: ts_cpp_get_code_outline_result] [B:check] (branches=5) + -> [701: get_indicator_state] [B:check] (branches=0) + -> [702: render_discussion_entry_read_mode] [B:check] (branches=18) + -> [703: list_models] [B:check] (branches=8) + -> [704: analyze_consumer_pattern] [B:check] (branches=3) + -> [705: _list_gemini_models_result] [B:check] (branches=7) + -> [706: from_dict] [B:check] (branches=0) + -> [707: py_get_skeleton_result] [B:check] (branches=5) + -> [708: _parse_token_history_first_ts_result] [B:check] (branches=40) + -> [709: get_track_state_dir] [B:check] (branches=0) + -> [710: ts_cpp_get_signature_result] [B:check] (branches=5) + -> [711: _handle_show_track_proposal] [B:check] (branches=0) + -> [712: handle_starttag] [B:check] (branches=6) + -> [713: log_tool_output] [B:is None?] (branches=4) [N:safe] + -> [714: _repair_anthropic_history] [B:check] (branches=6) + -> [715: from_dict] [B:check] (branches=0) + -> [716: _create_gemini_cache_result] [B:check] (branches=3) + -> [717: detect_access_pattern] [B:is None?] (branches=5) [N:safe] + -> [718: _toggle_attr] [B:check] (branches=2) + -> [719: set_vendor_quota] [B:check] (branches=0) + -> [720: _cb_delete_persona] [B:check] (branches=0) + -> [721: update_usage] [B:check] (branches=2) + -> [722: get_archive_dir] [B:check] (branches=0) + -> [723: _set_tool_preset_result] [B:check] (branches=7) + -> [724: _extract_minimax_reasoning] [B:check] (branches=5) + -> [725: _resolve_font_path_result] [B:check] (branches=7) + -> [726: _send_streaming] [B:is None?] (branches=19) [N:safe] + -> [727: load_track_history] [B:check] (branches=3) + -> [728: _pre_dispatch] [B:check] (branches=8) + -> [729: _save_file] [B:check] (branches=1) + -> [730: _send_gemini] [B:is None?] (branches=75) [N:safe] + -> [731: mutate_mma_dag] [B:check] (branches=1) + -> [732: _on_sigint] [B:check] (branches=1) + -> [733: _deserialize_active_track_result] [B:check] (branches=3) + -> [734: load_context_preset] [B:check] (branches=3) + -> [735: _create_discussion] [B:check] (branches=2) + -> [736: _trim_minimax_history] [B:check] (branches=8) + -> [737: get_persona_scope] [B:check] (branches=3) + -> [738: resolve_pending_action] [B:check] (branches=6) + -> [739: _handle_mma_respond] [B:is None?] (branches=9) [N:safe] + -> [740: _populate_auto_slices_outline_result] [B:check] (branches=5) + -> [741: read_file_result] [B:check] (branches=6) + -> [742: jump_to_undo] [B:check] (branches=3) + -> [743: build_dashscope_tools] [B:check] (branches=2) + -> [744: _normalize_bullet_delimiters] [B:check] (branches=0) + -> [745: delete_session] [B:check] (branches=0) + -> [746: _handle_refresh_from_project] [B:check] (branches=0) + -> [747: __setattr__] [B:check] (branches=3) + -> [748: suggest_defusing_technique] [B:check] (branches=4) + -> [749: popup] [B:check] (branches=0) + -> [750: _execute_gui_task_result] [B:check] (branches=6) + -> [751: _summarise_toml] [B:check] (branches=8) + -> [T:done] +``` + +**Effective codepaths:** 40142494212284116873789 (sum of 2^branches across 751 consumers) +**Total branch points:** 3452 +**Nil-check functions:** 74 + +**Defusing opportunities:** + +- **Nil Sentinel `[N]`**: Introduce a module-level `NIL_` sentinel whose field accesses return safe defaults. Replace None checks with the sentinel. Collapses 2^branch_count into ~1. + - Effective codepaths: 40142494212284116873789 -> 40142494212284116873641 +- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `metadata_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 137 field-check branches to 1 cache lookup. + - Effective codepaths: 40142494212284116873789 -> 137 +- **Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`**: Wrap the aggregate in a generational handle (index + generation). Validation is one comparison; mismatch returns the nil sentinel. Reduces N lifetime branches to 1 handle validation + sentinel return. + - Effective codepaths: 40142494212284116873789 -> 751 + + +## Frequency + +**Dominant frequency:** per_turn +**Evidence count:** 5 + +**Per-function frequency distribution:** + +- `per_turn`: 5 functions + +## Result coverage + +**Summary:** 453 producers, 696 consumers + +| metric | value | +|---|---| +| total producers | 453 | +| result producers | 453 | +| total consumers | 696 | +| result consumers | 0 | + +## Type alias coverage + +**Summary:** 137 sites; 0 typed (0%); 137 untyped (100%) + +| metric | value | +|---|---| +| total field-access sites | 137 | +| typed sites (canonical field) | 0 | +| untyped sites (wildcard) | 137 | + +## Cross-audit findings + +| bucket | audit script | site count | example file | example line | note | +|---|---|---|---|---|---| +| optional_in_baseline | `audit_optional_in_3_files` | 79 | `src\mcp_client.py` | 1285 | 79 sites | + +## Decomposition cost + +**Current cost estimate:** 720 us/turn +**Componentize savings:** 0 us/turn +**Unify savings:** 0 us/turn +**Recommended direction:** hold +**Rationale:** Metadata: access_pattern=whole_struct, frequency=per_turn, struct_field_count=10, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. +**Struct field count (estimated):** 10 +**Struct frozen:** True + +## Struct shape (inferred from producer returns) + +| field | access count | access pattern | +|---|---|---| +| `get` | 6 | hot | +| `engine` | 3 | hot | +| `content` | 3 | hot | +| `marker` | 3 | hot | +| `files` | 3 | hot | +| `encode` | 3 | hot | +| `get_cached_tree` | 3 | hot | +| `_get_path` | 3 | hot | +| `_id` | 2 | used | +| `_flags` | 2 | used | +| `_size` | 2 | used | +| `collection` | 2 | used | +| `project_root` | 2 | used | +| `_dirty` | 2 | used | +| `show_windows` | 2 | used | +| `active_project_root` | 2 | used | +| `_load_file` | 2 | used | +| `_save_file` | 2 | used | +| `active_track` | 2 | used | +| `startswith` | 1 | used | +| `_ready_tasks` | 1 | used | +| `_push_state` | 1 | used | +| `track` | 1 | used | +| `_pause_event` | 1 | used | +| `pool` | 1 | used | +| `_abort_events` | 1 | used | +| `event_queue` | 1 | used | +| `_workers_lock` | 1 | used | +| `_active_workers` | 1 | used | +| `tier_usage` | 1 | used | +| `embedding_provider` | 1 | used | +| `config` | 1 | used | +| `_report_worker_error` | 1 | used | +| `ui_active_context_preset` | 1 | used | +| `controller` | 1 | used | +| `enabled` | 1 | used | +| `_lock` | 1 | used | +| `_component_starts` | 1 | used | +| `_mma_status` | 1 | used | +| `split` | 1 | used | +| `_drag_actions` | 1 | used | +| `_get_name` | 1 | used | +| `_refresh_from_project` | 1 | used | +| `text_viewer_type` | 1 | used | +| `text_viewer_title` | 1 | used | +| `text_viewer_content` | 1 | used | +| `splitlines` | 1 | used | +| `suffix` | 1 | used | +| `name` | 1 | used | +| `to_dict` | 1 | used | +| `tasks` | 1 | used | +| `ai_status` | 1 | used | +| `_load_active_tickets` | 1 | used | +| `_disc_entries_lock` | 1 | used | +| `_recalculate_session_usage` | 1 | used | +| `metadata` | 1 | used | +| `disc_entries` | 1 | used | +| `disc_roles` | 1 | used | +| `_read_raw` | 1 | used | +| `_write_raw` | 1 | used | +| `output` | 1 | used | +| `append` | 1 | used | +| `language_name` | 1 | used | +| `_current_provider` | 1 | used | +| `engines` | 1 | used | +| `_predefined_callbacks` | 1 | used | + +## Optimization candidates + +_(no optimization candidates generated)_ + +## Verdict + +Metadata: access_pattern=whole_struct, frequency=per_turn, struct_field_count=10, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. + +## Evidence appendix + +### Access pattern evidence + +| function | pattern | field_accesses | confidence | +|---|---|---|---| +| `src.command_palette._starts_at_word_boundary` | `whole_struct` | `startswith`=1 | high | +| `src.multi_agent_conductor.run` | `field_by_field` | `_ready_tasks`=2, `_push_state`=7, `track`=4, `_pause_event`=1, `engine`=2, `pool`=4, `_abort_events`=1, `event_queue`=2, `_workers_lock`=1, `_active_workers`=1 (+1 more) | high | +| `src.imgui_scopes.__init__` | `field_by_field` | `_id`=1, `_flags`=1, `_size`=2 | high | +| `src.rag_engine.add_documents` | `field_by_field` | `collection`=2, `embedding_provider`=1, `config`=1 | high | +| `src.app_controller._topological_sort_tickets_result` | `whole_struct` | `_report_worker_error`=1 | high | +| `src.gui_2.delete_context_preset` | `mixed` | `ui_active_context_preset`=1, `controller`=1 | high | +| `src.imgui_scopes.__init__` | `field_by_field` | `_id`=1, `_flags`=1, `_size`=2 | high | +| `src.tool_presets._get_path` | `whole_struct` | `project_root`=2 | high | +| `src.personas._get_path` | `whole_struct` | `project_root`=2 | high | +| `src.markdown_helper.render_code` | `whole_struct` | | low | +| `src.mcp_client.py_get_symbol_info` | `whole_struct` | | low | +| `src.project_manager.format_discussion` | `whole_struct` | | low | +| `src.theme_2.get_gamma` | `whole_struct` | | low | +| `src.performance_monitor.start_component` | `field_by_field` | `enabled`=1, `_lock`=1, `_component_starts`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.context_presets.load_all` | `whole_struct` | `get`=1 | high | +| `src.imgui_scopes.id` | `whole_struct` | | low | +| `src.code_path_audit_analysis.estimate_struct_size` | `whole_struct` | | low | +| `src.app_controller._handle_set_mma_status` | `mixed` | `_mma_status`=1, `get`=2 | high | +| `src.mcp_client.ts_c_get_definition_result` | `whole_struct` | | low | +| `src.rag_engine._check_existing_index_result` | `whole_struct` | `collection`=1 | high | +| `src.markdown_helper._normalize_list_continuations` | `whole_struct` | `split`=1 | high | +| `src.multi_agent_conductor.update_task_status` | `mixed` | `_dirty`=1, `engine`=1 | high | +| `src.multi_agent_conductor.approve_task` | `mixed` | `_dirty`=1, `engine`=1 | high | +| `src.app_controller.ui_file_paths` | `whole_struct` | `files`=1 | high | +| `src.markdown_helper._is_likely_lang_tag` | `whole_struct` | | low | +| `src.app_controller._handle_drag` | `mixed` | `get`=2, `_drag_actions`=2 | high | +| `src.gui_2._render_window_if_open` | `whole_struct` | `show_windows`=3 | high | +| `src.file_cache.update_definition` | `field_by_field` | `encode`=1, `get_cached_tree`=1, `_get_name`=2 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.app_controller.inject_context` | `field_by_field` | `get`=1, `active_project_root`=1, `_refresh_from_project`=1, `files`=2 | high | +| `src.gui_2.render_text_viewer` | `field_by_field` | `text_viewer_type`=1, `text_viewer_title`=1, `text_viewer_content`=1, `show_windows`=1 | high | +| `src.summarize._summarise_generic` | `mixed` | `splitlines`=1, `suffix`=1 | high | +| `src.workspace_manager.save_profile` | `field_by_field` | `_get_path`=1, `_load_file`=1, `name`=1, `to_dict`=1, `_save_file`=1 | high | +| `src.imgui_scopes.menu` | `whole_struct` | | low | +| `src.app_controller._api_delete_session` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.app_controller._cb_load_track_result` | `field_by_field` | `tasks`=1, `active_track`=1, `ai_status`=1, `_load_active_tickets`=1, `active_project_root`=1, `_disc_entries_lock`=1, `_recalculate_session_usage`=1, `metadata`=3, `disc_entries`=2, `disc_roles`=1 | high | +| `src.tool_presets.delete_bias_profile` | `field_by_field` | `_get_path`=1, `_read_raw`=1, `_write_raw`=1 | high | +| `src.aggregate.run` | `field_by_field` | `output`=1, `files`=2, `get`=7 | high | +| `src.app_controller.confirm_action` | `whole_struct` | | low | +| `src.ai_client._repair_minimax_history` | `whole_struct` | `append`=1 | high | +| `src.file_cache.get_skeleton` | `field_by_field` | `encode`=1, `get_cached_tree`=1, `language_name`=1 | high | +| `src.hot_reloader.capture_state` | `whole_struct` | | low | +| `src.app_controller.current_provider` | `whole_struct` | `_current_provider`=1 | high | +| `src.app_controller.kill_worker` | `mixed` | `engines`=1, `active_track`=2 | high | +| `src.mcp_client.get_git_diff_result` | `whole_struct` | | low | +| `src.personas.delete_persona` | `field_by_field` | `_get_path`=1, `_load_file`=1, `_save_file`=1 | high | +| `src.file_cache.get_targeted_view` | `mixed` | `encode`=1, `get_cached_tree`=1 | high | +| `src.app_controller._handle_custom_callback` | `mixed` | `get`=2, `_predefined_callbacks`=2 | high | + +### Frequency evidence + +| function | frequency | source | note | +|---|---|---|---| +| `src.code_path_audit_ssdl.render_ssdl_rollup` | `per_turn` | `static_analysis` | producer from src\code_path_audit_ssdl.py | +| `src.aggregate.compute_file_stats` | `per_turn` | `static_analysis` | producer from src\aggregate.py | +| `src.api_hook_client.post_project` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py | +| `src.summary_cache.get_summary` | `per_turn` | `static_analysis` | producer from src\summary_cache.py | +| `src.code_path_audit.load_frequency_overrides` | `per_turn` | `static_analysis` | producer from src\code_path_audit.py | diff --git a/docs/reports/code_path_audit/2026-06-24/aggregates/ProviderHistory.md b/docs/reports/code_path_audit/2026-06-24/aggregates/ProviderHistory.md new file mode 100644 index 00000000..015c8a04 --- /dev/null +++ b/docs/reports/code_path_audit/2026-06-24/aggregates/ProviderHistory.md @@ -0,0 +1,92 @@ +# Aggregate Profile: ProviderHistory + +**Aggregate kind:** candidate_dataclass +**Memory dim:** unknown +**Is candidate:** True + +## Pipeline summary + +- Producers: 0 +- Consumers: 0 +- Distinct producer fqnames: 0 +- Distinct consumer fqnames: 0 +- Access pattern (aggregate): mixed +- Frequency (aggregate): unknown +- Decomposition direction: insufficient_data +- Struct field count (estimated): 0 + +## Producers (0) + +_(none)_ + +## Consumers (0) + +_(none)_ + +## Field access matrix + +_(no field accesses detected)_ + +## Access pattern + +**Dominant pattern:** mixed +**Evidence count:** 0 + +## SSDL Sketch for ProviderHistory + +_(placeholder; candidate aggregate)_ + + +## Frequency + +**Dominant frequency:** unknown +**Evidence count:** 0 + +## Result coverage + +**Summary:** + +| metric | value | +|---|---| +| total producers | 0 | +| result producers | 0 | +| total consumers | 0 | +| result consumers | 0 | + +## Type alias coverage + +**Summary:** + +| metric | value | +|---|---| +| total field-access sites | 0 | +| typed sites (canonical field) | 0 | +| untyped sites (wildcard) | 0 | + +## Cross-audit findings + +_(no cross-audit findings mapped to this aggregate)_ + +## Decomposition cost + +**Current cost estimate:** 0 us/turn +**Componentize savings:** 0 us/turn +**Unify savings:** 0 us/turn +**Recommended direction:** insufficient_data +**Rationale:** candidate aggregate; would be detected after any_type_componentization_20260621 merges +**Struct field count (estimated):** 0 +**Struct frozen:** False + +## Struct shape (inferred from producer returns) + +_(no producers; cannot infer shape)_ + +## Optimization candidates + +_(no optimization candidates generated)_ + +## Verdict + +candidate aggregate; would be detected after any_type_componentization_20260621 merges + +## Evidence appendix diff --git a/docs/reports/code_path_audit/2026-06-24/aggregates/Result.md b/docs/reports/code_path_audit/2026-06-24/aggregates/Result.md new file mode 100644 index 00000000..9e90aea0 --- /dev/null +++ b/docs/reports/code_path_audit/2026-06-24/aggregates/Result.md @@ -0,0 +1,104 @@ +# Aggregate Profile: Result + +**Aggregate kind:** typealias +**Memory dim:** control +**Is candidate:** False + +## Pipeline summary + +- Producers: 0 +- Consumers: 0 +- Distinct producer fqnames: 0 +- Distinct consumer fqnames: 0 +- Access pattern (aggregate): mixed +- Frequency (aggregate): per_turn +- Decomposition direction: insufficient_data +- Struct field count (estimated): 5 + +## Producers (0) + +_(none)_ + +## Consumers (0) + +_(none)_ + +## Field access matrix + +_(no field accesses detected)_ + +## Access pattern + +**Dominant pattern:** mixed +**Evidence count:** 0 + +## SSDL Sketch for `Result` + +``` +[Q:Result entry-point] -> [Q:PCG lookup] + -> [T:done] +``` + +**Effective codepaths:** 0 (sum of 2^branches across 0 consumers) +**Total branch points:** 0 +**Nil-check functions:** 0 + +**Defusing opportunities:** + +- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `result_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 0 field-check branches to 1 cache lookup. + - Effective codepaths: 0 -> 1 + + +## Frequency + +**Dominant frequency:** per_turn +**Evidence count:** 0 + +## Result coverage + +**Summary:** 0 producers, 0 consumers + +| metric | value | +|---|---| +| total producers | 0 | +| result producers | 0 | +| total consumers | 0 | +| result consumers | 0 | + +## Type alias coverage + +**Summary:** 0 sites + +| metric | value | +|---|---| +| total field-access sites | 0 | +| typed sites (canonical field) | 0 | +| untyped sites (wildcard) | 0 | + +## Cross-audit findings + +_(no cross-audit findings mapped to this aggregate)_ + +## Decomposition cost + +**Current cost estimate:** 470 us/turn +**Componentize savings:** 0 us/turn +**Unify savings:** 0 us/turn +**Recommended direction:** insufficient_data +**Rationale:** Result: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern. +**Struct field count (estimated):** 5 +**Struct frozen:** True + +## Struct shape (inferred from producer returns) + +_(no producers; cannot infer shape)_ + +## Optimization candidates + +_(no optimization candidates generated)_ + +## Verdict + +Result: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern. + +## Evidence appendix diff --git a/docs/reports/code_path_audit/2026-06-24/aggregates/ToolCall.md b/docs/reports/code_path_audit/2026-06-24/aggregates/ToolCall.md new file mode 100644 index 00000000..2a075e9e --- /dev/null +++ b/docs/reports/code_path_audit/2026-06-24/aggregates/ToolCall.md @@ -0,0 +1,574 @@ +# Aggregate Profile: ToolCall + +**Aggregate kind:** typealias +**Memory dim:** control +**Is candidate:** False + +## Pipeline summary + +- Producers: 118 +- Consumers: 68 +- Distinct producer fqnames: 97 +- Distinct consumer fqnames: 48 +- Access pattern (aggregate): whole_struct +- Frequency (aggregate): per_turn +- Decomposition direction: hold +- Struct field count (estimated): 10 + +## Producers (118) + +### `src\aggregate.py` (1 producer) + +- `src.aggregate.build_file_items` (line 158) + +### `src\ai_client.py` (16 producers) + +- `src.ai_client._load_credentials` (line 282) +- `src.ai_client._pre_dispatch` (line 2089) +- `src.ai_client.get_comms_log` (line 273) +- `src.ai_client.get_gemini_cache_stats` (line 1604) +- `src.ai_client._add_bleed_derived` (line 3332) +- `src.ai_client._get_anthropic_tools` (line 664) +- `src.ai_client._dashscope_call` (line 2716) +- `src.ai_client._extract_dashscope_tool_calls` (line 2754) +- `src.ai_client._send_cli_round_result` (line 1746) +- `src.ai_client._parse_tool_args_result` (line 741) +- `src.ai_client._content_block_to_dict` (line 1200) +- `src.ai_client.ollama_chat` (line 2938) +- `src.ai_client._get_deepseek_tools` (line 1194) +- `src.ai_client._strip_private_keys` (line 1464) +- `src.ai_client._build_chunked_context_blocks` (line 1281) +- `src.ai_client.get_token_stats` (line 3185) + +### `src\api_hook_client.py` (39 producers) + +- `src.api_hook_client.post_project` (line 470) +- `src.api_hook_client.drag` (line 230) +- `src.api_hook_client.set_value` (line 212) +- `src.api_hook_client.get_financial_metrics` (line 520) +- `src.api_hook_client.get_gui_health` (line 434) +- `src.api_hook_client.select_list_item` (line 256) +- `src.api_hook_client.get_mma_status` (line 539) +- `src.api_hook_client.get_project_switch_status` (line 374) +- `src.api_hook_client.get_performance` (line 318) +- `src.api_hook_client.get_patch_status` (line 295) +- `src.api_hook_client.get_startup_timeline` (line 353) +- `src.api_hook_client.get_events` (line 124) +- `src.api_hook_client.get_gui_state` (line 165) +- `src.api_hook_client.click` (line 223) +- `src.api_hook_client.get_node_status` (line 532) +- `src.api_hook_client.reject_patch` (line 288) +- `src.api_hook_client.get_project` (line 367) +- `src.api_hook_client.get_warmup_status` (line 325) +- `src.api_hook_client.right_click` (line 237) +- `src.api_hook_client.get_io_pool_status` (line 420) +- `src.api_hook_client.push_event` (line 156) +- `src.api_hook_client.get_warmup_wait` (line 332) +- `src.api_hook_client.get_status` (line 105) +- `src.api_hook_client._make_request` (line 65) +- `src.api_hook_client.wait_for_project_switch` (line 389) +- `src.api_hook_client.apply_patch` (line 281) +- `src.api_hook_client.get_context_state` (line 491) +- `src.api_hook_client.post_project` (line 473) +- `src.api_hook_client.get_warmup_canaries` (line 342) +- `src.api_hook_client.trigger_patch` (line 274) +- `src.api_hook_client.clear_events` (line 129) +- `src.api_hook_client.post_session` (line 117) +- `src.api_hook_client.get_session` (line 502) +- `src.api_hook_client.get_mma_workers` (line 546) +- `src.api_hook_client.get_gui_diagnostics` (line 311) +- `src.api_hook_client.post_gui` (line 149) +- `src.api_hook_client.get_system_telemetry` (line 524) +- `src.api_hook_client.select_tab` (line 263) +- `src.api_hook_client.wait_for_event` (line 136) + +### `src\app_controller.py` (30 producers) + +- `src.app_controller.wait` (line 5205) +- `src.app_controller.get_mma_status` (line 2835) +- `src.app_controller._api_get_performance` (line 195) +- `src.app_controller.get_performance` (line 2856) +- `src.app_controller.get_diagnostics` (line 2862) +- `src.app_controller.load_config` (line 5142) +- `src.app_controller._api_get_context` (line 398) +- `src.app_controller._api_status` (line 209) +- `src.app_controller.generate` (line 2868) +- `src.app_controller._api_generate` (line 221) +- `src.app_controller._api_token_stats` (line 417) +- `src.app_controller._api_get_gui_state` (line 123) +- `src.app_controller._api_get_diagnostics` (line 202) +- `src.app_controller.get_api_session` (line 2847) +- `src.app_controller.token_stats` (line 2898) +- `src.app_controller._api_get_api_session` (line 170) +- `src.app_controller._offload_entry_payload` (line 4240) +- `src.app_controller._pending_mma_spawn` (line 2772) +- `src.app_controller._api_pending_actions` (line 335) +- `src.app_controller.get_context` (line 2892) +- `src.app_controller.get_session` (line 2883) +- `src.app_controller.status` (line 2865) +- `src.app_controller.get_session_insights` (line 3049) +- `src.app_controller._api_get_api_project` (line 188) +- `src.app_controller._api_get_mma_status` (line 144) +- `src.app_controller._pending_mma_approval` (line 2776) +- `src.app_controller.get_api_project` (line 2853) +- `src.app_controller.pending_actions` (line 2874) +- `src.app_controller.get_gui_state` (line 2829) +- `src.app_controller._api_get_session` (line 374) + +### `src\models.py` (23 producers) + +- `src.models.to_dict` (line 646) +- `src.models.to_dict` (line 1000) +- `src.models.to_dict` (line 672) +- `src.models.to_dict` (line 938) +- `src.models.to_dict` (line 855) +- `src.models.to_dict` (line 441) +- `src.models.to_dict` (line 406) +- `src.models.to_dict` (line 355) +- `src.models.parse_history_entries` (line 214) +- `src.models.to_dict` (line 737) +- `src.models.to_dict` (line 486) +- `src.models.to_dict` (line 913) +- `src.models.to_dict` (line 596) +- `src.models.to_dict` (line 794) +- `src.models.to_dict` (line 558) +- `src.models.to_dict` (line 971) +- `src.models.to_dict` (line 1024) +- `src.models.to_dict` (line 288) +- `src.models.to_dict` (line 701) +- `src.models.to_dict` (line 886) +- `src.models.to_dict` (line 1059) +- `src.models._load_config_from_disk` (line 186) +- `src.models.to_dict` (line 618) + +### `src\openai_compatible.py` (1 producer) + +- `src.openai_compatible._to_typed_tool_call` (line 43) + +### `src\project_manager.py` (8 producers) + +- `src.project_manager.load_history` (line 209) +- `src.project_manager.default_project` (line 123) +- `src.project_manager.migrate_from_legacy_config` (line 253) +- `src.project_manager.load_project` (line 186) +- `src.project_manager.get_all_tracks` (line 342) +- `src.project_manager.default_discussion` (line 117) +- `src.project_manager.flat_config` (line 267) +- `src.project_manager.str_to_entry` (line 75) + +## Consumers (68) + +### `src\aggregate.py` (5 consumers) + +- `src.aggregate.build_tier3_context` (line 382) +- `src.aggregate.build_markdown_from_items` (line 348) +- `src.aggregate._build_files_section_from_items` (line 300) +- `src.aggregate.build_markdown_no_history` (line 366) +- `src.aggregate.run` (line 479) + +### `src\ai_client.py` (29 consumers) + +- `src.ai_client._strip_cache_controls` (line 1291) +- `src.ai_client._send_anthropic` (line 1405) +- `src.ai_client._estimate_prompt_tokens` (line 1243) +- `src.ai_client._strip_private_keys` (line 1464) +- `src.ai_client._trim_anthropic_history` (line 1353) +- `src.ai_client._add_history_cache_breakpoint` (line 1299) +- `src.ai_client._send_gemini_cli` (line 2019) +- `src.ai_client._repair_anthropic_history` (line 1381) +- `src.ai_client._create_gemini_cache_result` (line 1706) +- `src.ai_client._dashscope_call` (line 2716) +- `src.ai_client._send_grok` (line 2530) +- `src.ai_client._execute_single_tool_call_async` (line 945) +- `src.ai_client._repair_deepseek_history` (line 2138) +- `src.ai_client._add_bleed_derived` (line 3332) +- `src.ai_client._append_comms` (line 257) +- `src.ai_client._send_llama_native` (line 2958) +- `src.ai_client.send` (line 3208) +- `src.ai_client._estimate_message_tokens` (line 1218) +- `src.ai_client._pre_dispatch` (line 2089) +- `src.ai_client._send_gemini` (line 1802) +- `src.ai_client._send_minimax` (line 2616) +- `src.ai_client._send_deepseek` (line 2165) +- `src.ai_client._trim_minimax_history` (line 2482) +- `src.ai_client.ollama_chat` (line 2938) +- `src.ai_client._send_llama` (line 2858) +- `src.ai_client._invalidate_token_estimate` (line 1240) +- `src.ai_client._repair_minimax_history` (line 2462) +- `src.ai_client._send_qwen` (line 2773) +- `src.ai_client._strip_stale_file_refreshes` (line 1253) + +### `src\app_controller.py` (5 consumers) + +- `src.app_controller._start_track_logic_result` (line 4728) +- `src.app_controller._offload_entry_payload` (line 4240) +- `src.app_controller._start_track_logic` (line 4721) +- `src.app_controller._refresh_api_metrics` (line 3074) +- `src.app_controller._on_comms_entry` (line 4282) + +### `src\models.py` (22 consumers) + +- `src.models.from_dict` (line 603) +- `src.models.from_dict` (line 416) +- `src.models.from_dict` (line 506) +- `src.models.from_dict` (line 814) +- `src.models.from_dict` (line 893) +- `src.models._save_config_to_disk` (line 199) +- `src.models.from_dict` (line 378) +- `src.models.from_dict` (line 1007) +- `src.models.from_dict` (line 1038) +- `src.models.from_dict` (line 866) +- `src.models.from_dict` (line 712) +- `src.models.from_dict` (line 747) +- `src.models.from_dict` (line 683) +- `src.models.from_dict` (line 575) +- `src.models.from_dict` (line 630) +- `src.models.from_dict` (line 454) +- `src.models.from_dict` (line 949) +- `src.models.from_dict` (line 982) +- `src.models.from_dict` (line 656) +- `src.models.from_dict` (line 1072) +- `src.models.from_dict` (line 295) +- `src.models.from_dict` (line 920) + +### `src\openai_compatible.py` (1 consumer) + +- `src.openai_compatible._to_dict_tool_call` (line 54) + +### `src\openai_schemas.py` (1 consumer) + +- `src.openai_schemas.__init__` (line 82) + +### `src\project_manager.py` (5 consumers) + +- `src.project_manager.format_discussion` (line 69) +- `src.project_manager.flat_config` (line 267) +- `src.project_manager.entry_to_str` (line 49) +- `src.project_manager.save_project` (line 229) +- `src.project_manager.migrate_from_legacy_config` (line 253) + +## Field access matrix + +| consumer | _est_tokens | _gemini_cache_text | _pending_gui_tasks | _pending_gui_tasks_lock | _recalculate_session_usage | _start_track_logic_result | _token_stats | _topological_sort_tickets_result | _update_cached_stats | active_discussion | active_project_path | active_project_root | ai_status | append | config | content | context_files | encode | engines | error | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `build_tier3_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_strip_cache_controls` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_send_anthropic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `__init__` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_estimate_prompt_tokens` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_start_track_logic_result` | . | . | 2 | 2 | . | . | . | 1 | . | 1 | 1 | 1 | 4 | . | 1 | . | 1 | . | 1 | . | +| `_strip_private_keys` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_trim_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_to_dict_tool_call` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_add_history_cache_breakpoint` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `build_markdown_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_send_gemini_cli` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_repair_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_create_gemini_cache_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_dashscope_call` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_send_grok` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_offload_entry_payload` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_save_config_to_disk` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_execute_single_tool_call_async` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_repair_deepseek_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . | +| `_add_bleed_derived` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `flat_config` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_build_files_section_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_append_comms` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_send_llama_native` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `send` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | +| `_start_track_logic` | . | . | . | . | . | 1 | . | . | . | . | . | . | 1 | . | . | . | . | . | . | . | +| `build_markdown_no_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_estimate_message_tokens` | 1 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_pre_dispatch` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_send_gemini` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | +| `_send_minimax` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_refresh_api_metrics` | . | 1 | . | . | 1 | . | 1 | . | 1 | . | . | . | . | . | . | . | . | . | . | 2 | +| `_send_deepseek` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_trim_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `entry_to_str` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `ollama_chat` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | + +_... 25 more fields_ + +## Access pattern + +**Dominant pattern:** whole_struct +**Evidence count:** 50 + +**Per-function pattern distribution:** + +- `whole_struct`: 31 functions (62%) +- `mixed`: 16 functions (32%) +- `field_by_field`: 3 functions (6%) + +## SSDL Sketch for `ToolCall` + +``` +[Q:ToolCall entry-point] -> [Q:PCG lookup] + -> [1: from_dict] [B:check] (branches=0) + -> [2: build_tier3_context] [B:check] (branches=50) + -> [3: _strip_cache_controls] [B:check] (branches=4) + -> [4: from_dict] [B:check] (branches=0) + -> [5: from_dict] [B:check] (branches=0) + -> [6: _send_anthropic] [B:is None?] (branches=40) [N:safe] + -> [7: __init__] [B:is None?] (branches=1) [N:safe] + -> [8: _estimate_prompt_tokens] [B:check] (branches=2) + -> [9: _start_track_logic_result] [B:check] (branches=10) + -> [10: _strip_private_keys] [B:check] (branches=0) + -> [11: _trim_anthropic_history] [B:check] (branches=13) + -> [12: _to_dict_tool_call] [B:check] (branches=0) + -> [13: _add_history_cache_breakpoint] [B:check] (branches=5) + -> [14: build_markdown_from_items] [B:check] (branches=9) + -> [15: _send_gemini_cli] [B:is None?] (branches=23) [N:safe] + -> [16: _repair_anthropic_history] [B:check] (branches=6) + -> [17: from_dict] [B:check] (branches=0) + -> [18: format_discussion] [B:check] (branches=0) + -> [19: _create_gemini_cache_result] [B:check] (branches=3) + -> [20: _dashscope_call] [B:check] (branches=5) + -> [21: _send_grok] [B:check] (branches=14) + -> [22: _offload_entry_payload] [B:check] (branches=10) + -> [23: from_dict] [B:check] (branches=0) + -> [24: _save_config_to_disk] [B:check] (branches=1) + -> [25: from_dict] [B:check] (branches=0) + -> [26: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe] + -> [27: from_dict] [B:check] (branches=0) + -> [28: _repair_deepseek_history] [B:check] (branches=6) + -> [29: _add_bleed_derived] [B:check] (branches=0) + -> [30: flat_config] [B:check] (branches=2) + -> [31: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe] + -> [32: _append_comms] [B:is None?] (branches=1) [N:safe] + -> [33: _send_llama_native] [B:check] (branches=12) + -> [34: send] [B:check] (branches=19) + -> [35: _start_track_logic] [B:check] (branches=1) + -> [36: build_markdown_no_history] [B:check] (branches=0) + -> [37: from_dict] [B:check] (branches=0) + -> [38: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe] + -> [39: _pre_dispatch] [B:check] (branches=8) + -> [40: from_dict] [B:check] (branches=0) + -> [41: from_dict] [B:check] (branches=0) + -> [42: _send_gemini] [B:is None?] (branches=75) [N:safe] + -> [43: _send_minimax] [B:check] (branches=11) + -> [44: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe] + -> [45: _send_deepseek] [B:check] (branches=71) + -> [46: _trim_minimax_history] [B:check] (branches=8) + -> [47: entry_to_str] [B:check] (branches=3) + -> [48: from_dict] [B:check] (branches=0) + -> [49: from_dict] [B:check] (branches=0) + -> [50: ollama_chat] [B:check] (branches=3) + -> [51: from_dict] [B:check] (branches=0) + -> [52: _send_llama] [B:check] (branches=13) + -> [53: from_dict] [B:check] (branches=0) + -> [54: run] [B:check] (branches=1) + -> [55: _invalidate_token_estimate] [B:check] (branches=0) + -> [56: _on_comms_entry] [B:check] (branches=32) + -> [57: from_dict] [B:check] (branches=0) + -> [58: _repair_minimax_history] [B:check] (branches=10) + -> [59: from_dict] [B:check] (branches=0) + -> [60: from_dict] [B:check] (branches=0) + -> [61: from_dict] [B:check] (branches=0) + -> [62: _send_qwen] [B:check] (branches=9) + -> [63: save_project] [B:is None?] (branches=7) [N:safe] + -> [64: migrate_from_legacy_config] [B:check] (branches=2) + -> [65: from_dict] [B:check] (branches=0) + -> [66: _strip_stale_file_refreshes] [B:check] (branches=12) + -> [67: from_dict] [B:check] (branches=0) + -> [68: from_dict] [B:check] (branches=0) + -> [T:done] +``` + +**Effective codepaths:** 40140116231395706750393 (sum of 2^branches across 68 consumers) +**Total branch points:** 542 +**Nil-check functions:** 10 + +**Defusing opportunities:** + +- **Nil Sentinel `[N]`**: Introduce a module-level `NIL_` sentinel whose field accesses return safe defaults. Replace None checks with the sentinel. Collapses 2^branch_count into ~1. + - Effective codepaths: 40140116231395706750393 -> 40140116231395706750373 +- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `toolcall_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 109 field-check branches to 1 cache lookup. + - Effective codepaths: 40140116231395706750393 -> 109 +- **Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`**: Wrap the aggregate in a generational handle (index + generation). Validation is one comparison; mismatch returns the nil sentinel. Reduces N lifetime branches to 1 handle validation + sentinel return. + - Effective codepaths: 40140116231395706750393 -> 68 + + +## Frequency + +**Dominant frequency:** per_turn +**Evidence count:** 5 + +**Per-function frequency distribution:** + +- `per_turn`: 5 functions + +## Result coverage + +**Summary:** 97 producers, 48 consumers + +| metric | value | +|---|---| +| total producers | 97 | +| result producers | 97 | +| total consumers | 48 | +| result consumers | 0 | + +## Type alias coverage + +**Summary:** 109 sites; 0 typed (0%); 109 untyped (100%) + +| metric | value | +|---|---| +| total field-access sites | 109 | +| typed sites (canonical field) | 0 | +| untyped sites (wildcard) | 109 | + +## Cross-audit findings + +_(no cross-audit findings mapped to this aggregate)_ + +## Decomposition cost + +**Current cost estimate:** 720 us/turn +**Componentize savings:** 0 us/turn +**Unify savings:** 0 us/turn +**Recommended direction:** hold +**Rationale:** ToolCall: access_pattern=whole_struct, frequency=per_turn, struct_field_count=10, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. +**Struct field count (estimated):** 10 +**Struct frozen:** True + +## Struct shape (inferred from producer returns) + +| field | access count | access pattern | +|---|---|---| +| `content` | 12 | hot | +| `marker` | 12 | hot | +| `get` | 7 | hot | +| `ai_status` | 2 | used | +| `config` | 2 | used | +| `pop` | 2 | used | +| `append` | 2 | used | +| `context_files` | 1 | used | +| `_pending_gui_tasks_lock` | 1 | used | +| `_topological_sort_tickets_result` | 1 | used | +| `active_project_root` | 1 | used | +| `event_queue` | 1 | used | +| `engines` | 1 | used | +| `project` | 1 | used | +| `active_discussion` | 1 | used | +| `submit_io` | 1 | used | +| `tracks` | 1 | used | +| `mma_tier_usage` | 1 | used | +| `_pending_gui_tasks` | 1 | used | +| `mma_step_mode` | 1 | used | +| `active_project_path` | 1 | used | +| `to_dict` | 1 | used | +| `items` | 1 | used | +| `estimated_prompt_tokens` | 1 | used | +| `max_prompt_tokens` | 1 | used | +| `utilization_pct` | 1 | used | +| `headroom` | 1 | used | +| `would_trim` | 1 | used | +| `sys_tokens` | 1 | used | +| `tool_tokens` | 1 | used | +| `history_tokens` | 1 | used | +| `search` | 1 | used | +| `_start_track_logic_result` | 1 | used | +| `_est_tokens` | 1 | used | +| `encode` | 1 | used | +| `latency` | 1 | used | +| `_recalculate_session_usage` | 1 | used | +| `_token_stats` | 1 | used | +| `_gemini_cache_text` | 1 | used | +| `vendor_quota` | 1 | used | +| `last_error` | 1 | used | +| `error` | 1 | used | +| `_update_cached_stats` | 1 | used | +| `session_usage` | 1 | used | +| `usage` | 1 | used | + +## Optimization candidates + +_(no optimization candidates generated)_ + +## Verdict + +ToolCall: access_pattern=whole_struct, frequency=per_turn, struct_field_count=10, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. + +## Evidence appendix + +### Access pattern evidence + +| function | pattern | field_accesses | confidence | +|---|---|---|---| +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.aggregate.build_tier3_context` | `whole_struct` | | low | +| `src.ai_client._strip_cache_controls` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._send_anthropic` | `whole_struct` | | low | +| `src.openai_schemas.__init__` | `whole_struct` | | low | +| `src.ai_client._estimate_prompt_tokens` | `whole_struct` | | low | +| `src.app_controller._start_track_logic_result` | `field_by_field` | `ai_status`=4, `context_files`=1, `get`=3, `_pending_gui_tasks_lock`=2, `_topological_sort_tickets_result`=1, `active_project_root`=1, `event_queue`=1, `engines`=1, `project`=1, `active_discussion`=1 (+7 more) | high | +| `src.ai_client._strip_private_keys` | `whole_struct` | | low | +| `src.ai_client._trim_anthropic_history` | `whole_struct` | `pop`=5 | high | +| `src.openai_compatible._to_dict_tool_call` | `whole_struct` | `to_dict`=1 | high | +| `src.ai_client._add_history_cache_breakpoint` | `whole_struct` | | low | +| `src.aggregate.build_markdown_from_items` | `whole_struct` | | low | +| `src.ai_client._send_gemini_cli` | `whole_struct` | | low | +| `src.ai_client._repair_anthropic_history` | `whole_struct` | `append`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.project_manager.format_discussion` | `whole_struct` | | low | +| `src.ai_client._create_gemini_cache_result` | `whole_struct` | | low | +| `src.ai_client._dashscope_call` | `whole_struct` | | low | +| `src.ai_client._send_grok` | `whole_struct` | | low | +| `src.app_controller._offload_entry_payload` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models._save_config_to_disk` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._execute_single_tool_call_async` | `mixed` | `get`=2, `items`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._repair_deepseek_history` | `whole_struct` | `append`=1 | high | +| `src.ai_client._add_bleed_derived` | `field_by_field` | `estimated_prompt_tokens`=1, `max_prompt_tokens`=1, `utilization_pct`=1, `headroom`=1, `would_trim`=1, `sys_tokens`=1, `tool_tokens`=1, `history_tokens`=1, `get`=3 | high | +| `src.project_manager.flat_config` | `whole_struct` | `get`=7 | high | +| `src.aggregate._build_files_section_from_items` | `whole_struct` | | low | +| `src.ai_client._append_comms` | `whole_struct` | | low | +| `src.ai_client._send_llama_native` | `whole_struct` | | low | +| `src.ai_client.send` | `mixed` | `config`=1, `search`=1 | high | +| `src.app_controller._start_track_logic` | `mixed` | `_start_track_logic_result`=1, `ai_status`=1 | high | +| `src.aggregate.build_markdown_no_history` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._estimate_message_tokens` | `mixed` | `_est_tokens`=1, `get`=2 | high | +| `src.ai_client._pre_dispatch` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._send_gemini` | `whole_struct` | `encode`=1 | high | +| `src.ai_client._send_minimax` | `whole_struct` | | low | +| `src.app_controller._refresh_api_metrics` | `field_by_field` | `latency`=1, `_recalculate_session_usage`=1, `_token_stats`=1, `get`=2, `_gemini_cache_text`=1, `vendor_quota`=1, `last_error`=1, `error`=2, `_update_cached_stats`=1, `session_usage`=2 (+1 more) | high | +| `src.ai_client._send_deepseek` | `whole_struct` | | low | +| `src.ai_client._trim_minimax_history` | `whole_struct` | `pop`=4 | high | +| `src.project_manager.entry_to_str` | `whole_struct` | `get`=4 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client.ollama_chat` | `whole_struct` | | low | + +### Frequency evidence + +| function | frequency | source | note | +|---|---|---|---| +| `src.app_controller.wait` | `per_turn` | `static_analysis` | producer from src\app_controller.py | +| `src.api_hook_client.post_project` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py | +| `src.app_controller.get_mma_status` | `per_turn` | `static_analysis` | producer from src\app_controller.py | +| `src.ai_client._load_credentials` | `per_turn` | `static_analysis` | producer from src\ai_client.py | +| `src.ai_client._pre_dispatch` | `per_turn` | `static_analysis` | producer from src\ai_client.py | diff --git a/docs/reports/code_path_audit/2026-06-24/aggregates/ToolDefinition.md b/docs/reports/code_path_audit/2026-06-24/aggregates/ToolDefinition.md new file mode 100644 index 00000000..e39b740c --- /dev/null +++ b/docs/reports/code_path_audit/2026-06-24/aggregates/ToolDefinition.md @@ -0,0 +1,563 @@ +# Aggregate Profile: ToolDefinition + +**Aggregate kind:** typealias +**Memory dim:** control +**Is candidate:** False + +## Pipeline summary + +- Producers: 119 +- Consumers: 66 +- Distinct producer fqnames: 98 +- Distinct consumer fqnames: 46 +- Access pattern (aggregate): whole_struct +- Frequency (aggregate): per_turn +- Decomposition direction: hold +- Struct field count (estimated): 10 + +## Producers (119) + +### `src\aggregate.py` (1 producer) + +- `src.aggregate.build_file_items` (line 158) + +### `src\ai_client.py` (18 producers) + +- `src.ai_client._load_credentials` (line 282) +- `src.ai_client._pre_dispatch` (line 2089) +- `src.ai_client._build_deepseek_tools` (line 1148) +- `src.ai_client.get_comms_log` (line 273) +- `src.ai_client.get_gemini_cache_stats` (line 1604) +- `src.ai_client._add_bleed_derived` (line 3332) +- `src.ai_client._get_anthropic_tools` (line 664) +- `src.ai_client._dashscope_call` (line 2716) +- `src.ai_client._build_anthropic_tools` (line 623) +- `src.ai_client._extract_dashscope_tool_calls` (line 2754) +- `src.ai_client._send_cli_round_result` (line 1746) +- `src.ai_client._parse_tool_args_result` (line 741) +- `src.ai_client._content_block_to_dict` (line 1200) +- `src.ai_client.ollama_chat` (line 2938) +- `src.ai_client._get_deepseek_tools` (line 1194) +- `src.ai_client._strip_private_keys` (line 1464) +- `src.ai_client._build_chunked_context_blocks` (line 1281) +- `src.ai_client.get_token_stats` (line 3185) + +### `src\api_hook_client.py` (39 producers) + +- `src.api_hook_client.post_project` (line 470) +- `src.api_hook_client.drag` (line 230) +- `src.api_hook_client.set_value` (line 212) +- `src.api_hook_client.get_financial_metrics` (line 520) +- `src.api_hook_client.get_gui_health` (line 434) +- `src.api_hook_client.select_list_item` (line 256) +- `src.api_hook_client.get_mma_status` (line 539) +- `src.api_hook_client.get_project_switch_status` (line 374) +- `src.api_hook_client.get_performance` (line 318) +- `src.api_hook_client.get_patch_status` (line 295) +- `src.api_hook_client.get_startup_timeline` (line 353) +- `src.api_hook_client.get_events` (line 124) +- `src.api_hook_client.get_gui_state` (line 165) +- `src.api_hook_client.click` (line 223) +- `src.api_hook_client.get_node_status` (line 532) +- `src.api_hook_client.reject_patch` (line 288) +- `src.api_hook_client.get_project` (line 367) +- `src.api_hook_client.get_warmup_status` (line 325) +- `src.api_hook_client.right_click` (line 237) +- `src.api_hook_client.get_io_pool_status` (line 420) +- `src.api_hook_client.push_event` (line 156) +- `src.api_hook_client.get_warmup_wait` (line 332) +- `src.api_hook_client.get_status` (line 105) +- `src.api_hook_client._make_request` (line 65) +- `src.api_hook_client.wait_for_project_switch` (line 389) +- `src.api_hook_client.apply_patch` (line 281) +- `src.api_hook_client.get_context_state` (line 491) +- `src.api_hook_client.post_project` (line 473) +- `src.api_hook_client.get_warmup_canaries` (line 342) +- `src.api_hook_client.trigger_patch` (line 274) +- `src.api_hook_client.clear_events` (line 129) +- `src.api_hook_client.post_session` (line 117) +- `src.api_hook_client.get_session` (line 502) +- `src.api_hook_client.get_mma_workers` (line 546) +- `src.api_hook_client.get_gui_diagnostics` (line 311) +- `src.api_hook_client.post_gui` (line 149) +- `src.api_hook_client.get_system_telemetry` (line 524) +- `src.api_hook_client.select_tab` (line 263) +- `src.api_hook_client.wait_for_event` (line 136) + +### `src\app_controller.py` (30 producers) + +- `src.app_controller.wait` (line 5205) +- `src.app_controller.get_mma_status` (line 2835) +- `src.app_controller._api_get_performance` (line 195) +- `src.app_controller.get_performance` (line 2856) +- `src.app_controller.get_diagnostics` (line 2862) +- `src.app_controller.load_config` (line 5142) +- `src.app_controller._api_get_context` (line 398) +- `src.app_controller._api_status` (line 209) +- `src.app_controller.generate` (line 2868) +- `src.app_controller._api_generate` (line 221) +- `src.app_controller._api_token_stats` (line 417) +- `src.app_controller._api_get_gui_state` (line 123) +- `src.app_controller._api_get_diagnostics` (line 202) +- `src.app_controller.get_api_session` (line 2847) +- `src.app_controller.token_stats` (line 2898) +- `src.app_controller._api_get_api_session` (line 170) +- `src.app_controller._offload_entry_payload` (line 4240) +- `src.app_controller._pending_mma_spawn` (line 2772) +- `src.app_controller._api_pending_actions` (line 335) +- `src.app_controller.get_context` (line 2892) +- `src.app_controller.get_session` (line 2883) +- `src.app_controller.status` (line 2865) +- `src.app_controller.get_session_insights` (line 3049) +- `src.app_controller._api_get_api_project` (line 188) +- `src.app_controller._api_get_mma_status` (line 144) +- `src.app_controller._pending_mma_approval` (line 2776) +- `src.app_controller.get_api_project` (line 2853) +- `src.app_controller.pending_actions` (line 2874) +- `src.app_controller.get_gui_state` (line 2829) +- `src.app_controller._api_get_session` (line 374) + +### `src\models.py` (23 producers) + +- `src.models.to_dict` (line 646) +- `src.models.to_dict` (line 1000) +- `src.models.to_dict` (line 672) +- `src.models.to_dict` (line 938) +- `src.models.to_dict` (line 855) +- `src.models.to_dict` (line 441) +- `src.models.to_dict` (line 406) +- `src.models.to_dict` (line 355) +- `src.models.parse_history_entries` (line 214) +- `src.models.to_dict` (line 737) +- `src.models.to_dict` (line 486) +- `src.models.to_dict` (line 913) +- `src.models.to_dict` (line 596) +- `src.models.to_dict` (line 794) +- `src.models.to_dict` (line 558) +- `src.models.to_dict` (line 971) +- `src.models.to_dict` (line 1024) +- `src.models.to_dict` (line 288) +- `src.models.to_dict` (line 701) +- `src.models.to_dict` (line 886) +- `src.models.to_dict` (line 1059) +- `src.models._load_config_from_disk` (line 186) +- `src.models.to_dict` (line 618) + +### `src\project_manager.py` (8 producers) + +- `src.project_manager.load_history` (line 209) +- `src.project_manager.default_project` (line 123) +- `src.project_manager.migrate_from_legacy_config` (line 253) +- `src.project_manager.load_project` (line 186) +- `src.project_manager.get_all_tracks` (line 342) +- `src.project_manager.default_discussion` (line 117) +- `src.project_manager.flat_config` (line 267) +- `src.project_manager.str_to_entry` (line 75) + +## Consumers (66) + +### `src\aggregate.py` (5 consumers) + +- `src.aggregate.build_tier3_context` (line 382) +- `src.aggregate.build_markdown_from_items` (line 348) +- `src.aggregate._build_files_section_from_items` (line 300) +- `src.aggregate.build_markdown_no_history` (line 366) +- `src.aggregate.run` (line 479) + +### `src\ai_client.py` (29 consumers) + +- `src.ai_client._strip_cache_controls` (line 1291) +- `src.ai_client._send_anthropic` (line 1405) +- `src.ai_client._estimate_prompt_tokens` (line 1243) +- `src.ai_client._strip_private_keys` (line 1464) +- `src.ai_client._trim_anthropic_history` (line 1353) +- `src.ai_client._add_history_cache_breakpoint` (line 1299) +- `src.ai_client._send_gemini_cli` (line 2019) +- `src.ai_client._repair_anthropic_history` (line 1381) +- `src.ai_client._create_gemini_cache_result` (line 1706) +- `src.ai_client._dashscope_call` (line 2716) +- `src.ai_client._send_grok` (line 2530) +- `src.ai_client._execute_single_tool_call_async` (line 945) +- `src.ai_client._repair_deepseek_history` (line 2138) +- `src.ai_client._add_bleed_derived` (line 3332) +- `src.ai_client._append_comms` (line 257) +- `src.ai_client._send_llama_native` (line 2958) +- `src.ai_client.send` (line 3208) +- `src.ai_client._estimate_message_tokens` (line 1218) +- `src.ai_client._pre_dispatch` (line 2089) +- `src.ai_client._send_gemini` (line 1802) +- `src.ai_client._send_minimax` (line 2616) +- `src.ai_client._send_deepseek` (line 2165) +- `src.ai_client._trim_minimax_history` (line 2482) +- `src.ai_client.ollama_chat` (line 2938) +- `src.ai_client._send_llama` (line 2858) +- `src.ai_client._invalidate_token_estimate` (line 1240) +- `src.ai_client._repair_minimax_history` (line 2462) +- `src.ai_client._send_qwen` (line 2773) +- `src.ai_client._strip_stale_file_refreshes` (line 1253) + +### `src\app_controller.py` (5 consumers) + +- `src.app_controller._start_track_logic_result` (line 4728) +- `src.app_controller._offload_entry_payload` (line 4240) +- `src.app_controller._start_track_logic` (line 4721) +- `src.app_controller._refresh_api_metrics` (line 3074) +- `src.app_controller._on_comms_entry` (line 4282) + +### `src\models.py` (22 consumers) + +- `src.models.from_dict` (line 603) +- `src.models.from_dict` (line 416) +- `src.models.from_dict` (line 506) +- `src.models.from_dict` (line 814) +- `src.models.from_dict` (line 893) +- `src.models._save_config_to_disk` (line 199) +- `src.models.from_dict` (line 378) +- `src.models.from_dict` (line 1007) +- `src.models.from_dict` (line 1038) +- `src.models.from_dict` (line 866) +- `src.models.from_dict` (line 712) +- `src.models.from_dict` (line 747) +- `src.models.from_dict` (line 683) +- `src.models.from_dict` (line 575) +- `src.models.from_dict` (line 630) +- `src.models.from_dict` (line 454) +- `src.models.from_dict` (line 949) +- `src.models.from_dict` (line 982) +- `src.models.from_dict` (line 656) +- `src.models.from_dict` (line 1072) +- `src.models.from_dict` (line 295) +- `src.models.from_dict` (line 920) + +### `src\project_manager.py` (5 consumers) + +- `src.project_manager.format_discussion` (line 69) +- `src.project_manager.flat_config` (line 267) +- `src.project_manager.entry_to_str` (line 49) +- `src.project_manager.save_project` (line 229) +- `src.project_manager.migrate_from_legacy_config` (line 253) + +## Field access matrix + +| consumer | _est_tokens | _gemini_cache_text | _pending_gui_tasks | _pending_gui_tasks_lock | _recalculate_session_usage | _start_track_logic_result | _token_stats | _topological_sort_tickets_result | _update_cached_stats | active_discussion | active_project_path | active_project_root | ai_status | append | config | content | context_files | encode | engines | error | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `build_tier3_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_strip_cache_controls` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_send_anthropic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_estimate_prompt_tokens` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_start_track_logic_result` | . | . | 2 | 2 | . | . | . | 1 | . | 1 | 1 | 1 | 4 | . | 1 | . | 1 | . | 1 | . | +| `_strip_private_keys` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_trim_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_add_history_cache_breakpoint` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `build_markdown_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_send_gemini_cli` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_repair_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_create_gemini_cache_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_dashscope_call` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_send_grok` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_offload_entry_payload` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_save_config_to_disk` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_execute_single_tool_call_async` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_repair_deepseek_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . | +| `_add_bleed_derived` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `flat_config` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_build_files_section_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_append_comms` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_send_llama_native` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `send` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | +| `_start_track_logic` | . | . | . | . | . | 1 | . | . | . | . | . | . | 1 | . | . | . | . | . | . | . | +| `build_markdown_no_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_estimate_message_tokens` | 1 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_pre_dispatch` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_send_gemini` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | +| `_send_minimax` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_refresh_api_metrics` | . | 1 | . | . | 1 | . | 1 | . | 1 | . | . | . | . | . | . | . | . | . | . | 2 | +| `_send_deepseek` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `_trim_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `entry_to_str` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `ollama_chat` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | +| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | +| `_send_llama` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | + +_... 24 more fields_ + +## Access pattern + +**Dominant pattern:** whole_struct +**Evidence count:** 50 + +**Per-function pattern distribution:** + +- `whole_struct`: 30 functions (60%) +- `mixed`: 17 functions (34%) +- `field_by_field`: 3 functions (6%) + +## SSDL Sketch for `ToolDefinition` + +``` +[Q:ToolDefinition entry-point] -> [Q:PCG lookup] + -> [1: from_dict] [B:check] (branches=0) + -> [2: build_tier3_context] [B:check] (branches=50) + -> [3: _strip_cache_controls] [B:check] (branches=4) + -> [4: from_dict] [B:check] (branches=0) + -> [5: from_dict] [B:check] (branches=0) + -> [6: _send_anthropic] [B:is None?] (branches=40) [N:safe] + -> [7: _estimate_prompt_tokens] [B:check] (branches=2) + -> [8: _start_track_logic_result] [B:check] (branches=10) + -> [9: _strip_private_keys] [B:check] (branches=0) + -> [10: _trim_anthropic_history] [B:check] (branches=13) + -> [11: _add_history_cache_breakpoint] [B:check] (branches=5) + -> [12: build_markdown_from_items] [B:check] (branches=9) + -> [13: _send_gemini_cli] [B:is None?] (branches=23) [N:safe] + -> [14: _repair_anthropic_history] [B:check] (branches=6) + -> [15: from_dict] [B:check] (branches=0) + -> [16: format_discussion] [B:check] (branches=0) + -> [17: _create_gemini_cache_result] [B:check] (branches=3) + -> [18: _dashscope_call] [B:check] (branches=5) + -> [19: _send_grok] [B:check] (branches=14) + -> [20: _offload_entry_payload] [B:check] (branches=10) + -> [21: from_dict] [B:check] (branches=0) + -> [22: _save_config_to_disk] [B:check] (branches=1) + -> [23: from_dict] [B:check] (branches=0) + -> [24: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe] + -> [25: from_dict] [B:check] (branches=0) + -> [26: _repair_deepseek_history] [B:check] (branches=6) + -> [27: _add_bleed_derived] [B:check] (branches=0) + -> [28: flat_config] [B:check] (branches=2) + -> [29: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe] + -> [30: _append_comms] [B:is None?] (branches=1) [N:safe] + -> [31: _send_llama_native] [B:check] (branches=12) + -> [32: send] [B:check] (branches=19) + -> [33: _start_track_logic] [B:check] (branches=1) + -> [34: build_markdown_no_history] [B:check] (branches=0) + -> [35: from_dict] [B:check] (branches=0) + -> [36: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe] + -> [37: _pre_dispatch] [B:check] (branches=8) + -> [38: from_dict] [B:check] (branches=0) + -> [39: from_dict] [B:check] (branches=0) + -> [40: _send_gemini] [B:is None?] (branches=75) [N:safe] + -> [41: _send_minimax] [B:check] (branches=11) + -> [42: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe] + -> [43: _send_deepseek] [B:check] (branches=71) + -> [44: _trim_minimax_history] [B:check] (branches=8) + -> [45: entry_to_str] [B:check] (branches=3) + -> [46: from_dict] [B:check] (branches=0) + -> [47: from_dict] [B:check] (branches=0) + -> [48: ollama_chat] [B:check] (branches=3) + -> [49: from_dict] [B:check] (branches=0) + -> [50: _send_llama] [B:check] (branches=13) + -> [51: from_dict] [B:check] (branches=0) + -> [52: run] [B:check] (branches=1) + -> [53: _invalidate_token_estimate] [B:check] (branches=0) + -> [54: _on_comms_entry] [B:check] (branches=32) + -> [55: from_dict] [B:check] (branches=0) + -> [56: _repair_minimax_history] [B:check] (branches=10) + -> [57: from_dict] [B:check] (branches=0) + -> [58: from_dict] [B:check] (branches=0) + -> [59: from_dict] [B:check] (branches=0) + -> [60: _send_qwen] [B:check] (branches=9) + -> [61: save_project] [B:is None?] (branches=7) [N:safe] + -> [62: migrate_from_legacy_config] [B:check] (branches=2) + -> [63: from_dict] [B:check] (branches=0) + -> [64: _strip_stale_file_refreshes] [B:check] (branches=12) + -> [65: from_dict] [B:check] (branches=0) + -> [66: from_dict] [B:check] (branches=0) + -> [T:done] +``` + +**Effective codepaths:** 40140116231395706750390 (sum of 2^branches across 66 consumers) +**Total branch points:** 541 +**Nil-check functions:** 9 + +**Defusing opportunities:** + +- **Nil Sentinel `[N]`**: Introduce a module-level `NIL_` sentinel whose field accesses return safe defaults. Replace None checks with the sentinel. Collapses 2^branch_count into ~1. + - Effective codepaths: 40140116231395706750390 -> 40140116231395706750372 +- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `tooldefinition_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 110 field-check branches to 1 cache lookup. + - Effective codepaths: 40140116231395706750390 -> 110 +- **Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`**: Wrap the aggregate in a generational handle (index + generation). Validation is one comparison; mismatch returns the nil sentinel. Reduces N lifetime branches to 1 handle validation + sentinel return. + - Effective codepaths: 40140116231395706750390 -> 66 + + +## Frequency + +**Dominant frequency:** per_turn +**Evidence count:** 5 + +**Per-function frequency distribution:** + +- `per_turn`: 5 functions + +## Result coverage + +**Summary:** 98 producers, 46 consumers + +| metric | value | +|---|---| +| total producers | 98 | +| result producers | 98 | +| total consumers | 46 | +| result consumers | 0 | + +## Type alias coverage + +**Summary:** 110 sites; 0 typed (0%); 110 untyped (100%) + +| metric | value | +|---|---| +| total field-access sites | 110 | +| typed sites (canonical field) | 0 | +| untyped sites (wildcard) | 110 | + +## Cross-audit findings + +| bucket | audit script | site count | example file | example line | note | +|---|---|---|---|---|---| +| optional_in_baseline | `audit_optional_in_3_files` | 76 | `src\ai_client.py` | 159 | 76 sites | + +## Decomposition cost + +**Current cost estimate:** 720 us/turn +**Componentize savings:** 0 us/turn +**Unify savings:** 0 us/turn +**Recommended direction:** hold +**Rationale:** ToolDefinition: access_pattern=whole_struct, frequency=per_turn, struct_field_count=10, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. +**Struct field count (estimated):** 10 +**Struct frozen:** True + +## Struct shape (inferred from producer returns) + +| field | access count | access pattern | +|---|---|---| +| `content` | 13 | hot | +| `marker` | 13 | hot | +| `get` | 7 | hot | +| `ai_status` | 2 | used | +| `config` | 2 | used | +| `pop` | 2 | used | +| `append` | 2 | used | +| `context_files` | 1 | used | +| `_pending_gui_tasks_lock` | 1 | used | +| `_topological_sort_tickets_result` | 1 | used | +| `active_project_root` | 1 | used | +| `event_queue` | 1 | used | +| `engines` | 1 | used | +| `project` | 1 | used | +| `active_discussion` | 1 | used | +| `submit_io` | 1 | used | +| `tracks` | 1 | used | +| `mma_tier_usage` | 1 | used | +| `_pending_gui_tasks` | 1 | used | +| `mma_step_mode` | 1 | used | +| `active_project_path` | 1 | used | +| `items` | 1 | used | +| `estimated_prompt_tokens` | 1 | used | +| `max_prompt_tokens` | 1 | used | +| `utilization_pct` | 1 | used | +| `headroom` | 1 | used | +| `would_trim` | 1 | used | +| `sys_tokens` | 1 | used | +| `tool_tokens` | 1 | used | +| `history_tokens` | 1 | used | +| `search` | 1 | used | +| `_start_track_logic_result` | 1 | used | +| `_est_tokens` | 1 | used | +| `encode` | 1 | used | +| `latency` | 1 | used | +| `_recalculate_session_usage` | 1 | used | +| `_token_stats` | 1 | used | +| `_gemini_cache_text` | 1 | used | +| `vendor_quota` | 1 | used | +| `last_error` | 1 | used | +| `error` | 1 | used | +| `_update_cached_stats` | 1 | used | +| `session_usage` | 1 | used | +| `usage` | 1 | used | + +## Optimization candidates + +_(no optimization candidates generated)_ + +## Verdict + +ToolDefinition: access_pattern=whole_struct, frequency=per_turn, struct_field_count=10, struct_frozen=True. Recommended: hold because the current shape matches the access pattern. + +## Evidence appendix + +### Access pattern evidence + +| function | pattern | field_accesses | confidence | +|---|---|---|---| +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.aggregate.build_tier3_context` | `whole_struct` | | low | +| `src.ai_client._strip_cache_controls` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._send_anthropic` | `whole_struct` | | low | +| `src.ai_client._estimate_prompt_tokens` | `whole_struct` | | low | +| `src.app_controller._start_track_logic_result` | `field_by_field` | `ai_status`=4, `context_files`=1, `get`=3, `_pending_gui_tasks_lock`=2, `_topological_sort_tickets_result`=1, `active_project_root`=1, `event_queue`=1, `engines`=1, `project`=1, `active_discussion`=1 (+7 more) | high | +| `src.ai_client._strip_private_keys` | `whole_struct` | | low | +| `src.ai_client._trim_anthropic_history` | `whole_struct` | `pop`=5 | high | +| `src.ai_client._add_history_cache_breakpoint` | `whole_struct` | | low | +| `src.aggregate.build_markdown_from_items` | `whole_struct` | | low | +| `src.ai_client._send_gemini_cli` | `whole_struct` | | low | +| `src.ai_client._repair_anthropic_history` | `whole_struct` | `append`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.project_manager.format_discussion` | `whole_struct` | | low | +| `src.ai_client._create_gemini_cache_result` | `whole_struct` | | low | +| `src.ai_client._dashscope_call` | `whole_struct` | | low | +| `src.ai_client._send_grok` | `whole_struct` | | low | +| `src.app_controller._offload_entry_payload` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models._save_config_to_disk` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._execute_single_tool_call_async` | `mixed` | `get`=2, `items`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._repair_deepseek_history` | `whole_struct` | `append`=1 | high | +| `src.ai_client._add_bleed_derived` | `field_by_field` | `estimated_prompt_tokens`=1, `max_prompt_tokens`=1, `utilization_pct`=1, `headroom`=1, `would_trim`=1, `sys_tokens`=1, `tool_tokens`=1, `history_tokens`=1, `get`=3 | high | +| `src.project_manager.flat_config` | `whole_struct` | `get`=7 | high | +| `src.aggregate._build_files_section_from_items` | `whole_struct` | | low | +| `src.ai_client._append_comms` | `whole_struct` | | low | +| `src.ai_client._send_llama_native` | `whole_struct` | | low | +| `src.ai_client.send` | `mixed` | `config`=1, `search`=1 | high | +| `src.app_controller._start_track_logic` | `mixed` | `_start_track_logic_result`=1, `ai_status`=1 | high | +| `src.aggregate.build_markdown_no_history` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._estimate_message_tokens` | `mixed` | `_est_tokens`=1, `get`=2 | high | +| `src.ai_client._pre_dispatch` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._send_gemini` | `whole_struct` | `encode`=1 | high | +| `src.ai_client._send_minimax` | `whole_struct` | | low | +| `src.app_controller._refresh_api_metrics` | `field_by_field` | `latency`=1, `_recalculate_session_usage`=1, `_token_stats`=1, `get`=2, `_gemini_cache_text`=1, `vendor_quota`=1, `last_error`=1, `error`=2, `_update_cached_stats`=1, `session_usage`=2 (+1 more) | high | +| `src.ai_client._send_deepseek` | `whole_struct` | | low | +| `src.ai_client._trim_minimax_history` | `whole_struct` | `pop`=4 | high | +| `src.project_manager.entry_to_str` | `whole_struct` | `get`=4 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client.ollama_chat` | `whole_struct` | | low | +| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high | +| `src.ai_client._send_llama` | `whole_struct` | | low | + +### Frequency evidence + +| function | frequency | source | note | +|---|---|---|---| +| `src.app_controller.wait` | `per_turn` | `static_analysis` | producer from src\app_controller.py | +| `src.api_hook_client.post_project` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py | +| `src.app_controller.get_mma_status` | `per_turn` | `static_analysis` | producer from src\app_controller.py | +| `src.ai_client._load_credentials` | `per_turn` | `static_analysis` | producer from src\ai_client.py | +| `src.ai_client._pre_dispatch` | `per_turn` | `static_analysis` | producer from src\ai_client.py | diff --git a/docs/reports/code_path_audit/2026-06-24/aggregates/ToolSpec.md b/docs/reports/code_path_audit/2026-06-24/aggregates/ToolSpec.md new file mode 100644 index 00000000..414c0957 --- /dev/null +++ b/docs/reports/code_path_audit/2026-06-24/aggregates/ToolSpec.md @@ -0,0 +1,92 @@ +# Aggregate Profile: ToolSpec + +**Aggregate kind:** candidate_dataclass +**Memory dim:** unknown +**Is candidate:** True + +## Pipeline summary + +- Producers: 0 +- Consumers: 0 +- Distinct producer fqnames: 0 +- Distinct consumer fqnames: 0 +- Access pattern (aggregate): mixed +- Frequency (aggregate): unknown +- Decomposition direction: insufficient_data +- Struct field count (estimated): 0 + +## Producers (0) + +_(none)_ + +## Consumers (0) + +_(none)_ + +## Field access matrix + +_(no field accesses detected)_ + +## Access pattern + +**Dominant pattern:** mixed +**Evidence count:** 0 + +## SSDL Sketch for ToolSpec + +_(placeholder; candidate aggregate)_ + + +## Frequency + +**Dominant frequency:** unknown +**Evidence count:** 0 + +## Result coverage + +**Summary:** + +| metric | value | +|---|---| +| total producers | 0 | +| result producers | 0 | +| total consumers | 0 | +| result consumers | 0 | + +## Type alias coverage + +**Summary:** + +| metric | value | +|---|---| +| total field-access sites | 0 | +| typed sites (canonical field) | 0 | +| untyped sites (wildcard) | 0 | + +## Cross-audit findings + +_(no cross-audit findings mapped to this aggregate)_ + +## Decomposition cost + +**Current cost estimate:** 0 us/turn +**Componentize savings:** 0 us/turn +**Unify savings:** 0 us/turn +**Recommended direction:** insufficient_data +**Rationale:** candidate aggregate; would be detected after any_type_componentization_20260621 merges +**Struct field count (estimated):** 0 +**Struct frozen:** False + +## Struct shape (inferred from producer returns) + +_(no producers; cannot infer shape)_ + +## Optimization candidates + +_(no optimization candidates generated)_ + +## Verdict + +candidate aggregate; would be detected after any_type_componentization_20260621 merges + +## Evidence appendix