feat(audit): MVP output - AUDIT_REPORT.md only, move stale to _stale/

MVP pipeline simplification:
- render_rollups() now produces ONLY summary.md + AUDIT_REPORT.md
- run_audit() now produces only per-aggregate .md (no .dsl/.tree)
- New src/code_path_audit_gen.py generates the single coherent report

Stale artifacts moved to _stale/ subdirectory (preserved for history):
- 13 per-aggregate .dsl files (redundant with .md)
- 13 per-aggregate .tree files (redundant with .md)
- 9 old top-level rollups (cross_audit_summary, decomposition_matrix,
  candidates, field_usage, call_graph, hot_paths, dead_fields,
  ssdl_analysis, organization_deductions - all superseded by sections
  inlined in AUDIT_REPORT.md)
- _stale/README.md explains what happened

Meta-audit updated to check .md files (14 required H2 sections per
aggregate) instead of .dsl files. 0 violations on 10 real profiles.

Tests: 131 passing. New MVP report: 5000+ lines.
This commit is contained in:
ed
2026-06-22 13:34:29 -04:00
parent f7f616abb9
commit 0b79798eaf
51 changed files with 8111 additions and 10818 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,36 @@
# Stale audit artifacts (pre-alias-resolution)
These files were generated by the previous design of `render_rollups()`
which produced 10 top-level rollups + 13 per-aggregate .dsl/.tree/.md
files = 49 artifacts.
After fixing three real bugs (line numbers were 0, P3 results were
discarded with bare `pass`, only `entry['key']` was counted) and
adding TypeAlias resolution (so `dict[str, Any]` now resolves to all
6 dict-aliases), the audit discovered that:
- 13 .dsl files = redundant with .md files (same data, different format)
- 13 .tree files = redundant with .md files (same data, different format)
- 9 top-level rollups (cross_audit_summary, decomposition_matrix,
candidates, field_usage, call_graph, hot_paths, dead_fields,
ssdl_analysis, organization_deductions) = superseded by sections
inlined in AUDIT_REPORT.md
The MVP design produces:
- `summary.md` (10-line TOC)
- `AUDIT_REPORT.md` (single comprehensive document, 5000+ lines)
- `aggregates/<name>.md` (13 per-aggregate detailed profiles)
These stale files are preserved here for historical reference but are
no longer regenerated by `render_rollups()`. They contain outdated
numbers from before the alias-resolution fix (e.g., 6 of 10
aggregates showed 0 producers/0 consumers in the stale data).
## To regenerate (if needed)
```python
from src.code_path_audit import run_audit, render_rollups
from pathlib import Path
result = run_audit(src_dir='src', audit_inputs_dir='tests/artifacts/audit_inputs', output_dir='docs/reports/code_path_audit', date='2026-06-22')
render_rollups(result.data, Path('docs/reports/code_path_audit/2026-06-22'))
```
@@ -19,15 +19,15 @@
### `src\ai_client.py` (4 producers)
- `src.ai_client._list_gemini_models_result` (line 1626)
- `src.ai_client._list_anthropic_models_result` (line 1317)
- `src.ai_client._list_gemini_models_result` (line 1626)
- `src.ai_client._list_minimax_models_result` (line 2436)
- `src.ai_client._set_minimax_provider_result` (line 398)
### `src\gui_2.py` (2 producers)
- `src.gui_2._render_beads_tab_list_result` (line 8314)
- `src.gui_2._drain_normalize_errors` (line 7417)
- `src.gui_2._render_beads_tab_list_result` (line 8314)
## Consumers (5)
@@ -49,11 +49,11 @@
| consumer | _attr_name | _cached | _module_name | _report_worker_error |
|---|---|---|---|---|
| `__init__` | 1 | 1 | 1 | . |
| `_symbol_resolution_result` | . | . | . | . |
| `_topological_sort_tickets_result` | . | . | . | 1 |
| `__init__` | 1 | 1 | 1 | . |
| `_serialize_tool_calls_result` | . | . | . | . |
| `calculate_track_progress` | . | . | . | . |
| `_serialize_tool_calls_result` | . | . | . | . |
## Access pattern
@@ -69,11 +69,11 @@
```
[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: __init__] [B:check] (branches=0)
-> [4: _serialize_tool_calls_result] [B:check] (branches=2)
-> [5: calculate_track_progress] [B:check] (branches=1)
-> [1: __init__] [B:check] (branches=0)
-> [2: _symbol_resolution_result] [B:check] (branches=4)
-> [3: _topological_sort_tickets_result] [B:check] (branches=2)
-> [4: calculate_track_progress] [B:check] (branches=1)
-> [5: _serialize_tool_calls_result] [B:check] (branches=2)
-> [T:done]
```
@@ -137,10 +137,10 @@
| field | access count | access pattern |
|---|---|---|
| `_report_worker_error` | 1 | used |
| `_module_name` | 1 | used |
| `_attr_name` | 1 | used |
| `_cached` | 1 | used |
| `_report_worker_error` | 1 | used |
## Optimization candidates
@@ -156,18 +156,18 @@ CommsLog: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5,
| function | pattern | field_accesses | confidence |
|---|---|---|---|
| `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.gui_2.__init__` | `field_by_field` | `_module_name`=1, `_attr_name`=1, `_cached`=1 | high |
| `src.app_controller._serialize_tool_calls_result` | `whole_struct` | | low |
| `src.project_manager.calculate_track_progress` | `whole_struct` | | low |
| `src.app_controller._serialize_tool_calls_result` | `whole_struct` | | low |
### Frequency evidence
| function | frequency | source | note |
|---|---|---|---|
| `src.gui_2._render_beads_tab_list_result` | `per_turn` | `static_analysis` | producer from src\gui_2.py |
| `src.gui_2._drain_normalize_errors` | `per_turn` | `static_analysis` | producer from src\gui_2.py |
| `src.ai_client._list_gemini_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.ai_client._list_anthropic_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.ai_client._list_minimax_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.ai_client._set_minimax_provider_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.gui_2._drain_normalize_errors` | `per_turn` | `static_analysis` | producer from src\gui_2.py |
@@ -23,274 +23,274 @@
### `src\ai_client.py` (16 producers)
- `src.ai_client._extract_dashscope_tool_calls` (line 2754)
- `src.ai_client._dashscope_call` (line 2716)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client._parse_tool_args_result` (line 741)
- `src.ai_client._build_chunked_context_blocks` (line 1281)
- `src.ai_client._get_anthropic_tools` (line 664)
- `src.ai_client._get_deepseek_tools` (line 1194)
- `src.ai_client._pre_dispatch` (line 2089)
- `src.ai_client.get_gemini_cache_stats` (line 1604)
- `src.ai_client._load_credentials` (line 282)
- `src.ai_client.get_token_stats` (line 3185)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client.get_comms_log` (line 273)
- `src.ai_client._content_block_to_dict` (line 1200)
- `src.ai_client._parse_tool_args_result` (line 741)
- `src.ai_client._get_anthropic_tools` (line 664)
- `src.ai_client._dashscope_call` (line 2716)
- `src.ai_client._pre_dispatch` (line 2089)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._load_credentials` (line 282)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client.get_token_stats` (line 3185)
- `src.ai_client._add_bleed_derived` (line 3332)
- `src.ai_client._send_cli_round_result` (line 1746)
- `src.ai_client._extract_dashscope_tool_calls` (line 2754)
- `src.ai_client.get_gemini_cache_stats` (line 1604)
- `src.ai_client._get_deepseek_tools` (line 1194)
- `src.ai_client._content_block_to_dict` (line 1200)
- `src.ai_client._build_chunked_context_blocks` (line 1281)
### `src\api_hook_client.py` (39 producers)
- `src.api_hook_client.get_warmup_wait` (line 332)
- `src.api_hook_client.wait_for_event` (line 136)
- `src.api_hook_client.clear_events` (line 129)
- `src.api_hook_client.get_warmup_status` (line 325)
- `src.api_hook_client.get_project` (line 367)
- `src.api_hook_client.get_mma_workers` (line 546)
- `src.api_hook_client.reject_patch` (line 288)
- `src.api_hook_client.get_gui_state` (line 165)
- `src.api_hook_client.get_events` (line 124)
- `src.api_hook_client.post_project` (line 473)
- `src.api_hook_client.get_session` (line 502)
- `src.api_hook_client.get_io_pool_status` (line 420)
- `src.api_hook_client.trigger_patch` (line 274)
- `src.api_hook_client.get_node_status` (line 532)
- `src.api_hook_client.click` (line 223)
- `src.api_hook_client.get_startup_timeline` (line 353)
- `src.api_hook_client.select_tab` (line 263)
- `src.api_hook_client.reject_patch` (line 288)
- `src.api_hook_client.clear_events` (line 129)
- `src.api_hook_client.post_gui` (line 149)
- `src.api_hook_client.get_warmup_status` (line 325)
- `src.api_hook_client.select_list_item` (line 256)
- `src.api_hook_client.get_gui_health` (line 434)
- `src.api_hook_client.wait_for_event` (line 136)
- `src.api_hook_client.post_project` (line 470)
- `src.api_hook_client.apply_patch` (line 281)
- `src.api_hook_client.get_project_switch_status` (line 374)
- `src.api_hook_client.get_io_pool_status` (line 420)
- `src.api_hook_client.get_financial_metrics` (line 520)
- `src.api_hook_client.drag` (line 230)
- `src.api_hook_client.get_warmup_canaries` (line 342)
- `src.api_hook_client.get_gui_diagnostics` (line 311)
- `src.api_hook_client.trigger_patch` (line 274)
- `src.api_hook_client.get_project` (line 367)
- `src.api_hook_client.get_events` (line 124)
- `src.api_hook_client.get_warmup_wait` (line 332)
- `src.api_hook_client.set_value` (line 212)
- `src.api_hook_client.get_mma_status` (line 539)
- `src.api_hook_client.post_session` (line 117)
- `src.api_hook_client.wait_for_project_switch` (line 389)
- `src.api_hook_client.get_performance` (line 318)
- `src.api_hook_client.get_system_telemetry` (line 524)
- `src.api_hook_client.push_event` (line 156)
- `src.api_hook_client.get_gui_state` (line 165)
- `src.api_hook_client._make_request` (line 65)
- `src.api_hook_client.get_status` (line 105)
- `src.api_hook_client.get_context_state` (line 491)
- `src.api_hook_client.set_value` (line 212)
- `src.api_hook_client.post_gui` (line 149)
- `src.api_hook_client.get_gui_diagnostics` (line 311)
- `src.api_hook_client.get_mma_status` (line 539)
- `src.api_hook_client.get_startup_timeline` (line 353)
- `src.api_hook_client.get_node_status` (line 532)
- `src.api_hook_client.get_performance` (line 318)
- `src.api_hook_client.post_session` (line 117)
- `src.api_hook_client.push_event` (line 156)
- `src.api_hook_client.get_warmup_canaries` (line 342)
- `src.api_hook_client.drag` (line 230)
- `src.api_hook_client.apply_patch` (line 281)
- `src.api_hook_client.post_project` (line 470)
- `src.api_hook_client.get_patch_status` (line 295)
- `src.api_hook_client.wait_for_project_switch` (line 389)
- `src.api_hook_client.click` (line 223)
- `src.api_hook_client.select_list_item` (line 256)
- `src.api_hook_client.get_project_switch_status` (line 374)
- `src.api_hook_client.get_system_telemetry` (line 524)
- `src.api_hook_client._make_request` (line 65)
- `src.api_hook_client.select_tab` (line 263)
- `src.api_hook_client.get_session` (line 502)
- `src.api_hook_client.get_mma_workers` (line 546)
- `src.api_hook_client.right_click` (line 237)
- `src.api_hook_client.get_financial_metrics` (line 520)
- `src.api_hook_client.get_patch_status` (line 295)
### `src\app_controller.py` (30 producers)
- `src.app_controller.wait` (line 5205)
- `src.app_controller._pending_mma_spawn` (line 2772)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller._api_get_diagnostics` (line 202)
- `src.app_controller.get_gui_state` (line 2829)
- `src.app_controller.load_config` (line 5142)
- `src.app_controller._api_get_session` (line 374)
- `src.app_controller._api_pending_actions` (line 335)
- `src.app_controller.get_context` (line 2892)
- `src.app_controller.token_stats` (line 2898)
- `src.app_controller._api_get_api_project` (line 188)
- `src.app_controller._api_get_context` (line 398)
- `src.app_controller._api_token_stats` (line 417)
- `src.app_controller.get_mma_status` (line 2835)
- `src.app_controller._api_get_performance` (line 195)
- `src.app_controller._api_get_api_session` (line 170)
- `src.app_controller._api_get_gui_state` (line 123)
- `src.app_controller.get_performance` (line 2856)
- `src.app_controller.pending_actions` (line 2874)
- `src.app_controller.status` (line 2865)
- `src.app_controller._api_get_mma_status` (line 144)
- `src.app_controller.generate` (line 2868)
- `src.app_controller.get_api_project` (line 2853)
- `src.app_controller._api_status` (line 209)
- `src.app_controller._api_generate` (line 221)
- `src.app_controller.get_session` (line 2883)
- `src.app_controller.get_diagnostics` (line 2862)
- `src.app_controller.get_session_insights` (line 3049)
- `src.app_controller._pending_mma_approval` (line 2776)
- `src.app_controller.get_api_session` (line 2847)
- `src.app_controller._api_get_gui_state` (line 123)
- `src.app_controller.get_api_project` (line 2853)
- `src.app_controller._api_get_performance` (line 195)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller.get_gui_state` (line 2829)
- `src.app_controller.get_performance` (line 2856)
- `src.app_controller._api_status` (line 209)
- `src.app_controller._api_get_mma_status` (line 144)
- `src.app_controller.get_mma_status` (line 2835)
- `src.app_controller._pending_mma_spawn` (line 2772)
- `src.app_controller.get_diagnostics` (line 2862)
- `src.app_controller._api_pending_actions` (line 335)
- `src.app_controller._api_token_stats` (line 417)
- `src.app_controller.wait` (line 5205)
- `src.app_controller.pending_actions` (line 2874)
- `src.app_controller.load_config` (line 5142)
- `src.app_controller._pending_mma_approval` (line 2776)
- `src.app_controller._api_get_diagnostics` (line 202)
- `src.app_controller.get_context` (line 2892)
- `src.app_controller.get_session` (line 2883)
- `src.app_controller._api_get_api_project` (line 188)
- `src.app_controller.get_session_insights` (line 3049)
- `src.app_controller._api_get_session` (line 374)
- `src.app_controller.token_stats` (line 2898)
- `src.app_controller._api_generate` (line 221)
- `src.app_controller.status` (line 2865)
- `src.app_controller.generate` (line 2868)
### `src\models.py` (23 producers)
- `src.models.to_dict` (line 646)
- `src.models.to_dict` (line 406)
- `src.models.to_dict` (line 855)
- `src.models.to_dict` (line 938)
- `src.models.to_dict` (line 1059)
- `src.models.parse_history_entries` (line 214)
- `src.models.to_dict` (line 288)
- `src.models.to_dict` (line 794)
- `src.models.to_dict` (line 1000)
- `src.models.to_dict` (line 672)
- `src.models.to_dict` (line 355)
- `src.models.to_dict` (line 486)
- `src.models.to_dict` (line 913)
- `src.models.to_dict` (line 596)
- `src.models.to_dict` (line 886)
- `src.models.to_dict` (line 701)
- `src.models.to_dict` (line 558)
- `src.models._load_config_from_disk` (line 186)
- `src.models.to_dict` (line 441)
- `src.models.to_dict` (line 1024)
- `src.models.to_dict` (line 971)
- `src.models.to_dict` (line 288)
- `src.models.to_dict` (line 737)
- `src.models.to_dict` (line 486)
- `src.models.to_dict` (line 618)
- `src.models.to_dict` (line 701)
- `src.models.to_dict` (line 886)
- `src.models.to_dict` (line 971)
- `src.models._load_config_from_disk` (line 186)
- `src.models.to_dict` (line 406)
- `src.models.to_dict` (line 646)
- `src.models.to_dict` (line 672)
- `src.models.to_dict` (line 355)
- `src.models.to_dict` (line 1059)
- `src.models.to_dict` (line 855)
- `src.models.to_dict` (line 1000)
- `src.models.parse_history_entries` (line 214)
- `src.models.to_dict` (line 938)
### `src\project_manager.py` (8 producers)
- `src.project_manager.get_all_tracks` (line 342)
- `src.project_manager.load_history` (line 209)
- `src.project_manager.str_to_entry` (line 75)
- `src.project_manager.load_project` (line 186)
- `src.project_manager.default_discussion` (line 117)
- `src.project_manager.default_project` (line 123)
- `src.project_manager.migrate_from_legacy_config` (line 253)
- `src.project_manager.flat_config` (line 267)
- `src.project_manager.load_project` (line 186)
- `src.project_manager.default_discussion` (line 117)
- `src.project_manager.get_all_tracks` (line 342)
## Consumers (66)
### `src\aggregate.py` (5 consumers)
- `src.aggregate.build_markdown_from_items` (line 348)
- `src.aggregate.build_tier3_context` (line 382)
- `src.aggregate.build_markdown_no_history` (line 366)
- `src.aggregate.run` (line 479)
- `src.aggregate._build_files_section_from_items` (line 300)
- `src.aggregate.build_markdown_from_items` (line 348)
- `src.aggregate.run` (line 479)
- `src.aggregate.build_markdown_no_history` (line 366)
### `src\ai_client.py` (29 consumers)
- `src.ai_client._invalidate_token_estimate` (line 1240)
- `src.ai_client._create_gemini_cache_result` (line 1706)
- `src.ai_client._send_grok` (line 2530)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client._send_gemini_cli` (line 2019)
- `src.ai_client._send_gemini` (line 1802)
- `src.ai_client._send_anthropic` (line 1405)
- `src.ai_client._trim_anthropic_history` (line 1353)
- `src.ai_client._send_llama` (line 2858)
- `src.ai_client._repair_minimax_history` (line 2462)
- `src.ai_client._strip_stale_file_refreshes` (line 1253)
- `src.ai_client._send_deepseek` (line 2165)
- `src.ai_client._add_bleed_derived` (line 3332)
- `src.ai_client._send_llama_native` (line 2958)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._send_qwen` (line 2773)
- `src.ai_client._repair_deepseek_history` (line 2138)
- `src.ai_client._execute_single_tool_call_async` (line 945)
- `src.ai_client._repair_anthropic_history` (line 1381)
- `src.ai_client._strip_cache_controls` (line 1291)
- `src.ai_client._dashscope_call` (line 2716)
- `src.ai_client._estimate_prompt_tokens` (line 1243)
- `src.ai_client._append_comms` (line 257)
- `src.ai_client._estimate_message_tokens` (line 1218)
- `src.ai_client._add_history_cache_breakpoint` (line 1299)
- `src.ai_client._send_grok` (line 2530)
- `src.ai_client._create_gemini_cache_result` (line 1706)
- `src.ai_client._send_deepseek` (line 2165)
- `src.ai_client._send_gemini_cli` (line 2019)
- `src.ai_client._send_qwen` (line 2773)
- `src.ai_client._repair_anthropic_history` (line 1381)
- `src.ai_client._pre_dispatch` (line 2089)
- `src.ai_client._trim_minimax_history` (line 2482)
- `src.ai_client._send_minimax` (line 2616)
- `src.ai_client._strip_stale_file_refreshes` (line 1253)
- `src.ai_client._send_anthropic` (line 1405)
- `src.ai_client._invalidate_token_estimate` (line 1240)
- `src.ai_client._add_bleed_derived` (line 3332)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._trim_anthropic_history` (line 1353)
- `src.ai_client.send` (line 3208)
- `src.ai_client._estimate_message_tokens` (line 1218)
- `src.ai_client._append_comms` (line 257)
- `src.ai_client._repair_deepseek_history` (line 2138)
- `src.ai_client._add_history_cache_breakpoint` (line 1299)
- `src.ai_client._trim_minimax_history` (line 2482)
- `src.ai_client._send_gemini` (line 1802)
- `src.ai_client._execute_single_tool_call_async` (line 945)
- `src.ai_client._send_llama_native` (line 2958)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client._send_minimax` (line 2616)
- `src.ai_client._repair_minimax_history` (line 2462)
- `src.ai_client._dashscope_call` (line 2716)
### `src\app_controller.py` (5 consumers)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller._on_comms_entry` (line 4282)
- `src.app_controller._start_track_logic_result` (line 4728)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller._refresh_api_metrics` (line 3074)
- `src.app_controller._on_comms_entry` (line 4282)
- `src.app_controller._start_track_logic` (line 4721)
### `src\models.py` (22 consumers)
- `src.models.from_dict` (line 920)
- `src.models.from_dict` (line 603)
- `src.models.from_dict` (line 506)
- `src.models.from_dict` (line 814)
- `src.models.from_dict` (line 893)
- `src.models.from_dict` (line 378)
- `src.models.from_dict` (line 1038)
- `src.models.from_dict` (line 1007)
- `src.models.from_dict` (line 747)
- `src.models.from_dict` (line 683)
- `src.models.from_dict` (line 712)
- `src.models.from_dict` (line 866)
- `src.models.from_dict` (line 454)
- `src.models.from_dict` (line 575)
- `src.models.from_dict` (line 630)
- `src.models.from_dict` (line 712)
- `src.models.from_dict` (line 747)
- `src.models._save_config_to_disk` (line 199)
- `src.models.from_dict` (line 575)
- `src.models.from_dict` (line 683)
- `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 295)
- `src.models.from_dict` (line 416)
- `src.models.from_dict` (line 656)
- `src.models.from_dict` (line 1072)
- `src.models.from_dict` (line 295)
- `src.models.from_dict` (line 656)
- `src.models.from_dict` (line 416)
- `src.models.from_dict` (line 603)
- `src.models.from_dict` (line 920)
- `src.models.from_dict` (line 814)
- `src.models.from_dict` (line 506)
- `src.models.from_dict` (line 893)
- `src.models.from_dict` (line 378)
### `src\project_manager.py` (5 consumers)
- `src.project_manager.save_project` (line 229)
- `src.project_manager.format_discussion` (line 69)
- `src.project_manager.entry_to_str` (line 49)
- `src.project_manager.flat_config` (line 267)
- `src.project_manager.save_project` (line 229)
- `src.project_manager.migrate_from_legacy_config` (line 253)
## Field access matrix
| consumer | _offload_entry_payload | _pending_comms | _pending_comms_lock | _pending_gui_tasks | _pending_gui_tasks_lock | _pending_history_adds | _pending_history_adds_lock | _token_history | _topological_sort_tickets_result | active_discussion | active_project_path | active_project_root | ai_status | append | config | content | context_files | discussion | encode | engines |
| consumer | _est_tokens | _gemini_cache_text | _offload_entry_payload | _pending_comms | _pending_comms_lock | _pending_gui_tasks | _pending_gui_tasks_lock | _pending_history_adds | _pending_history_adds_lock | _recalculate_session_usage | _token_history | _token_stats | _topological_sort_tickets_result | _update_cached_stats | active_discussion | active_project_path | active_project_root | ai_status | append | config |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| `_invalidate_token_estimate` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `build_markdown_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_create_gemini_cache_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_grok` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_strip_private_keys` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_send_gemini_cli` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_send_gemini` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_send_anthropic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `save_project` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 2 | . | . |
| `_trim_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_llama` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `build_tier3_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_offload_entry_payload` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `entry_to_str` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_strip_stale_file_refreshes` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_deepseek` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_add_bleed_derived` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `build_markdown_no_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `flat_config` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_llama_native` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `ollama_chat` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_qwen` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_on_comms_entry` | 1 | 1 | 1 | . | . | 4 | 4 | 1 | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_repair_deepseek_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_execute_single_tool_call_async` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_repair_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_strip_cache_controls` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `run` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_save_config_to_disk` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_dashscope_call` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_start_track_logic_result` | . | . | . | 2 | 2 | . | . | . | 1 | 1 | 1 | 1 | 4 | . | 1 | . | 1 | . | . | 1 |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_estimate_prompt_tokens` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `build_tier3_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_grok` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_create_gemini_cache_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_deepseek` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_gemini_cli` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_build_files_section_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `build_markdown_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_qwen` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_pre_dispatch` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_save_config_to_disk` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_strip_stale_file_refreshes` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `run` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_anthropic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_invalidate_token_estimate` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_add_bleed_derived` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_start_track_logic_result` | . | . | . | . | . | 2 | 2 | . | . | . | . | . | 1 | . | 1 | 1 | 1 | 4 | . | 1 |
| `entry_to_str` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `ollama_chat` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_trim_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_offload_entry_payload` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `send` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 |
| `_estimate_message_tokens` | 1 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_refresh_api_metrics` | . | 1 | . | . | . | . | . | . | . | 1 | . | 1 | . | 1 | . | . | . | . | . | . |
| `_on_comms_entry` | . | . | 1 | 1 | 1 | . | . | 4 | 4 | . | 1 | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_append_comms` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_deepseek_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_add_history_cache_breakpoint` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_trim_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_gemini` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `flat_config` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
_... 23 more fields_
_... 32 more fields_
## Access pattern
@@ -300,79 +300,79 @@ _... 23 more fields_
**Per-function pattern distribution:**
- `whole_struct`: 28 functions (56%)
- `mixed`: 18 functions (36%)
- `field_by_field`: 4 functions (8%)
- `mixed`: 17 functions (34%)
- `field_by_field`: 5 functions (10%)
## SSDL Sketch for `CommsLogEntry`
```
[Q:CommsLogEntry entry-point] -> [Q:PCG lookup]
-> [1: _invalidate_token_estimate] [B:check] (branches=0)
-> [1: _send_llama] [B:check] (branches=13)
-> [2: from_dict] [B:check] (branches=0)
-> [3: build_markdown_from_items] [B:check] (branches=9)
-> [4: from_dict] [B:check] (branches=0)
-> [5: _create_gemini_cache_result] [B:check] (branches=3)
-> [6: _send_grok] [B:check] (branches=14)
-> [7: _strip_private_keys] [B:check] (branches=0)
-> [8: from_dict] [B:check] (branches=0)
-> [9: _send_gemini_cli] [B:is None?] (branches=23) [N:safe]
-> [10: from_dict] [B:check] (branches=0)
-> [11: from_dict] [B:check] (branches=0)
-> [12: _send_gemini] [B:is None?] (branches=75) [N:safe]
-> [3: _strip_cache_controls] [B:check] (branches=4)
-> [4: _estimate_prompt_tokens] [B:check] (branches=2)
-> [5: build_tier3_context] [B:check] (branches=50)
-> [6: format_discussion] [B:check] (branches=0)
-> [7: _send_grok] [B:check] (branches=14)
-> [8: _create_gemini_cache_result] [B:check] (branches=3)
-> [9: _send_deepseek] [B:check] (branches=71)
-> [10: _send_gemini_cli] [B:is None?] (branches=23) [N:safe]
-> [11: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe]
-> [12: from_dict] [B:check] (branches=0)
-> [13: from_dict] [B:check] (branches=0)
-> [14: from_dict] [B:check] (branches=0)
-> [15: _send_anthropic] [B:is None?] (branches=40) [N:safe]
-> [16: save_project] [B:is None?] (branches=7) [N:safe]
-> [17: _trim_anthropic_history] [B:check] (branches=13)
-> [18: _send_llama] [B:check] (branches=13)
-> [19: build_tier3_context] [B:check] (branches=50)
-> [20: _offload_entry_payload] [B:check] (branches=10)
-> [21: format_discussion] [B:check] (branches=0)
-> [22: entry_to_str] [B:check] (branches=3)
-> [23: _repair_minimax_history] [B:check] (branches=10)
-> [14: build_markdown_from_items] [B:check] (branches=9)
-> [15: from_dict] [B:check] (branches=0)
-> [16: _send_qwen] [B:check] (branches=9)
-> [17: _repair_anthropic_history] [B:check] (branches=6)
-> [18: from_dict] [B:check] (branches=0)
-> [19: _pre_dispatch] [B:check] (branches=8)
-> [20: _save_config_to_disk] [B:check] (branches=1)
-> [21: from_dict] [B:check] (branches=0)
-> [22: from_dict] [B:check] (branches=0)
-> [23: from_dict] [B:check] (branches=0)
-> [24: from_dict] [B:check] (branches=0)
-> [25: from_dict] [B:check] (branches=0)
-> [26: _strip_stale_file_refreshes] [B:check] (branches=12)
-> [27: _send_deepseek] [B:check] (branches=71)
-> [28: _add_bleed_derived] [B:check] (branches=0)
-> [29: from_dict] [B:check] (branches=0)
-> [30: build_markdown_no_history] [B:check] (branches=0)
-> [31: flat_config] [B:check] (branches=2)
-> [32: _send_llama_native] [B:check] (branches=12)
-> [33: ollama_chat] [B:check] (branches=3)
-> [34: _send_qwen] [B:check] (branches=9)
-> [35: _on_comms_entry] [B:check] (branches=32)
-> [25: _strip_stale_file_refreshes] [B:check] (branches=12)
-> [26: run] [B:check] (branches=1)
-> [27: _send_anthropic] [B:is None?] (branches=40) [N:safe]
-> [28: _invalidate_token_estimate] [B:check] (branches=0)
-> [29: _add_bleed_derived] [B:check] (branches=0)
-> [30: _start_track_logic_result] [B:check] (branches=10)
-> [31: entry_to_str] [B:check] (branches=3)
-> [32: ollama_chat] [B:check] (branches=3)
-> [33: _trim_anthropic_history] [B:check] (branches=13)
-> [34: _offload_entry_payload] [B:check] (branches=10)
-> [35: from_dict] [B:check] (branches=0)
-> [36: from_dict] [B:check] (branches=0)
-> [37: from_dict] [B:check] (branches=0)
-> [38: _repair_deepseek_history] [B:check] (branches=6)
-> [39: from_dict] [B:check] (branches=0)
-> [40: from_dict] [B:check] (branches=0)
-> [41: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe]
-> [38: send] [B:check] (branches=19)
-> [39: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe]
-> [40: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe]
-> [41: _on_comms_entry] [B:check] (branches=32)
-> [42: from_dict] [B:check] (branches=0)
-> [43: _repair_anthropic_history] [B:check] (branches=6)
-> [44: _strip_cache_controls] [B:check] (branches=4)
-> [45: run] [B:check] (branches=1)
-> [46: _save_config_to_disk] [B:check] (branches=1)
-> [47: _dashscope_call] [B:check] (branches=5)
-> [48: _start_track_logic_result] [B:check] (branches=10)
-> [49: from_dict] [B:check] (branches=0)
-> [50: _estimate_prompt_tokens] [B:check] (branches=2)
-> [51: _append_comms] [B:is None?] (branches=1) [N:safe]
-> [52: from_dict] [B:check] (branches=0)
-> [53: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe]
-> [54: _add_history_cache_breakpoint] [B:check] (branches=5)
-> [55: _pre_dispatch] [B:check] (branches=8)
-> [43: _append_comms] [B:is None?] (branches=1) [N:safe]
-> [44: from_dict] [B:check] (branches=0)
-> [45: _repair_deepseek_history] [B:check] (branches=6)
-> [46: from_dict] [B:check] (branches=0)
-> [47: _add_history_cache_breakpoint] [B:check] (branches=5)
-> [48: _trim_minimax_history] [B:check] (branches=8)
-> [49: _send_gemini] [B:is None?] (branches=75) [N:safe]
-> [50: flat_config] [B:check] (branches=2)
-> [51: save_project] [B:is None?] (branches=7) [N:safe]
-> [52: build_markdown_no_history] [B:check] (branches=0)
-> [53: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe]
-> [54: _send_llama_native] [B:check] (branches=12)
-> [55: _strip_private_keys] [B:check] (branches=0)
-> [56: from_dict] [B:check] (branches=0)
-> [57: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe]
-> [58: _trim_minimax_history] [B:check] (branches=8)
-> [59: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe]
-> [60: _start_track_logic] [B:check] (branches=1)
-> [61: from_dict] [B:check] (branches=0)
-> [62: from_dict] [B:check] (branches=0)
-> [63: from_dict] [B:check] (branches=0)
-> [64: migrate_from_legacy_config] [B:check] (branches=2)
-> [65: _send_minimax] [B:check] (branches=11)
-> [66: send] [B:check] (branches=19)
-> [57: from_dict] [B:check] (branches=0)
-> [58: _send_minimax] [B:check] (branches=11)
-> [59: from_dict] [B:check] (branches=0)
-> [60: from_dict] [B:check] (branches=0)
-> [61: _repair_minimax_history] [B:check] (branches=10)
-> [62: _start_track_logic] [B:check] (branches=1)
-> [63: migrate_from_legacy_config] [B:check] (branches=2)
-> [64: _dashscope_call] [B:check] (branches=5)
-> [65: from_dict] [B:check] (branches=0)
-> [66: from_dict] [B:check] (branches=0)
-> [T:done]
```
@@ -384,8 +384,8 @@ _... 23 more fields_
- **Nil Sentinel `[N]`**: Introduce a module-level `NIL_<AGGREGATE>` 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 135 field-check branches to 1 cache lookup.
- Effective codepaths: 40140116231395706750390 -> 135
- **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 148 field-check branches to 1 cache lookup.
- Effective codepaths: 40140116231395706750390 -> 148
- **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
@@ -412,13 +412,13 @@ _... 23 more fields_
## Type alias coverage
**Summary:** 135 sites; 0 typed (0%); 135 untyped (100%)
**Summary:** 148 sites; 0 typed (0%); 148 untyped (100%)
| metric | value |
|---|---|
| total field-access sites | 135 |
| total field-access sites | 148 |
| typed sites (canonical field) | 0 |
| untyped sites (wildcard) | 135 |
| untyped sites (wildcard) | 148 |
## Cross-audit findings
@@ -438,14 +438,15 @@ _(no cross-audit findings mapped to this aggregate)_
| field | access count | access pattern |
|---|---|---|
| `content` | 16 | hot |
| `marker` | 16 | hot |
| `get` | 7 | hot |
| `append` | 3 | hot |
| `pop` | 2 | used |
| `files` | 2 | used |
| `encode` | 1 | used |
| `discussion` | 1 | used |
| `content` | 15 | hot |
| `marker` | 15 | hot |
| `get` | 8 | hot |
| `pop` | 3 | hot |
| `append` | 2 | used |
| `config` | 2 | used |
| `session_usage` | 2 | used |
| `output` | 1 | used |
| `files` | 1 | used |
| `estimated_prompt_tokens` | 1 | used |
| `max_prompt_tokens` | 1 | used |
| `utilization_pct` | 1 | used |
@@ -454,17 +455,6 @@ _(no cross-audit findings mapped to this aggregate)_
| `sys_tokens` | 1 | used |
| `tool_tokens` | 1 | used |
| `history_tokens` | 1 | used |
| `local_ts` | 1 | used |
| `_offload_entry_payload` | 1 | used |
| `ui_auto_add_history` | 1 | used |
| `_pending_comms_lock` | 1 | used |
| `session_usage` | 1 | used |
| `_pending_history_adds_lock` | 1 | used |
| `_token_history` | 1 | used |
| `_pending_comms` | 1 | used |
| `_pending_history_adds` | 1 | used |
| `items` | 1 | used |
| `output` | 1 | used |
| `ai_status` | 1 | used |
| `context_files` | 1 | used |
| `_pending_gui_tasks_lock` | 1 | used |
@@ -476,11 +466,30 @@ _(no cross-audit findings mapped to this aggregate)_
| `active_discussion` | 1 | used |
| `submit_io` | 1 | used |
| `tracks` | 1 | used |
| `config` | 1 | used |
| `mma_tier_usage` | 1 | used |
| `_pending_gui_tasks` | 1 | used |
| `mma_step_mode` | 1 | used |
| `active_project_path` | 1 | used |
| `search` | 1 | used |
| `_est_tokens` | 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 |
| `usage` | 1 | used |
| `local_ts` | 1 | used |
| `_offload_entry_payload` | 1 | used |
| `ui_auto_add_history` | 1 | used |
| `_pending_comms_lock` | 1 | used |
| `_pending_history_adds_lock` | 1 | used |
| `_token_history` | 1 | used |
| `_pending_comms` | 1 | used |
| `_pending_history_adds` | 1 | used |
| `encode` | 1 | used |
## Optimization candidates
@@ -496,63 +505,63 @@ CommsLogEntry: access_pattern=whole_struct, frequency=per_turn, struct_field_cou
| function | pattern | field_accesses | confidence |
|---|---|---|---|
| `src.ai_client._invalidate_token_estimate` | `whole_struct` | `pop`=1 | high |
| `src.ai_client._send_llama` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._strip_cache_controls` | `whole_struct` | | low |
| `src.ai_client._estimate_prompt_tokens` | `whole_struct` | | low |
| `src.aggregate.build_tier3_context` | `whole_struct` | | low |
| `src.project_manager.format_discussion` | `whole_struct` | | low |
| `src.ai_client._send_grok` | `whole_struct` | | low |
| `src.ai_client._create_gemini_cache_result` | `whole_struct` | | low |
| `src.ai_client._send_deepseek` | `whole_struct` | | low |
| `src.ai_client._send_gemini_cli` | `whole_struct` | | low |
| `src.aggregate._build_files_section_from_items` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.aggregate.build_markdown_from_items` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._create_gemini_cache_result` | `whole_struct` | | low |
| `src.ai_client._send_grok` | `whole_struct` | | low |
| `src.ai_client._strip_private_keys` | `whole_struct` | | low |
| `src.ai_client._send_qwen` | `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.ai_client._send_gemini_cli` | `whole_struct` | | low |
| `src.ai_client._pre_dispatch` | `whole_struct` | | low |
| `src.models._save_config_to_disk` | `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.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.project_manager.save_project` | `mixed` | `discussion`=2, `files`=3 | high |
| `src.ai_client._trim_anthropic_history` | `whole_struct` | `pop`=5 | high |
| `src.ai_client._send_llama` | `whole_struct` | | low |
| `src.aggregate.build_tier3_context` | `whole_struct` | | low |
| `src.app_controller._offload_entry_payload` | `whole_struct` | | low |
| `src.project_manager.format_discussion` | `whole_struct` | | low |
| `src.project_manager.entry_to_str` | `whole_struct` | `get`=4 | high |
| `src.ai_client._repair_minimax_history` | `whole_struct` | `append`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._strip_stale_file_refreshes` | `whole_struct` | | low |
| `src.ai_client._send_deepseek` | `whole_struct` | | low |
| `src.aggregate.run` | `field_by_field` | `output`=1, `files`=2, `get`=7 | high |
| `src.ai_client._send_anthropic` | `whole_struct` | | low |
| `src.ai_client._invalidate_token_estimate` | `whole_struct` | `pop`=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.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.aggregate.build_markdown_no_history` | `whole_struct` | | low |
| `src.project_manager.flat_config` | `whole_struct` | `get`=7 | high |
| `src.ai_client._send_llama_native` | `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.project_manager.entry_to_str` | `whole_struct` | `get`=4 | high |
| `src.ai_client.ollama_chat` | `whole_struct` | | low |
| `src.ai_client._send_qwen` | `whole_struct` | | low |
| `src.ai_client._trim_anthropic_history` | `whole_struct` | `pop`=5 | high |
| `src.app_controller._offload_entry_payload` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client.send` | `mixed` | `config`=1, `search`=1 | high |
| `src.ai_client._estimate_message_tokens` | `mixed` | `_est_tokens`=1, `get`=2 | high |
| `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.app_controller._on_comms_entry` | `field_by_field` | `local_ts`=1, `_offload_entry_payload`=1, `get`=7, `ui_auto_add_history`=3, `_pending_comms_lock`=1, `session_usage`=5, `_pending_history_adds_lock`=4, `_token_history`=1, `_pending_comms`=1, `_pending_history_adds`=4 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._append_comms` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._repair_deepseek_history` | `whole_struct` | `append`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `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_anthropic_history` | `whole_struct` | `append`=1 | high |
| `src.ai_client._strip_cache_controls` | `whole_struct` | | low |
| `src.aggregate.run` | `field_by_field` | `output`=1, `files`=2, `get`=7 | high |
| `src.models._save_config_to_disk` | `whole_struct` | | low |
| `src.ai_client._dashscope_call` | `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.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._estimate_prompt_tokens` | `whole_struct` | | low |
| `src.ai_client._add_history_cache_breakpoint` | `whole_struct` | | low |
| `src.ai_client._trim_minimax_history` | `whole_struct` | `pop`=4 | high |
| `src.ai_client._send_gemini` | `whole_struct` | `encode`=1 | high |
| `src.project_manager.flat_config` | `whole_struct` | `get`=7 | high |
### Frequency evidence
| function | frequency | source | note |
|---|---|---|---|
| `src.ai_client._extract_dashscope_tool_calls` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.api_hook_client.get_warmup_wait` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py |
| `src.app_controller.wait` | `per_turn` | `static_analysis` | producer from src\app_controller.py |
| `src.ai_client._dashscope_call` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.app_controller._pending_mma_spawn` | `per_turn` | `static_analysis` | producer from src\app_controller.py |
| `src.app_controller._api_get_context` | `per_turn` | `static_analysis` | producer from src\app_controller.py |
| `src.ai_client.get_comms_log` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.api_hook_client.post_project` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py |
| `src.api_hook_client.get_node_status` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py |
| `src.models.to_dict` | `per_turn` | `static_analysis` | producer from src\models.py |
@@ -23,274 +23,274 @@
### `src\ai_client.py` (16 producers)
- `src.ai_client._extract_dashscope_tool_calls` (line 2754)
- `src.ai_client._dashscope_call` (line 2716)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client._parse_tool_args_result` (line 741)
- `src.ai_client._build_chunked_context_blocks` (line 1281)
- `src.ai_client._get_anthropic_tools` (line 664)
- `src.ai_client._get_deepseek_tools` (line 1194)
- `src.ai_client._pre_dispatch` (line 2089)
- `src.ai_client.get_gemini_cache_stats` (line 1604)
- `src.ai_client._load_credentials` (line 282)
- `src.ai_client.get_token_stats` (line 3185)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client.get_comms_log` (line 273)
- `src.ai_client._content_block_to_dict` (line 1200)
- `src.ai_client._parse_tool_args_result` (line 741)
- `src.ai_client._get_anthropic_tools` (line 664)
- `src.ai_client._dashscope_call` (line 2716)
- `src.ai_client._pre_dispatch` (line 2089)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._load_credentials` (line 282)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client.get_token_stats` (line 3185)
- `src.ai_client._add_bleed_derived` (line 3332)
- `src.ai_client._send_cli_round_result` (line 1746)
- `src.ai_client._extract_dashscope_tool_calls` (line 2754)
- `src.ai_client.get_gemini_cache_stats` (line 1604)
- `src.ai_client._get_deepseek_tools` (line 1194)
- `src.ai_client._content_block_to_dict` (line 1200)
- `src.ai_client._build_chunked_context_blocks` (line 1281)
### `src\api_hook_client.py` (39 producers)
- `src.api_hook_client.get_warmup_wait` (line 332)
- `src.api_hook_client.wait_for_event` (line 136)
- `src.api_hook_client.clear_events` (line 129)
- `src.api_hook_client.get_warmup_status` (line 325)
- `src.api_hook_client.get_project` (line 367)
- `src.api_hook_client.get_mma_workers` (line 546)
- `src.api_hook_client.reject_patch` (line 288)
- `src.api_hook_client.get_gui_state` (line 165)
- `src.api_hook_client.get_events` (line 124)
- `src.api_hook_client.post_project` (line 473)
- `src.api_hook_client.get_session` (line 502)
- `src.api_hook_client.get_io_pool_status` (line 420)
- `src.api_hook_client.trigger_patch` (line 274)
- `src.api_hook_client.get_node_status` (line 532)
- `src.api_hook_client.click` (line 223)
- `src.api_hook_client.get_startup_timeline` (line 353)
- `src.api_hook_client.select_tab` (line 263)
- `src.api_hook_client.reject_patch` (line 288)
- `src.api_hook_client.clear_events` (line 129)
- `src.api_hook_client.post_gui` (line 149)
- `src.api_hook_client.get_warmup_status` (line 325)
- `src.api_hook_client.select_list_item` (line 256)
- `src.api_hook_client.get_gui_health` (line 434)
- `src.api_hook_client.wait_for_event` (line 136)
- `src.api_hook_client.post_project` (line 470)
- `src.api_hook_client.apply_patch` (line 281)
- `src.api_hook_client.get_project_switch_status` (line 374)
- `src.api_hook_client.get_io_pool_status` (line 420)
- `src.api_hook_client.get_financial_metrics` (line 520)
- `src.api_hook_client.drag` (line 230)
- `src.api_hook_client.get_warmup_canaries` (line 342)
- `src.api_hook_client.get_gui_diagnostics` (line 311)
- `src.api_hook_client.trigger_patch` (line 274)
- `src.api_hook_client.get_project` (line 367)
- `src.api_hook_client.get_events` (line 124)
- `src.api_hook_client.get_warmup_wait` (line 332)
- `src.api_hook_client.set_value` (line 212)
- `src.api_hook_client.get_mma_status` (line 539)
- `src.api_hook_client.post_session` (line 117)
- `src.api_hook_client.wait_for_project_switch` (line 389)
- `src.api_hook_client.get_performance` (line 318)
- `src.api_hook_client.get_system_telemetry` (line 524)
- `src.api_hook_client.push_event` (line 156)
- `src.api_hook_client.get_gui_state` (line 165)
- `src.api_hook_client._make_request` (line 65)
- `src.api_hook_client.get_status` (line 105)
- `src.api_hook_client.get_context_state` (line 491)
- `src.api_hook_client.set_value` (line 212)
- `src.api_hook_client.post_gui` (line 149)
- `src.api_hook_client.get_gui_diagnostics` (line 311)
- `src.api_hook_client.get_mma_status` (line 539)
- `src.api_hook_client.get_startup_timeline` (line 353)
- `src.api_hook_client.get_node_status` (line 532)
- `src.api_hook_client.get_performance` (line 318)
- `src.api_hook_client.post_session` (line 117)
- `src.api_hook_client.push_event` (line 156)
- `src.api_hook_client.get_warmup_canaries` (line 342)
- `src.api_hook_client.drag` (line 230)
- `src.api_hook_client.apply_patch` (line 281)
- `src.api_hook_client.post_project` (line 470)
- `src.api_hook_client.get_patch_status` (line 295)
- `src.api_hook_client.wait_for_project_switch` (line 389)
- `src.api_hook_client.click` (line 223)
- `src.api_hook_client.select_list_item` (line 256)
- `src.api_hook_client.get_project_switch_status` (line 374)
- `src.api_hook_client.get_system_telemetry` (line 524)
- `src.api_hook_client._make_request` (line 65)
- `src.api_hook_client.select_tab` (line 263)
- `src.api_hook_client.get_session` (line 502)
- `src.api_hook_client.get_mma_workers` (line 546)
- `src.api_hook_client.right_click` (line 237)
- `src.api_hook_client.get_financial_metrics` (line 520)
- `src.api_hook_client.get_patch_status` (line 295)
### `src\app_controller.py` (30 producers)
- `src.app_controller.wait` (line 5205)
- `src.app_controller._pending_mma_spawn` (line 2772)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller._api_get_diagnostics` (line 202)
- `src.app_controller.get_gui_state` (line 2829)
- `src.app_controller.load_config` (line 5142)
- `src.app_controller._api_get_session` (line 374)
- `src.app_controller._api_pending_actions` (line 335)
- `src.app_controller.get_context` (line 2892)
- `src.app_controller.token_stats` (line 2898)
- `src.app_controller._api_get_api_project` (line 188)
- `src.app_controller._api_get_context` (line 398)
- `src.app_controller._api_token_stats` (line 417)
- `src.app_controller.get_mma_status` (line 2835)
- `src.app_controller._api_get_performance` (line 195)
- `src.app_controller._api_get_api_session` (line 170)
- `src.app_controller._api_get_gui_state` (line 123)
- `src.app_controller.get_performance` (line 2856)
- `src.app_controller.pending_actions` (line 2874)
- `src.app_controller.status` (line 2865)
- `src.app_controller._api_get_mma_status` (line 144)
- `src.app_controller.generate` (line 2868)
- `src.app_controller.get_api_project` (line 2853)
- `src.app_controller._api_status` (line 209)
- `src.app_controller._api_generate` (line 221)
- `src.app_controller.get_session` (line 2883)
- `src.app_controller.get_diagnostics` (line 2862)
- `src.app_controller.get_session_insights` (line 3049)
- `src.app_controller._pending_mma_approval` (line 2776)
- `src.app_controller.get_api_session` (line 2847)
- `src.app_controller._api_get_gui_state` (line 123)
- `src.app_controller.get_api_project` (line 2853)
- `src.app_controller._api_get_performance` (line 195)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller.get_gui_state` (line 2829)
- `src.app_controller.get_performance` (line 2856)
- `src.app_controller._api_status` (line 209)
- `src.app_controller._api_get_mma_status` (line 144)
- `src.app_controller.get_mma_status` (line 2835)
- `src.app_controller._pending_mma_spawn` (line 2772)
- `src.app_controller.get_diagnostics` (line 2862)
- `src.app_controller._api_pending_actions` (line 335)
- `src.app_controller._api_token_stats` (line 417)
- `src.app_controller.wait` (line 5205)
- `src.app_controller.pending_actions` (line 2874)
- `src.app_controller.load_config` (line 5142)
- `src.app_controller._pending_mma_approval` (line 2776)
- `src.app_controller._api_get_diagnostics` (line 202)
- `src.app_controller.get_context` (line 2892)
- `src.app_controller.get_session` (line 2883)
- `src.app_controller._api_get_api_project` (line 188)
- `src.app_controller.get_session_insights` (line 3049)
- `src.app_controller._api_get_session` (line 374)
- `src.app_controller.token_stats` (line 2898)
- `src.app_controller._api_generate` (line 221)
- `src.app_controller.status` (line 2865)
- `src.app_controller.generate` (line 2868)
### `src\models.py` (23 producers)
- `src.models.to_dict` (line 646)
- `src.models.to_dict` (line 406)
- `src.models.to_dict` (line 855)
- `src.models.to_dict` (line 938)
- `src.models.to_dict` (line 1059)
- `src.models.parse_history_entries` (line 214)
- `src.models.to_dict` (line 288)
- `src.models.to_dict` (line 794)
- `src.models.to_dict` (line 1000)
- `src.models.to_dict` (line 672)
- `src.models.to_dict` (line 355)
- `src.models.to_dict` (line 486)
- `src.models.to_dict` (line 913)
- `src.models.to_dict` (line 596)
- `src.models.to_dict` (line 886)
- `src.models.to_dict` (line 701)
- `src.models.to_dict` (line 558)
- `src.models._load_config_from_disk` (line 186)
- `src.models.to_dict` (line 441)
- `src.models.to_dict` (line 1024)
- `src.models.to_dict` (line 971)
- `src.models.to_dict` (line 288)
- `src.models.to_dict` (line 737)
- `src.models.to_dict` (line 486)
- `src.models.to_dict` (line 618)
- `src.models.to_dict` (line 701)
- `src.models.to_dict` (line 886)
- `src.models.to_dict` (line 971)
- `src.models._load_config_from_disk` (line 186)
- `src.models.to_dict` (line 406)
- `src.models.to_dict` (line 646)
- `src.models.to_dict` (line 672)
- `src.models.to_dict` (line 355)
- `src.models.to_dict` (line 1059)
- `src.models.to_dict` (line 855)
- `src.models.to_dict` (line 1000)
- `src.models.parse_history_entries` (line 214)
- `src.models.to_dict` (line 938)
### `src\project_manager.py` (8 producers)
- `src.project_manager.get_all_tracks` (line 342)
- `src.project_manager.load_history` (line 209)
- `src.project_manager.str_to_entry` (line 75)
- `src.project_manager.load_project` (line 186)
- `src.project_manager.default_discussion` (line 117)
- `src.project_manager.default_project` (line 123)
- `src.project_manager.migrate_from_legacy_config` (line 253)
- `src.project_manager.flat_config` (line 267)
- `src.project_manager.load_project` (line 186)
- `src.project_manager.default_discussion` (line 117)
- `src.project_manager.get_all_tracks` (line 342)
## Consumers (66)
### `src\aggregate.py` (5 consumers)
- `src.aggregate.build_markdown_from_items` (line 348)
- `src.aggregate.build_tier3_context` (line 382)
- `src.aggregate.build_markdown_no_history` (line 366)
- `src.aggregate.run` (line 479)
- `src.aggregate._build_files_section_from_items` (line 300)
- `src.aggregate.build_markdown_from_items` (line 348)
- `src.aggregate.run` (line 479)
- `src.aggregate.build_markdown_no_history` (line 366)
### `src\ai_client.py` (29 consumers)
- `src.ai_client._invalidate_token_estimate` (line 1240)
- `src.ai_client._create_gemini_cache_result` (line 1706)
- `src.ai_client._send_grok` (line 2530)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client._send_gemini_cli` (line 2019)
- `src.ai_client._send_gemini` (line 1802)
- `src.ai_client._send_anthropic` (line 1405)
- `src.ai_client._trim_anthropic_history` (line 1353)
- `src.ai_client._send_llama` (line 2858)
- `src.ai_client._repair_minimax_history` (line 2462)
- `src.ai_client._strip_stale_file_refreshes` (line 1253)
- `src.ai_client._send_deepseek` (line 2165)
- `src.ai_client._add_bleed_derived` (line 3332)
- `src.ai_client._send_llama_native` (line 2958)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._send_qwen` (line 2773)
- `src.ai_client._repair_deepseek_history` (line 2138)
- `src.ai_client._execute_single_tool_call_async` (line 945)
- `src.ai_client._repair_anthropic_history` (line 1381)
- `src.ai_client._strip_cache_controls` (line 1291)
- `src.ai_client._dashscope_call` (line 2716)
- `src.ai_client._estimate_prompt_tokens` (line 1243)
- `src.ai_client._append_comms` (line 257)
- `src.ai_client._estimate_message_tokens` (line 1218)
- `src.ai_client._add_history_cache_breakpoint` (line 1299)
- `src.ai_client._send_grok` (line 2530)
- `src.ai_client._create_gemini_cache_result` (line 1706)
- `src.ai_client._send_deepseek` (line 2165)
- `src.ai_client._send_gemini_cli` (line 2019)
- `src.ai_client._send_qwen` (line 2773)
- `src.ai_client._repair_anthropic_history` (line 1381)
- `src.ai_client._pre_dispatch` (line 2089)
- `src.ai_client._trim_minimax_history` (line 2482)
- `src.ai_client._send_minimax` (line 2616)
- `src.ai_client._strip_stale_file_refreshes` (line 1253)
- `src.ai_client._send_anthropic` (line 1405)
- `src.ai_client._invalidate_token_estimate` (line 1240)
- `src.ai_client._add_bleed_derived` (line 3332)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._trim_anthropic_history` (line 1353)
- `src.ai_client.send` (line 3208)
- `src.ai_client._estimate_message_tokens` (line 1218)
- `src.ai_client._append_comms` (line 257)
- `src.ai_client._repair_deepseek_history` (line 2138)
- `src.ai_client._add_history_cache_breakpoint` (line 1299)
- `src.ai_client._trim_minimax_history` (line 2482)
- `src.ai_client._send_gemini` (line 1802)
- `src.ai_client._execute_single_tool_call_async` (line 945)
- `src.ai_client._send_llama_native` (line 2958)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client._send_minimax` (line 2616)
- `src.ai_client._repair_minimax_history` (line 2462)
- `src.ai_client._dashscope_call` (line 2716)
### `src\app_controller.py` (5 consumers)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller._on_comms_entry` (line 4282)
- `src.app_controller._start_track_logic_result` (line 4728)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller._refresh_api_metrics` (line 3074)
- `src.app_controller._on_comms_entry` (line 4282)
- `src.app_controller._start_track_logic` (line 4721)
### `src\models.py` (22 consumers)
- `src.models.from_dict` (line 920)
- `src.models.from_dict` (line 603)
- `src.models.from_dict` (line 506)
- `src.models.from_dict` (line 814)
- `src.models.from_dict` (line 893)
- `src.models.from_dict` (line 378)
- `src.models.from_dict` (line 1038)
- `src.models.from_dict` (line 1007)
- `src.models.from_dict` (line 747)
- `src.models.from_dict` (line 683)
- `src.models.from_dict` (line 712)
- `src.models.from_dict` (line 866)
- `src.models.from_dict` (line 454)
- `src.models.from_dict` (line 575)
- `src.models.from_dict` (line 630)
- `src.models.from_dict` (line 712)
- `src.models.from_dict` (line 747)
- `src.models._save_config_to_disk` (line 199)
- `src.models.from_dict` (line 575)
- `src.models.from_dict` (line 683)
- `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 295)
- `src.models.from_dict` (line 416)
- `src.models.from_dict` (line 656)
- `src.models.from_dict` (line 1072)
- `src.models.from_dict` (line 295)
- `src.models.from_dict` (line 656)
- `src.models.from_dict` (line 416)
- `src.models.from_dict` (line 603)
- `src.models.from_dict` (line 920)
- `src.models.from_dict` (line 814)
- `src.models.from_dict` (line 506)
- `src.models.from_dict` (line 893)
- `src.models.from_dict` (line 378)
### `src\project_manager.py` (5 consumers)
- `src.project_manager.save_project` (line 229)
- `src.project_manager.format_discussion` (line 69)
- `src.project_manager.entry_to_str` (line 49)
- `src.project_manager.flat_config` (line 267)
- `src.project_manager.save_project` (line 229)
- `src.project_manager.migrate_from_legacy_config` (line 253)
## Field access matrix
| consumer | _offload_entry_payload | _pending_comms | _pending_comms_lock | _pending_gui_tasks | _pending_gui_tasks_lock | _pending_history_adds | _pending_history_adds_lock | _token_history | _topological_sort_tickets_result | active_discussion | active_project_path | active_project_root | ai_status | append | config | content | context_files | discussion | encode | engines |
| consumer | _est_tokens | _gemini_cache_text | _offload_entry_payload | _pending_comms | _pending_comms_lock | _pending_gui_tasks | _pending_gui_tasks_lock | _pending_history_adds | _pending_history_adds_lock | _recalculate_session_usage | _token_history | _token_stats | _topological_sort_tickets_result | _update_cached_stats | active_discussion | active_project_path | active_project_root | ai_status | append | config |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| `_invalidate_token_estimate` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `build_markdown_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_create_gemini_cache_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_grok` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_strip_private_keys` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_send_gemini_cli` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_send_gemini` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_send_anthropic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `save_project` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 2 | . | . |
| `_trim_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_llama` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `build_tier3_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_offload_entry_payload` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `entry_to_str` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_strip_stale_file_refreshes` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_deepseek` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_add_bleed_derived` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `build_markdown_no_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `flat_config` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_llama_native` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `ollama_chat` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_qwen` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_on_comms_entry` | 1 | 1 | 1 | . | . | 4 | 4 | 1 | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_repair_deepseek_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_execute_single_tool_call_async` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_repair_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_strip_cache_controls` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `run` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_save_config_to_disk` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_dashscope_call` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_start_track_logic_result` | . | . | . | 2 | 2 | . | . | . | 1 | 1 | 1 | 1 | 4 | . | 1 | . | 1 | . | . | 1 |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_estimate_prompt_tokens` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `build_tier3_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_grok` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_create_gemini_cache_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_deepseek` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_gemini_cli` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_build_files_section_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `build_markdown_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_qwen` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_pre_dispatch` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_save_config_to_disk` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_strip_stale_file_refreshes` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `run` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_anthropic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_invalidate_token_estimate` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_add_bleed_derived` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_start_track_logic_result` | . | . | . | . | . | 2 | 2 | . | . | . | . | . | 1 | . | 1 | 1 | 1 | 4 | . | 1 |
| `entry_to_str` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `ollama_chat` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_trim_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_offload_entry_payload` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `send` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 |
| `_estimate_message_tokens` | 1 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_refresh_api_metrics` | . | 1 | . | . | . | . | . | . | . | 1 | . | 1 | . | 1 | . | . | . | . | . | . |
| `_on_comms_entry` | . | . | 1 | 1 | 1 | . | . | 4 | 4 | . | 1 | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_append_comms` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_deepseek_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_add_history_cache_breakpoint` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_trim_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_gemini` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `flat_config` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
_... 23 more fields_
_... 32 more fields_
## Access pattern
@@ -300,79 +300,79 @@ _... 23 more fields_
**Per-function pattern distribution:**
- `whole_struct`: 28 functions (56%)
- `mixed`: 18 functions (36%)
- `field_by_field`: 4 functions (8%)
- `mixed`: 17 functions (34%)
- `field_by_field`: 5 functions (10%)
## SSDL Sketch for `FileItem`
```
[Q:FileItem entry-point] -> [Q:PCG lookup]
-> [1: _invalidate_token_estimate] [B:check] (branches=0)
-> [1: _send_llama] [B:check] (branches=13)
-> [2: from_dict] [B:check] (branches=0)
-> [3: build_markdown_from_items] [B:check] (branches=9)
-> [4: from_dict] [B:check] (branches=0)
-> [5: _create_gemini_cache_result] [B:check] (branches=3)
-> [6: _send_grok] [B:check] (branches=14)
-> [7: _strip_private_keys] [B:check] (branches=0)
-> [8: from_dict] [B:check] (branches=0)
-> [9: _send_gemini_cli] [B:is None?] (branches=23) [N:safe]
-> [10: from_dict] [B:check] (branches=0)
-> [11: from_dict] [B:check] (branches=0)
-> [12: _send_gemini] [B:is None?] (branches=75) [N:safe]
-> [3: _strip_cache_controls] [B:check] (branches=4)
-> [4: _estimate_prompt_tokens] [B:check] (branches=2)
-> [5: build_tier3_context] [B:check] (branches=50)
-> [6: format_discussion] [B:check] (branches=0)
-> [7: _send_grok] [B:check] (branches=14)
-> [8: _create_gemini_cache_result] [B:check] (branches=3)
-> [9: _send_deepseek] [B:check] (branches=71)
-> [10: _send_gemini_cli] [B:is None?] (branches=23) [N:safe]
-> [11: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe]
-> [12: from_dict] [B:check] (branches=0)
-> [13: from_dict] [B:check] (branches=0)
-> [14: from_dict] [B:check] (branches=0)
-> [15: _send_anthropic] [B:is None?] (branches=40) [N:safe]
-> [16: save_project] [B:is None?] (branches=7) [N:safe]
-> [17: _trim_anthropic_history] [B:check] (branches=13)
-> [18: _send_llama] [B:check] (branches=13)
-> [19: build_tier3_context] [B:check] (branches=50)
-> [20: _offload_entry_payload] [B:check] (branches=10)
-> [21: format_discussion] [B:check] (branches=0)
-> [22: entry_to_str] [B:check] (branches=3)
-> [23: _repair_minimax_history] [B:check] (branches=10)
-> [14: build_markdown_from_items] [B:check] (branches=9)
-> [15: from_dict] [B:check] (branches=0)
-> [16: _send_qwen] [B:check] (branches=9)
-> [17: _repair_anthropic_history] [B:check] (branches=6)
-> [18: from_dict] [B:check] (branches=0)
-> [19: _pre_dispatch] [B:check] (branches=8)
-> [20: _save_config_to_disk] [B:check] (branches=1)
-> [21: from_dict] [B:check] (branches=0)
-> [22: from_dict] [B:check] (branches=0)
-> [23: from_dict] [B:check] (branches=0)
-> [24: from_dict] [B:check] (branches=0)
-> [25: from_dict] [B:check] (branches=0)
-> [26: _strip_stale_file_refreshes] [B:check] (branches=12)
-> [27: _send_deepseek] [B:check] (branches=71)
-> [28: _add_bleed_derived] [B:check] (branches=0)
-> [29: from_dict] [B:check] (branches=0)
-> [30: build_markdown_no_history] [B:check] (branches=0)
-> [31: flat_config] [B:check] (branches=2)
-> [32: _send_llama_native] [B:check] (branches=12)
-> [33: ollama_chat] [B:check] (branches=3)
-> [34: _send_qwen] [B:check] (branches=9)
-> [35: _on_comms_entry] [B:check] (branches=32)
-> [25: _strip_stale_file_refreshes] [B:check] (branches=12)
-> [26: run] [B:check] (branches=1)
-> [27: _send_anthropic] [B:is None?] (branches=40) [N:safe]
-> [28: _invalidate_token_estimate] [B:check] (branches=0)
-> [29: _add_bleed_derived] [B:check] (branches=0)
-> [30: _start_track_logic_result] [B:check] (branches=10)
-> [31: entry_to_str] [B:check] (branches=3)
-> [32: ollama_chat] [B:check] (branches=3)
-> [33: _trim_anthropic_history] [B:check] (branches=13)
-> [34: _offload_entry_payload] [B:check] (branches=10)
-> [35: from_dict] [B:check] (branches=0)
-> [36: from_dict] [B:check] (branches=0)
-> [37: from_dict] [B:check] (branches=0)
-> [38: _repair_deepseek_history] [B:check] (branches=6)
-> [39: from_dict] [B:check] (branches=0)
-> [40: from_dict] [B:check] (branches=0)
-> [41: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe]
-> [38: send] [B:check] (branches=19)
-> [39: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe]
-> [40: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe]
-> [41: _on_comms_entry] [B:check] (branches=32)
-> [42: from_dict] [B:check] (branches=0)
-> [43: _repair_anthropic_history] [B:check] (branches=6)
-> [44: _strip_cache_controls] [B:check] (branches=4)
-> [45: run] [B:check] (branches=1)
-> [46: _save_config_to_disk] [B:check] (branches=1)
-> [47: _dashscope_call] [B:check] (branches=5)
-> [48: _start_track_logic_result] [B:check] (branches=10)
-> [49: from_dict] [B:check] (branches=0)
-> [50: _estimate_prompt_tokens] [B:check] (branches=2)
-> [51: _append_comms] [B:is None?] (branches=1) [N:safe]
-> [52: from_dict] [B:check] (branches=0)
-> [53: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe]
-> [54: _add_history_cache_breakpoint] [B:check] (branches=5)
-> [55: _pre_dispatch] [B:check] (branches=8)
-> [43: _append_comms] [B:is None?] (branches=1) [N:safe]
-> [44: from_dict] [B:check] (branches=0)
-> [45: _repair_deepseek_history] [B:check] (branches=6)
-> [46: from_dict] [B:check] (branches=0)
-> [47: _add_history_cache_breakpoint] [B:check] (branches=5)
-> [48: _trim_minimax_history] [B:check] (branches=8)
-> [49: _send_gemini] [B:is None?] (branches=75) [N:safe]
-> [50: flat_config] [B:check] (branches=2)
-> [51: save_project] [B:is None?] (branches=7) [N:safe]
-> [52: build_markdown_no_history] [B:check] (branches=0)
-> [53: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe]
-> [54: _send_llama_native] [B:check] (branches=12)
-> [55: _strip_private_keys] [B:check] (branches=0)
-> [56: from_dict] [B:check] (branches=0)
-> [57: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe]
-> [58: _trim_minimax_history] [B:check] (branches=8)
-> [59: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe]
-> [60: _start_track_logic] [B:check] (branches=1)
-> [61: from_dict] [B:check] (branches=0)
-> [62: from_dict] [B:check] (branches=0)
-> [63: from_dict] [B:check] (branches=0)
-> [64: migrate_from_legacy_config] [B:check] (branches=2)
-> [65: _send_minimax] [B:check] (branches=11)
-> [66: send] [B:check] (branches=19)
-> [57: from_dict] [B:check] (branches=0)
-> [58: _send_minimax] [B:check] (branches=11)
-> [59: from_dict] [B:check] (branches=0)
-> [60: from_dict] [B:check] (branches=0)
-> [61: _repair_minimax_history] [B:check] (branches=10)
-> [62: _start_track_logic] [B:check] (branches=1)
-> [63: migrate_from_legacy_config] [B:check] (branches=2)
-> [64: _dashscope_call] [B:check] (branches=5)
-> [65: from_dict] [B:check] (branches=0)
-> [66: from_dict] [B:check] (branches=0)
-> [T:done]
```
@@ -384,8 +384,8 @@ _... 23 more fields_
- **Nil Sentinel `[N]`**: Introduce a module-level `NIL_<AGGREGATE>` 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 135 field-check branches to 1 cache lookup.
- Effective codepaths: 40140116231395706750390 -> 135
- **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 148 field-check branches to 1 cache lookup.
- Effective codepaths: 40140116231395706750390 -> 148
- **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
@@ -412,13 +412,13 @@ _... 23 more fields_
## Type alias coverage
**Summary:** 135 sites; 0 typed (0%); 135 untyped (100%)
**Summary:** 148 sites; 0 typed (0%); 148 untyped (100%)
| metric | value |
|---|---|
| total field-access sites | 135 |
| total field-access sites | 148 |
| typed sites (canonical field) | 0 |
| untyped sites (wildcard) | 135 |
| untyped sites (wildcard) | 148 |
## Cross-audit findings
@@ -438,14 +438,15 @@ _(no cross-audit findings mapped to this aggregate)_
| field | access count | access pattern |
|---|---|---|
| `content` | 16 | hot |
| `marker` | 16 | hot |
| `get` | 7 | hot |
| `append` | 3 | hot |
| `pop` | 2 | used |
| `files` | 2 | used |
| `encode` | 1 | used |
| `discussion` | 1 | used |
| `content` | 15 | hot |
| `marker` | 15 | hot |
| `get` | 8 | hot |
| `pop` | 3 | hot |
| `append` | 2 | used |
| `config` | 2 | used |
| `session_usage` | 2 | used |
| `output` | 1 | used |
| `files` | 1 | used |
| `estimated_prompt_tokens` | 1 | used |
| `max_prompt_tokens` | 1 | used |
| `utilization_pct` | 1 | used |
@@ -454,17 +455,6 @@ _(no cross-audit findings mapped to this aggregate)_
| `sys_tokens` | 1 | used |
| `tool_tokens` | 1 | used |
| `history_tokens` | 1 | used |
| `local_ts` | 1 | used |
| `_offload_entry_payload` | 1 | used |
| `ui_auto_add_history` | 1 | used |
| `_pending_comms_lock` | 1 | used |
| `session_usage` | 1 | used |
| `_pending_history_adds_lock` | 1 | used |
| `_token_history` | 1 | used |
| `_pending_comms` | 1 | used |
| `_pending_history_adds` | 1 | used |
| `items` | 1 | used |
| `output` | 1 | used |
| `ai_status` | 1 | used |
| `context_files` | 1 | used |
| `_pending_gui_tasks_lock` | 1 | used |
@@ -476,11 +466,30 @@ _(no cross-audit findings mapped to this aggregate)_
| `active_discussion` | 1 | used |
| `submit_io` | 1 | used |
| `tracks` | 1 | used |
| `config` | 1 | used |
| `mma_tier_usage` | 1 | used |
| `_pending_gui_tasks` | 1 | used |
| `mma_step_mode` | 1 | used |
| `active_project_path` | 1 | used |
| `search` | 1 | used |
| `_est_tokens` | 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 |
| `usage` | 1 | used |
| `local_ts` | 1 | used |
| `_offload_entry_payload` | 1 | used |
| `ui_auto_add_history` | 1 | used |
| `_pending_comms_lock` | 1 | used |
| `_pending_history_adds_lock` | 1 | used |
| `_token_history` | 1 | used |
| `_pending_comms` | 1 | used |
| `_pending_history_adds` | 1 | used |
| `encode` | 1 | used |
## Optimization candidates
@@ -496,63 +505,63 @@ FileItem: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5,
| function | pattern | field_accesses | confidence |
|---|---|---|---|
| `src.ai_client._invalidate_token_estimate` | `whole_struct` | `pop`=1 | high |
| `src.ai_client._send_llama` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._strip_cache_controls` | `whole_struct` | | low |
| `src.ai_client._estimate_prompt_tokens` | `whole_struct` | | low |
| `src.aggregate.build_tier3_context` | `whole_struct` | | low |
| `src.project_manager.format_discussion` | `whole_struct` | | low |
| `src.ai_client._send_grok` | `whole_struct` | | low |
| `src.ai_client._create_gemini_cache_result` | `whole_struct` | | low |
| `src.ai_client._send_deepseek` | `whole_struct` | | low |
| `src.ai_client._send_gemini_cli` | `whole_struct` | | low |
| `src.aggregate._build_files_section_from_items` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.aggregate.build_markdown_from_items` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._create_gemini_cache_result` | `whole_struct` | | low |
| `src.ai_client._send_grok` | `whole_struct` | | low |
| `src.ai_client._strip_private_keys` | `whole_struct` | | low |
| `src.ai_client._send_qwen` | `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.ai_client._send_gemini_cli` | `whole_struct` | | low |
| `src.ai_client._pre_dispatch` | `whole_struct` | | low |
| `src.models._save_config_to_disk` | `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.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.project_manager.save_project` | `mixed` | `discussion`=2, `files`=3 | high |
| `src.ai_client._trim_anthropic_history` | `whole_struct` | `pop`=5 | high |
| `src.ai_client._send_llama` | `whole_struct` | | low |
| `src.aggregate.build_tier3_context` | `whole_struct` | | low |
| `src.app_controller._offload_entry_payload` | `whole_struct` | | low |
| `src.project_manager.format_discussion` | `whole_struct` | | low |
| `src.project_manager.entry_to_str` | `whole_struct` | `get`=4 | high |
| `src.ai_client._repair_minimax_history` | `whole_struct` | `append`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._strip_stale_file_refreshes` | `whole_struct` | | low |
| `src.ai_client._send_deepseek` | `whole_struct` | | low |
| `src.aggregate.run` | `field_by_field` | `output`=1, `files`=2, `get`=7 | high |
| `src.ai_client._send_anthropic` | `whole_struct` | | low |
| `src.ai_client._invalidate_token_estimate` | `whole_struct` | `pop`=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.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.aggregate.build_markdown_no_history` | `whole_struct` | | low |
| `src.project_manager.flat_config` | `whole_struct` | `get`=7 | high |
| `src.ai_client._send_llama_native` | `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.project_manager.entry_to_str` | `whole_struct` | `get`=4 | high |
| `src.ai_client.ollama_chat` | `whole_struct` | | low |
| `src.ai_client._send_qwen` | `whole_struct` | | low |
| `src.ai_client._trim_anthropic_history` | `whole_struct` | `pop`=5 | high |
| `src.app_controller._offload_entry_payload` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client.send` | `mixed` | `config`=1, `search`=1 | high |
| `src.ai_client._estimate_message_tokens` | `mixed` | `_est_tokens`=1, `get`=2 | high |
| `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.app_controller._on_comms_entry` | `field_by_field` | `local_ts`=1, `_offload_entry_payload`=1, `get`=7, `ui_auto_add_history`=3, `_pending_comms_lock`=1, `session_usage`=5, `_pending_history_adds_lock`=4, `_token_history`=1, `_pending_comms`=1, `_pending_history_adds`=4 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._append_comms` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._repair_deepseek_history` | `whole_struct` | `append`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `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_anthropic_history` | `whole_struct` | `append`=1 | high |
| `src.ai_client._strip_cache_controls` | `whole_struct` | | low |
| `src.aggregate.run` | `field_by_field` | `output`=1, `files`=2, `get`=7 | high |
| `src.models._save_config_to_disk` | `whole_struct` | | low |
| `src.ai_client._dashscope_call` | `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.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._estimate_prompt_tokens` | `whole_struct` | | low |
| `src.ai_client._add_history_cache_breakpoint` | `whole_struct` | | low |
| `src.ai_client._trim_minimax_history` | `whole_struct` | `pop`=4 | high |
| `src.ai_client._send_gemini` | `whole_struct` | `encode`=1 | high |
| `src.project_manager.flat_config` | `whole_struct` | `get`=7 | high |
### Frequency evidence
| function | frequency | source | note |
|---|---|---|---|
| `src.ai_client._extract_dashscope_tool_calls` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.api_hook_client.get_warmup_wait` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py |
| `src.app_controller.wait` | `per_turn` | `static_analysis` | producer from src\app_controller.py |
| `src.ai_client._dashscope_call` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.app_controller._pending_mma_spawn` | `per_turn` | `static_analysis` | producer from src\app_controller.py |
| `src.app_controller._api_get_context` | `per_turn` | `static_analysis` | producer from src\app_controller.py |
| `src.ai_client.get_comms_log` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.api_hook_client.post_project` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py |
| `src.api_hook_client.get_node_status` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py |
| `src.models.to_dict` | `per_turn` | `static_analysis` | producer from src\models.py |
@@ -19,24 +19,24 @@
### `src\ai_client.py` (4 producers)
- `src.ai_client._list_gemini_models_result` (line 1626)
- `src.ai_client._list_anthropic_models_result` (line 1317)
- `src.ai_client._list_gemini_models_result` (line 1626)
- `src.ai_client._list_minimax_models_result` (line 2436)
- `src.ai_client._set_minimax_provider_result` (line 398)
### `src\gui_2.py` (2 producers)
- `src.gui_2._render_beads_tab_list_result` (line 8314)
- `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_context_text` (line 1092)
- `src.ai_client._reread_file_items_result` (line 1056)
- `src.ai_client._build_file_diff_text` (line 1105)
- `src.ai_client.run_with_tool_loop` (line 833)
- `src.ai_client._build_file_diff_text` (line 1105)
- `src.ai_client._reread_file_items_result` (line 1056)
### `src\app_controller.py` (3 consumers)
@@ -56,15 +56,15 @@
| consumer | _attr_name | _cached | _module_name | _report_worker_error | append |
|---|---|---|---|---|---|
| `_symbol_resolution_result` | . | . | . | . | . |
| `_topological_sort_tickets_result` | . | . | . | 1 | . |
| `_build_file_context_text` | . | . | . | . | . |
| `_reread_file_items_result` | . | . | . | . | . |
| `_build_file_diff_text` | . | . | . | . | . |
| `__init__` | 1 | 1 | 1 | . | . |
| `_serialize_tool_calls_result` | . | . | . | . | . |
| `calculate_track_progress` | . | . | . | . | . |
| `_build_file_context_text` | . | . | . | . | . |
| `_symbol_resolution_result` | . | . | . | . | . |
| `run_with_tool_loop` | . | . | . | . | 2 |
| `_topological_sort_tickets_result` | . | . | . | 1 | . |
| `calculate_track_progress` | . | . | . | . | . |
| `_serialize_tool_calls_result` | . | . | . | . | . |
| `_build_file_diff_text` | . | . | . | . | . |
| `_reread_file_items_result` | . | . | . | . | . |
## Access pattern
@@ -80,15 +80,15 @@
```
[Q:FileItems entry-point] -> [Q:PCG lookup]
-> [1: _symbol_resolution_result] [B:check] (branches=4)
-> [2: _topological_sort_tickets_result] [B:check] (branches=2)
-> [3: _build_file_context_text] [B:check] (branches=3)
-> [4: _reread_file_items_result] [B:is None?] (branches=5) [N:safe]
-> [5: _build_file_diff_text] [B:check] (branches=6)
-> [6: __init__] [B:check] (branches=0)
-> [1: __init__] [B:check] (branches=0)
-> [2: _build_file_context_text] [B:check] (branches=3)
-> [3: _symbol_resolution_result] [B:check] (branches=4)
-> [4: run_with_tool_loop] [B:is None?] (branches=23) [N:safe]
-> [5: _topological_sort_tickets_result] [B:check] (branches=2)
-> [6: calculate_track_progress] [B:check] (branches=1)
-> [7: _serialize_tool_calls_result] [B:check] (branches=2)
-> [8: calculate_track_progress] [B:check] (branches=1)
-> [9: run_with_tool_loop] [B:is None?] (branches=23) [N:safe]
-> [8: _build_file_diff_text] [B:check] (branches=6)
-> [9: _reread_file_items_result] [B:is None?] (branches=5) [N:safe]
-> [T:done]
```
@@ -154,11 +154,11 @@ _(no cross-audit findings mapped to this aggregate)_
| field | access count | access pattern |
|---|---|---|
| `_report_worker_error` | 1 | used |
| `_module_name` | 1 | used |
| `_attr_name` | 1 | used |
| `_cached` | 1 | used |
| `append` | 1 | used |
| `_report_worker_error` | 1 | used |
## Optimization candidates
@@ -174,22 +174,22 @@ FileItems: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5
| 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.ai_client._build_file_context_text` | `whole_struct` | | low |
| `src.ai_client._reread_file_items_result` | `whole_struct` | | low |
| `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._serialize_tool_calls_result` | `whole_struct` | | low |
| `src.project_manager.calculate_track_progress` | `whole_struct` | | low |
| `src.ai_client._build_file_context_text` | `whole_struct` | | low |
| `src.app_controller._symbol_resolution_result` | `whole_struct` | | low |
| `src.ai_client.run_with_tool_loop` | `whole_struct` | `append`=2 | high |
| `src.app_controller._topological_sort_tickets_result` | `whole_struct` | `_report_worker_error`=1 | high |
| `src.project_manager.calculate_track_progress` | `whole_struct` | | low |
| `src.app_controller._serialize_tool_calls_result` | `whole_struct` | | low |
| `src.ai_client._build_file_diff_text` | `whole_struct` | | low |
| `src.ai_client._reread_file_items_result` | `whole_struct` | | low |
### Frequency evidence
| function | frequency | source | note |
|---|---|---|---|
| `src.gui_2._render_beads_tab_list_result` | `per_turn` | `static_analysis` | producer from src\gui_2.py |
| `src.gui_2._drain_normalize_errors` | `per_turn` | `static_analysis` | producer from src\gui_2.py |
| `src.ai_client._list_gemini_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.ai_client._list_anthropic_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.ai_client._list_minimax_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.ai_client._set_minimax_provider_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.gui_2._drain_normalize_errors` | `per_turn` | `static_analysis` | producer from src\gui_2.py |
@@ -19,15 +19,15 @@
### `src\ai_client.py` (4 producers)
- `src.ai_client._list_gemini_models_result` (line 1626)
- `src.ai_client._list_anthropic_models_result` (line 1317)
- `src.ai_client._list_gemini_models_result` (line 1626)
- `src.ai_client._list_minimax_models_result` (line 2436)
- `src.ai_client._set_minimax_provider_result` (line 398)
### `src\gui_2.py` (2 producers)
- `src.gui_2._render_beads_tab_list_result` (line 8314)
- `src.gui_2._drain_normalize_errors` (line 7417)
- `src.gui_2._render_beads_tab_list_result` (line 8314)
### `src\provider_state.py` (1 producer)
@@ -51,20 +51,20 @@
### `src\provider_state.py` (2 consumers)
- `src.provider_state.append` (line 30)
- `src.provider_state.replace_all` (line 38)
- `src.provider_state.append` (line 30)
## Field access matrix
| consumer | _attr_name | _cached | _module_name | _report_worker_error | lock | messages |
|---|---|---|---|---|---|---|
| `append` | . | . | . | . | 1 | 1 |
| `_symbol_resolution_result` | . | . | . | . | . | . |
| `_topological_sort_tickets_result` | . | . | . | 1 | . | . |
| `replace_all` | . | . | . | . | 1 | 1 |
| `__init__` | 1 | 1 | 1 | . | . | . |
| `_serialize_tool_calls_result` | . | . | . | . | . | . |
| `replace_all` | . | . | . | . | 1 | 1 |
| `_symbol_resolution_result` | . | . | . | . | . | . |
| `append` | . | . | . | . | 1 | 1 |
| `_topological_sort_tickets_result` | . | . | . | 1 | . | . |
| `calculate_track_progress` | . | . | . | . | . | . |
| `_serialize_tool_calls_result` | . | . | . | . | . | . |
## Access pattern
@@ -81,13 +81,13 @@
```
[Q:History entry-point] -> [Q:PCG lookup]
-> [1: append] [B:check] (branches=1)
-> [2: _symbol_resolution_result] [B:check] (branches=4)
-> [3: _topological_sort_tickets_result] [B:check] (branches=2)
-> [4: replace_all] [B:check] (branches=1)
-> [5: __init__] [B:check] (branches=0)
-> [6: _serialize_tool_calls_result] [B:check] (branches=2)
-> [7: calculate_track_progress] [B:check] (branches=1)
-> [1: __init__] [B:check] (branches=0)
-> [2: replace_all] [B:check] (branches=1)
-> [3: _symbol_resolution_result] [B:check] (branches=4)
-> [4: append] [B:check] (branches=1)
-> [5: _topological_sort_tickets_result] [B:check] (branches=2)
-> [6: calculate_track_progress] [B:check] (branches=1)
-> [7: _serialize_tool_calls_result] [B:check] (branches=2)
-> [T:done]
```
@@ -151,10 +151,10 @@ _(no cross-audit findings mapped to this aggregate)_
|---|---|---|
| `lock` | 2 | used |
| `messages` | 2 | used |
| `_report_worker_error` | 1 | used |
| `_module_name` | 1 | used |
| `_attr_name` | 1 | used |
| `_cached` | 1 | used |
| `_report_worker_error` | 1 | used |
## Optimization candidates
@@ -170,20 +170,20 @@ History: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5,
| function | pattern | field_accesses | confidence |
|---|---|---|---|
| `src.provider_state.append` | `mixed` | `lock`=1, `messages`=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.provider_state.replace_all` | `mixed` | `lock`=1, `messages`=1 | high |
| `src.gui_2.__init__` | `field_by_field` | `_module_name`=1, `_attr_name`=1, `_cached`=1 | high |
| `src.app_controller._serialize_tool_calls_result` | `whole_struct` | | low |
| `src.provider_state.replace_all` | `mixed` | `lock`=1, `messages`=1 | high |
| `src.app_controller._symbol_resolution_result` | `whole_struct` | | low |
| `src.provider_state.append` | `mixed` | `lock`=1, `messages`=1 | high |
| `src.app_controller._topological_sort_tickets_result` | `whole_struct` | `_report_worker_error`=1 | high |
| `src.project_manager.calculate_track_progress` | `whole_struct` | | low |
| `src.app_controller._serialize_tool_calls_result` | `whole_struct` | | low |
### Frequency evidence
| function | frequency | source | note |
|---|---|---|---|
| `src.gui_2._render_beads_tab_list_result` | `per_turn` | `static_analysis` | producer from src\gui_2.py |
| `src.gui_2._drain_normalize_errors` | `per_turn` | `static_analysis` | producer from src\gui_2.py |
| `src.ai_client._list_gemini_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.provider_state.get_all` | `per_turn` | `static_analysis` | producer from src\provider_state.py |
| `src.ai_client._list_anthropic_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.provider_state.get_all` | `per_turn` | `static_analysis` | producer from src\provider_state.py |
| `src.ai_client._list_gemini_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.ai_client._list_minimax_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.ai_client._set_minimax_provider_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
@@ -23,134 +23,134 @@
### `src\ai_client.py` (16 producers)
- `src.ai_client._extract_dashscope_tool_calls` (line 2754)
- `src.ai_client._dashscope_call` (line 2716)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client._parse_tool_args_result` (line 741)
- `src.ai_client._build_chunked_context_blocks` (line 1281)
- `src.ai_client._get_anthropic_tools` (line 664)
- `src.ai_client._get_deepseek_tools` (line 1194)
- `src.ai_client._pre_dispatch` (line 2089)
- `src.ai_client.get_gemini_cache_stats` (line 1604)
- `src.ai_client._load_credentials` (line 282)
- `src.ai_client.get_token_stats` (line 3185)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client.get_comms_log` (line 273)
- `src.ai_client._content_block_to_dict` (line 1200)
- `src.ai_client._parse_tool_args_result` (line 741)
- `src.ai_client._get_anthropic_tools` (line 664)
- `src.ai_client._dashscope_call` (line 2716)
- `src.ai_client._pre_dispatch` (line 2089)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._load_credentials` (line 282)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client.get_token_stats` (line 3185)
- `src.ai_client._add_bleed_derived` (line 3332)
- `src.ai_client._send_cli_round_result` (line 1746)
- `src.ai_client._extract_dashscope_tool_calls` (line 2754)
- `src.ai_client.get_gemini_cache_stats` (line 1604)
- `src.ai_client._get_deepseek_tools` (line 1194)
- `src.ai_client._content_block_to_dict` (line 1200)
- `src.ai_client._build_chunked_context_blocks` (line 1281)
### `src\api_hook_client.py` (39 producers)
- `src.api_hook_client.get_warmup_wait` (line 332)
- `src.api_hook_client.wait_for_event` (line 136)
- `src.api_hook_client.clear_events` (line 129)
- `src.api_hook_client.get_warmup_status` (line 325)
- `src.api_hook_client.get_project` (line 367)
- `src.api_hook_client.get_mma_workers` (line 546)
- `src.api_hook_client.reject_patch` (line 288)
- `src.api_hook_client.get_gui_state` (line 165)
- `src.api_hook_client.get_events` (line 124)
- `src.api_hook_client.post_project` (line 473)
- `src.api_hook_client.get_session` (line 502)
- `src.api_hook_client.get_io_pool_status` (line 420)
- `src.api_hook_client.trigger_patch` (line 274)
- `src.api_hook_client.get_node_status` (line 532)
- `src.api_hook_client.click` (line 223)
- `src.api_hook_client.get_startup_timeline` (line 353)
- `src.api_hook_client.select_tab` (line 263)
- `src.api_hook_client.reject_patch` (line 288)
- `src.api_hook_client.clear_events` (line 129)
- `src.api_hook_client.post_gui` (line 149)
- `src.api_hook_client.get_warmup_status` (line 325)
- `src.api_hook_client.select_list_item` (line 256)
- `src.api_hook_client.get_gui_health` (line 434)
- `src.api_hook_client.wait_for_event` (line 136)
- `src.api_hook_client.post_project` (line 470)
- `src.api_hook_client.apply_patch` (line 281)
- `src.api_hook_client.get_project_switch_status` (line 374)
- `src.api_hook_client.get_io_pool_status` (line 420)
- `src.api_hook_client.get_financial_metrics` (line 520)
- `src.api_hook_client.drag` (line 230)
- `src.api_hook_client.get_warmup_canaries` (line 342)
- `src.api_hook_client.get_gui_diagnostics` (line 311)
- `src.api_hook_client.trigger_patch` (line 274)
- `src.api_hook_client.get_project` (line 367)
- `src.api_hook_client.get_events` (line 124)
- `src.api_hook_client.get_warmup_wait` (line 332)
- `src.api_hook_client.set_value` (line 212)
- `src.api_hook_client.get_mma_status` (line 539)
- `src.api_hook_client.post_session` (line 117)
- `src.api_hook_client.wait_for_project_switch` (line 389)
- `src.api_hook_client.get_performance` (line 318)
- `src.api_hook_client.get_system_telemetry` (line 524)
- `src.api_hook_client.push_event` (line 156)
- `src.api_hook_client.get_gui_state` (line 165)
- `src.api_hook_client._make_request` (line 65)
- `src.api_hook_client.get_status` (line 105)
- `src.api_hook_client.get_context_state` (line 491)
- `src.api_hook_client.set_value` (line 212)
- `src.api_hook_client.post_gui` (line 149)
- `src.api_hook_client.get_gui_diagnostics` (line 311)
- `src.api_hook_client.get_mma_status` (line 539)
- `src.api_hook_client.get_startup_timeline` (line 353)
- `src.api_hook_client.get_node_status` (line 532)
- `src.api_hook_client.get_performance` (line 318)
- `src.api_hook_client.post_session` (line 117)
- `src.api_hook_client.push_event` (line 156)
- `src.api_hook_client.get_warmup_canaries` (line 342)
- `src.api_hook_client.drag` (line 230)
- `src.api_hook_client.apply_patch` (line 281)
- `src.api_hook_client.post_project` (line 470)
- `src.api_hook_client.get_patch_status` (line 295)
- `src.api_hook_client.wait_for_project_switch` (line 389)
- `src.api_hook_client.click` (line 223)
- `src.api_hook_client.select_list_item` (line 256)
- `src.api_hook_client.get_project_switch_status` (line 374)
- `src.api_hook_client.get_system_telemetry` (line 524)
- `src.api_hook_client._make_request` (line 65)
- `src.api_hook_client.select_tab` (line 263)
- `src.api_hook_client.get_session` (line 502)
- `src.api_hook_client.get_mma_workers` (line 546)
- `src.api_hook_client.right_click` (line 237)
- `src.api_hook_client.get_financial_metrics` (line 520)
- `src.api_hook_client.get_patch_status` (line 295)
### `src\app_controller.py` (30 producers)
- `src.app_controller.wait` (line 5205)
- `src.app_controller._pending_mma_spawn` (line 2772)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller._api_get_diagnostics` (line 202)
- `src.app_controller.get_gui_state` (line 2829)
- `src.app_controller.load_config` (line 5142)
- `src.app_controller._api_get_session` (line 374)
- `src.app_controller._api_pending_actions` (line 335)
- `src.app_controller.get_context` (line 2892)
- `src.app_controller.token_stats` (line 2898)
- `src.app_controller._api_get_api_project` (line 188)
- `src.app_controller._api_get_context` (line 398)
- `src.app_controller._api_token_stats` (line 417)
- `src.app_controller.get_mma_status` (line 2835)
- `src.app_controller._api_get_performance` (line 195)
- `src.app_controller._api_get_api_session` (line 170)
- `src.app_controller._api_get_gui_state` (line 123)
- `src.app_controller.get_performance` (line 2856)
- `src.app_controller.pending_actions` (line 2874)
- `src.app_controller.status` (line 2865)
- `src.app_controller._api_get_mma_status` (line 144)
- `src.app_controller.generate` (line 2868)
- `src.app_controller.get_api_project` (line 2853)
- `src.app_controller._api_status` (line 209)
- `src.app_controller._api_generate` (line 221)
- `src.app_controller.get_session` (line 2883)
- `src.app_controller.get_diagnostics` (line 2862)
- `src.app_controller.get_session_insights` (line 3049)
- `src.app_controller._pending_mma_approval` (line 2776)
- `src.app_controller.get_api_session` (line 2847)
- `src.app_controller._api_get_gui_state` (line 123)
- `src.app_controller.get_api_project` (line 2853)
- `src.app_controller._api_get_performance` (line 195)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller.get_gui_state` (line 2829)
- `src.app_controller.get_performance` (line 2856)
- `src.app_controller._api_status` (line 209)
- `src.app_controller._api_get_mma_status` (line 144)
- `src.app_controller.get_mma_status` (line 2835)
- `src.app_controller._pending_mma_spawn` (line 2772)
- `src.app_controller.get_diagnostics` (line 2862)
- `src.app_controller._api_pending_actions` (line 335)
- `src.app_controller._api_token_stats` (line 417)
- `src.app_controller.wait` (line 5205)
- `src.app_controller.pending_actions` (line 2874)
- `src.app_controller.load_config` (line 5142)
- `src.app_controller._pending_mma_approval` (line 2776)
- `src.app_controller._api_get_diagnostics` (line 202)
- `src.app_controller.get_context` (line 2892)
- `src.app_controller.get_session` (line 2883)
- `src.app_controller._api_get_api_project` (line 188)
- `src.app_controller.get_session_insights` (line 3049)
- `src.app_controller._api_get_session` (line 374)
- `src.app_controller.token_stats` (line 2898)
- `src.app_controller._api_generate` (line 221)
- `src.app_controller.status` (line 2865)
- `src.app_controller.generate` (line 2868)
### `src\models.py` (23 producers)
- `src.models.to_dict` (line 646)
- `src.models.to_dict` (line 406)
- `src.models.to_dict` (line 855)
- `src.models.to_dict` (line 938)
- `src.models.to_dict` (line 1059)
- `src.models.parse_history_entries` (line 214)
- `src.models.to_dict` (line 288)
- `src.models.to_dict` (line 794)
- `src.models.to_dict` (line 1000)
- `src.models.to_dict` (line 672)
- `src.models.to_dict` (line 355)
- `src.models.to_dict` (line 486)
- `src.models.to_dict` (line 913)
- `src.models.to_dict` (line 596)
- `src.models.to_dict` (line 886)
- `src.models.to_dict` (line 701)
- `src.models.to_dict` (line 558)
- `src.models._load_config_from_disk` (line 186)
- `src.models.to_dict` (line 441)
- `src.models.to_dict` (line 1024)
- `src.models.to_dict` (line 971)
- `src.models.to_dict` (line 288)
- `src.models.to_dict` (line 737)
- `src.models.to_dict` (line 486)
- `src.models.to_dict` (line 618)
- `src.models.to_dict` (line 701)
- `src.models.to_dict` (line 886)
- `src.models.to_dict` (line 971)
- `src.models._load_config_from_disk` (line 186)
- `src.models.to_dict` (line 406)
- `src.models.to_dict` (line 646)
- `src.models.to_dict` (line 672)
- `src.models.to_dict` (line 355)
- `src.models.to_dict` (line 1059)
- `src.models.to_dict` (line 855)
- `src.models.to_dict` (line 1000)
- `src.models.parse_history_entries` (line 214)
- `src.models.to_dict` (line 938)
### `src\project_manager.py` (8 producers)
- `src.project_manager.get_all_tracks` (line 342)
- `src.project_manager.load_history` (line 209)
- `src.project_manager.str_to_entry` (line 75)
- `src.project_manager.load_project` (line 186)
- `src.project_manager.default_discussion` (line 117)
- `src.project_manager.default_project` (line 123)
- `src.project_manager.migrate_from_legacy_config` (line 253)
- `src.project_manager.flat_config` (line 267)
- `src.project_manager.load_project` (line 186)
- `src.project_manager.default_discussion` (line 117)
- `src.project_manager.get_all_tracks` (line 342)
### `src\provider_state.py` (1 producer)
@@ -160,146 +160,146 @@
### `src\aggregate.py` (5 consumers)
- `src.aggregate.build_markdown_from_items` (line 348)
- `src.aggregate.build_tier3_context` (line 382)
- `src.aggregate.build_markdown_no_history` (line 366)
- `src.aggregate.run` (line 479)
- `src.aggregate._build_files_section_from_items` (line 300)
- `src.aggregate.build_markdown_from_items` (line 348)
- `src.aggregate.run` (line 479)
- `src.aggregate.build_markdown_no_history` (line 366)
### `src\ai_client.py` (29 consumers)
- `src.ai_client._invalidate_token_estimate` (line 1240)
- `src.ai_client._create_gemini_cache_result` (line 1706)
- `src.ai_client._send_grok` (line 2530)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client._send_gemini_cli` (line 2019)
- `src.ai_client._send_gemini` (line 1802)
- `src.ai_client._send_anthropic` (line 1405)
- `src.ai_client._trim_anthropic_history` (line 1353)
- `src.ai_client._send_llama` (line 2858)
- `src.ai_client._repair_minimax_history` (line 2462)
- `src.ai_client._strip_stale_file_refreshes` (line 1253)
- `src.ai_client._send_deepseek` (line 2165)
- `src.ai_client._add_bleed_derived` (line 3332)
- `src.ai_client._send_llama_native` (line 2958)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._send_qwen` (line 2773)
- `src.ai_client._repair_deepseek_history` (line 2138)
- `src.ai_client._execute_single_tool_call_async` (line 945)
- `src.ai_client._repair_anthropic_history` (line 1381)
- `src.ai_client._strip_cache_controls` (line 1291)
- `src.ai_client._dashscope_call` (line 2716)
- `src.ai_client._estimate_prompt_tokens` (line 1243)
- `src.ai_client._append_comms` (line 257)
- `src.ai_client._estimate_message_tokens` (line 1218)
- `src.ai_client._add_history_cache_breakpoint` (line 1299)
- `src.ai_client._send_grok` (line 2530)
- `src.ai_client._create_gemini_cache_result` (line 1706)
- `src.ai_client._send_deepseek` (line 2165)
- `src.ai_client._send_gemini_cli` (line 2019)
- `src.ai_client._send_qwen` (line 2773)
- `src.ai_client._repair_anthropic_history` (line 1381)
- `src.ai_client._pre_dispatch` (line 2089)
- `src.ai_client._trim_minimax_history` (line 2482)
- `src.ai_client._send_minimax` (line 2616)
- `src.ai_client._strip_stale_file_refreshes` (line 1253)
- `src.ai_client._send_anthropic` (line 1405)
- `src.ai_client._invalidate_token_estimate` (line 1240)
- `src.ai_client._add_bleed_derived` (line 3332)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._trim_anthropic_history` (line 1353)
- `src.ai_client.send` (line 3208)
- `src.ai_client._estimate_message_tokens` (line 1218)
- `src.ai_client._append_comms` (line 257)
- `src.ai_client._repair_deepseek_history` (line 2138)
- `src.ai_client._add_history_cache_breakpoint` (line 1299)
- `src.ai_client._trim_minimax_history` (line 2482)
- `src.ai_client._send_gemini` (line 1802)
- `src.ai_client._execute_single_tool_call_async` (line 945)
- `src.ai_client._send_llama_native` (line 2958)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client._send_minimax` (line 2616)
- `src.ai_client._repair_minimax_history` (line 2462)
- `src.ai_client._dashscope_call` (line 2716)
### `src\app_controller.py` (5 consumers)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller._on_comms_entry` (line 4282)
- `src.app_controller._start_track_logic_result` (line 4728)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller._refresh_api_metrics` (line 3074)
- `src.app_controller._on_comms_entry` (line 4282)
- `src.app_controller._start_track_logic` (line 4721)
### `src\models.py` (22 consumers)
- `src.models.from_dict` (line 920)
- `src.models.from_dict` (line 603)
- `src.models.from_dict` (line 506)
- `src.models.from_dict` (line 814)
- `src.models.from_dict` (line 893)
- `src.models.from_dict` (line 378)
- `src.models.from_dict` (line 1038)
- `src.models.from_dict` (line 1007)
- `src.models.from_dict` (line 747)
- `src.models.from_dict` (line 683)
- `src.models.from_dict` (line 712)
- `src.models.from_dict` (line 866)
- `src.models.from_dict` (line 454)
- `src.models.from_dict` (line 575)
- `src.models.from_dict` (line 630)
- `src.models.from_dict` (line 712)
- `src.models.from_dict` (line 747)
- `src.models._save_config_to_disk` (line 199)
- `src.models.from_dict` (line 575)
- `src.models.from_dict` (line 683)
- `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 295)
- `src.models.from_dict` (line 416)
- `src.models.from_dict` (line 656)
- `src.models.from_dict` (line 1072)
- `src.models.from_dict` (line 295)
- `src.models.from_dict` (line 656)
- `src.models.from_dict` (line 416)
- `src.models.from_dict` (line 603)
- `src.models.from_dict` (line 920)
- `src.models.from_dict` (line 814)
- `src.models.from_dict` (line 506)
- `src.models.from_dict` (line 893)
- `src.models.from_dict` (line 378)
### `src\project_manager.py` (5 consumers)
- `src.project_manager.save_project` (line 229)
- `src.project_manager.format_discussion` (line 69)
- `src.project_manager.entry_to_str` (line 49)
- `src.project_manager.flat_config` (line 267)
- `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)
- `src.provider_state.append` (line 30)
## Field access matrix
| consumer | _offload_entry_payload | _pending_comms | _pending_comms_lock | _pending_gui_tasks | _pending_gui_tasks_lock | _pending_history_adds | _pending_history_adds_lock | _token_history | _topological_sort_tickets_result | active_discussion | active_project_path | active_project_root | ai_status | append | config | content | context_files | discussion | encode | engines |
| consumer | _est_tokens | _gemini_cache_text | _offload_entry_payload | _pending_comms | _pending_comms_lock | _pending_gui_tasks | _pending_gui_tasks_lock | _pending_history_adds | _pending_history_adds_lock | _recalculate_session_usage | _token_history | _token_stats | _topological_sort_tickets_result | _update_cached_stats | active_discussion | active_project_path | active_project_root | ai_status | append | config |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| `_invalidate_token_estimate` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `build_markdown_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_create_gemini_cache_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_grok` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_strip_private_keys` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_send_gemini_cli` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_send_gemini` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_send_anthropic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `save_project` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 2 | . | . |
| `_trim_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `append` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_llama` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `build_tier3_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_offload_entry_payload` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `entry_to_str` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_strip_stale_file_refreshes` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_deepseek` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_add_bleed_derived` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `build_markdown_no_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `flat_config` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_llama_native` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `ollama_chat` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_qwen` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_on_comms_entry` | 1 | 1 | 1 | . | . | 4 | 4 | 1 | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_repair_deepseek_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `replace_all` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_execute_single_tool_call_async` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_repair_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_strip_cache_controls` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `run` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_estimate_prompt_tokens` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `build_tier3_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_grok` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_create_gemini_cache_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_deepseek` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_gemini_cli` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_build_files_section_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `build_markdown_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_qwen` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_pre_dispatch` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_save_config_to_disk` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_dashscope_call` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_start_track_logic_result` | . | . | . | 2 | 2 | . | . | . | 1 | 1 | 1 | 1 | 4 | . | 1 | . | 1 | . | . | 1 |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `replace_all` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_strip_stale_file_refreshes` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `run` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_anthropic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_invalidate_token_estimate` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_add_bleed_derived` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_start_track_logic_result` | . | . | . | . | . | 2 | 2 | . | . | . | . | . | 1 | . | 1 | 1 | 1 | 4 | . | 1 |
| `append` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `entry_to_str` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `ollama_chat` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_trim_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_offload_entry_payload` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `send` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 |
| `_estimate_message_tokens` | 1 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_refresh_api_metrics` | . | 1 | . | . | . | . | . | . | . | 1 | . | 1 | . | 1 | . | . | . | . | . | . |
| `_on_comms_entry` | . | . | 1 | 1 | 1 | . | . | 4 | 4 | . | 1 | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_append_comms` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_deepseek_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_add_history_cache_breakpoint` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_trim_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
_... 25 more fields_
_... 33 more fields_
## Access pattern
@@ -308,82 +308,82 @@ _... 25 more fields_
**Per-function pattern distribution:**
- `whole_struct`: 27 functions (54%)
- `whole_struct`: 26 functions (52%)
- `mixed`: 19 functions (38%)
- `field_by_field`: 4 functions (8%)
- `field_by_field`: 5 functions (10%)
## SSDL Sketch for `HistoryMessage`
```
[Q:HistoryMessage entry-point] -> [Q:PCG lookup]
-> [1: _invalidate_token_estimate] [B:check] (branches=0)
-> [1: _send_llama] [B:check] (branches=13)
-> [2: from_dict] [B:check] (branches=0)
-> [3: build_markdown_from_items] [B:check] (branches=9)
-> [4: from_dict] [B:check] (branches=0)
-> [5: _create_gemini_cache_result] [B:check] (branches=3)
-> [6: _send_grok] [B:check] (branches=14)
-> [7: _strip_private_keys] [B:check] (branches=0)
-> [8: from_dict] [B:check] (branches=0)
-> [9: _send_gemini_cli] [B:is None?] (branches=23) [N:safe]
-> [10: from_dict] [B:check] (branches=0)
-> [11: from_dict] [B:check] (branches=0)
-> [12: _send_gemini] [B:is None?] (branches=75) [N:safe]
-> [3: _strip_cache_controls] [B:check] (branches=4)
-> [4: _estimate_prompt_tokens] [B:check] (branches=2)
-> [5: build_tier3_context] [B:check] (branches=50)
-> [6: format_discussion] [B:check] (branches=0)
-> [7: _send_grok] [B:check] (branches=14)
-> [8: _create_gemini_cache_result] [B:check] (branches=3)
-> [9: _send_deepseek] [B:check] (branches=71)
-> [10: _send_gemini_cli] [B:is None?] (branches=23) [N:safe]
-> [11: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe]
-> [12: from_dict] [B:check] (branches=0)
-> [13: from_dict] [B:check] (branches=0)
-> [14: from_dict] [B:check] (branches=0)
-> [15: _send_anthropic] [B:is None?] (branches=40) [N:safe]
-> [16: save_project] [B:is None?] (branches=7) [N:safe]
-> [17: _trim_anthropic_history] [B:check] (branches=13)
-> [18: append] [B:check] (branches=1)
-> [19: _send_llama] [B:check] (branches=13)
-> [20: build_tier3_context] [B:check] (branches=50)
-> [21: _offload_entry_payload] [B:check] (branches=10)
-> [22: format_discussion] [B:check] (branches=0)
-> [23: entry_to_str] [B:check] (branches=3)
-> [24: _repair_minimax_history] [B:check] (branches=10)
-> [25: from_dict] [B:check] (branches=0)
-> [26: from_dict] [B:check] (branches=0)
-> [27: _strip_stale_file_refreshes] [B:check] (branches=12)
-> [28: _send_deepseek] [B:check] (branches=71)
-> [29: _add_bleed_derived] [B:check] (branches=0)
-> [30: from_dict] [B:check] (branches=0)
-> [31: build_markdown_no_history] [B:check] (branches=0)
-> [32: flat_config] [B:check] (branches=2)
-> [33: _send_llama_native] [B:check] (branches=12)
-> [14: build_markdown_from_items] [B:check] (branches=9)
-> [15: from_dict] [B:check] (branches=0)
-> [16: _send_qwen] [B:check] (branches=9)
-> [17: _repair_anthropic_history] [B:check] (branches=6)
-> [18: from_dict] [B:check] (branches=0)
-> [19: _pre_dispatch] [B:check] (branches=8)
-> [20: _save_config_to_disk] [B:check] (branches=1)
-> [21: from_dict] [B:check] (branches=0)
-> [22: from_dict] [B:check] (branches=0)
-> [23: from_dict] [B:check] (branches=0)
-> [24: from_dict] [B:check] (branches=0)
-> [25: replace_all] [B:check] (branches=1)
-> [26: _strip_stale_file_refreshes] [B:check] (branches=12)
-> [27: run] [B:check] (branches=1)
-> [28: _send_anthropic] [B:is None?] (branches=40) [N:safe]
-> [29: _invalidate_token_estimate] [B:check] (branches=0)
-> [30: _add_bleed_derived] [B:check] (branches=0)
-> [31: _start_track_logic_result] [B:check] (branches=10)
-> [32: append] [B:check] (branches=1)
-> [33: entry_to_str] [B:check] (branches=3)
-> [34: ollama_chat] [B:check] (branches=3)
-> [35: _send_qwen] [B:check] (branches=9)
-> [36: _on_comms_entry] [B:check] (branches=32)
-> [35: _trim_anthropic_history] [B:check] (branches=13)
-> [36: _offload_entry_payload] [B:check] (branches=10)
-> [37: from_dict] [B:check] (branches=0)
-> [38: from_dict] [B:check] (branches=0)
-> [39: _repair_deepseek_history] [B:check] (branches=6)
-> [40: from_dict] [B:check] (branches=0)
-> [41: replace_all] [B:check] (branches=1)
-> [42: from_dict] [B:check] (branches=0)
-> [43: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe]
-> [39: from_dict] [B:check] (branches=0)
-> [40: send] [B:check] (branches=19)
-> [41: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe]
-> [42: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe]
-> [43: _on_comms_entry] [B:check] (branches=32)
-> [44: from_dict] [B:check] (branches=0)
-> [45: _repair_anthropic_history] [B:check] (branches=6)
-> [46: _strip_cache_controls] [B:check] (branches=4)
-> [47: run] [B:check] (branches=1)
-> [48: _save_config_to_disk] [B:check] (branches=1)
-> [49: _dashscope_call] [B:check] (branches=5)
-> [50: _start_track_logic_result] [B:check] (branches=10)
-> [51: from_dict] [B:check] (branches=0)
-> [52: _estimate_prompt_tokens] [B:check] (branches=2)
-> [53: _append_comms] [B:is None?] (branches=1) [N:safe]
-> [54: from_dict] [B:check] (branches=0)
-> [55: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe]
-> [56: _add_history_cache_breakpoint] [B:check] (branches=5)
-> [57: _pre_dispatch] [B:check] (branches=8)
-> [45: _append_comms] [B:is None?] (branches=1) [N:safe]
-> [46: from_dict] [B:check] (branches=0)
-> [47: _repair_deepseek_history] [B:check] (branches=6)
-> [48: from_dict] [B:check] (branches=0)
-> [49: _add_history_cache_breakpoint] [B:check] (branches=5)
-> [50: _trim_minimax_history] [B:check] (branches=8)
-> [51: _send_gemini] [B:is None?] (branches=75) [N:safe]
-> [52: flat_config] [B:check] (branches=2)
-> [53: save_project] [B:is None?] (branches=7) [N:safe]
-> [54: build_markdown_no_history] [B:check] (branches=0)
-> [55: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe]
-> [56: _send_llama_native] [B:check] (branches=12)
-> [57: _strip_private_keys] [B:check] (branches=0)
-> [58: from_dict] [B:check] (branches=0)
-> [59: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe]
-> [60: _trim_minimax_history] [B:check] (branches=8)
-> [61: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe]
-> [62: _start_track_logic] [B:check] (branches=1)
-> [63: from_dict] [B:check] (branches=0)
-> [64: from_dict] [B:check] (branches=0)
-> [65: from_dict] [B:check] (branches=0)
-> [66: migrate_from_legacy_config] [B:check] (branches=2)
-> [67: _send_minimax] [B:check] (branches=11)
-> [68: send] [B:check] (branches=19)
-> [59: from_dict] [B:check] (branches=0)
-> [60: _send_minimax] [B:check] (branches=11)
-> [61: from_dict] [B:check] (branches=0)
-> [62: from_dict] [B:check] (branches=0)
-> [63: _repair_minimax_history] [B:check] (branches=10)
-> [64: _start_track_logic] [B:check] (branches=1)
-> [65: migrate_from_legacy_config] [B:check] (branches=2)
-> [66: _dashscope_call] [B:check] (branches=5)
-> [67: from_dict] [B:check] (branches=0)
-> [68: from_dict] [B:check] (branches=0)
-> [T:done]
```
@@ -395,8 +395,8 @@ _... 25 more fields_
- **Nil Sentinel `[N]`**: Introduce a module-level `NIL_<AGGREGATE>` 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 137 field-check branches to 1 cache lookup.
- Effective codepaths: 40140116231395706750394 -> 137
- **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 144 field-check branches to 1 cache lookup.
- Effective codepaths: 40140116231395706750394 -> 144
- **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
@@ -423,13 +423,13 @@ _... 25 more fields_
## Type alias coverage
**Summary:** 137 sites; 0 typed (0%); 137 untyped (100%)
**Summary:** 144 sites; 0 typed (0%); 144 untyped (100%)
| metric | value |
|---|---|
| total field-access sites | 137 |
| total field-access sites | 144 |
| typed sites (canonical field) | 0 |
| untyped sites (wildcard) | 137 |
| untyped sites (wildcard) | 144 |
## Cross-audit findings
@@ -452,13 +452,14 @@ _(no cross-audit findings mapped to this aggregate)_
| `content` | 15 | hot |
| `marker` | 15 | hot |
| `get` | 7 | hot |
| `append` | 3 | hot |
| `pop` | 2 | used |
| `files` | 2 | used |
| `pop` | 3 | hot |
| `append` | 2 | used |
| `lock` | 2 | used |
| `messages` | 2 | used |
| `encode` | 1 | used |
| `discussion` | 1 | used |
| `config` | 2 | used |
| `session_usage` | 2 | used |
| `output` | 1 | used |
| `files` | 1 | used |
| `estimated_prompt_tokens` | 1 | used |
| `max_prompt_tokens` | 1 | used |
| `utilization_pct` | 1 | used |
@@ -467,17 +468,6 @@ _(no cross-audit findings mapped to this aggregate)_
| `sys_tokens` | 1 | used |
| `tool_tokens` | 1 | used |
| `history_tokens` | 1 | used |
| `local_ts` | 1 | used |
| `_offload_entry_payload` | 1 | used |
| `ui_auto_add_history` | 1 | used |
| `_pending_comms_lock` | 1 | used |
| `session_usage` | 1 | used |
| `_pending_history_adds_lock` | 1 | used |
| `_token_history` | 1 | used |
| `_pending_comms` | 1 | used |
| `_pending_history_adds` | 1 | used |
| `items` | 1 | used |
| `output` | 1 | used |
| `ai_status` | 1 | used |
| `context_files` | 1 | used |
| `_pending_gui_tasks_lock` | 1 | used |
@@ -489,11 +479,29 @@ _(no cross-audit findings mapped to this aggregate)_
| `active_discussion` | 1 | used |
| `submit_io` | 1 | used |
| `tracks` | 1 | used |
| `config` | 1 | used |
| `mma_tier_usage` | 1 | used |
| `_pending_gui_tasks` | 1 | used |
| `mma_step_mode` | 1 | used |
| `active_project_path` | 1 | used |
| `search` | 1 | used |
| `_est_tokens` | 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 |
| `usage` | 1 | used |
| `local_ts` | 1 | used |
| `_offload_entry_payload` | 1 | used |
| `ui_auto_add_history` | 1 | used |
| `_pending_comms_lock` | 1 | used |
| `_pending_history_adds_lock` | 1 | used |
| `_token_history` | 1 | used |
| `_pending_comms` | 1 | used |
| `_pending_history_adds` | 1 | used |
## Optimization candidates
@@ -509,63 +517,63 @@ HistoryMessage: access_pattern=whole_struct, frequency=per_turn, struct_field_co
| function | pattern | field_accesses | confidence |
|---|---|---|---|
| `src.ai_client._invalidate_token_estimate` | `whole_struct` | `pop`=1 | high |
| `src.ai_client._send_llama` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._strip_cache_controls` | `whole_struct` | | low |
| `src.ai_client._estimate_prompt_tokens` | `whole_struct` | | low |
| `src.aggregate.build_tier3_context` | `whole_struct` | | low |
| `src.project_manager.format_discussion` | `whole_struct` | | low |
| `src.ai_client._send_grok` | `whole_struct` | | low |
| `src.ai_client._create_gemini_cache_result` | `whole_struct` | | low |
| `src.ai_client._send_deepseek` | `whole_struct` | | low |
| `src.ai_client._send_gemini_cli` | `whole_struct` | | low |
| `src.aggregate._build_files_section_from_items` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.aggregate.build_markdown_from_items` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._create_gemini_cache_result` | `whole_struct` | | low |
| `src.ai_client._send_grok` | `whole_struct` | | low |
| `src.ai_client._strip_private_keys` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._send_gemini_cli` | `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.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.project_manager.save_project` | `mixed` | `discussion`=2, `files`=3 | high |
| `src.ai_client._trim_anthropic_history` | `whole_struct` | `pop`=5 | high |
| `src.provider_state.append` | `mixed` | `lock`=1, `messages`=1 | high |
| `src.ai_client._send_llama` | `whole_struct` | | low |
| `src.aggregate.build_tier3_context` | `whole_struct` | | low |
| `src.app_controller._offload_entry_payload` | `whole_struct` | | low |
| `src.project_manager.format_discussion` | `whole_struct` | | low |
| `src.project_manager.entry_to_str` | `whole_struct` | `get`=4 | high |
| `src.ai_client._repair_minimax_history` | `whole_struct` | `append`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._strip_stale_file_refreshes` | `whole_struct` | | low |
| `src.ai_client._send_deepseek` | `whole_struct` | | low |
| `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.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.aggregate.build_markdown_no_history` | `whole_struct` | | low |
| `src.project_manager.flat_config` | `whole_struct` | `get`=7 | high |
| `src.ai_client._send_llama_native` | `whole_struct` | | low |
| `src.ai_client.ollama_chat` | `whole_struct` | | low |
| `src.ai_client._send_qwen` | `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.ai_client._pre_dispatch` | `whole_struct` | | low |
| `src.models._save_config_to_disk` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.provider_state.replace_all` | `mixed` | `lock`=1, `messages`=1 | high |
| `src.ai_client._strip_stale_file_refreshes` | `whole_struct` | | low |
| `src.aggregate.run` | `field_by_field` | `output`=1, `files`=2, `get`=7 | high |
| `src.ai_client._send_anthropic` | `whole_struct` | | low |
| `src.ai_client._invalidate_token_estimate` | `whole_struct` | `pop`=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.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.provider_state.append` | `mixed` | `lock`=1, `messages`=1 | high |
| `src.project_manager.entry_to_str` | `whole_struct` | `get`=4 | high |
| `src.ai_client.ollama_chat` | `whole_struct` | | low |
| `src.ai_client._trim_anthropic_history` | `whole_struct` | `pop`=5 | high |
| `src.app_controller._offload_entry_payload` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client.send` | `mixed` | `config`=1, `search`=1 | high |
| `src.ai_client._estimate_message_tokens` | `mixed` | `_est_tokens`=1, `get`=2 | high |
| `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.app_controller._on_comms_entry` | `field_by_field` | `local_ts`=1, `_offload_entry_payload`=1, `get`=7, `ui_auto_add_history`=3, `_pending_comms_lock`=1, `session_usage`=5, `_pending_history_adds_lock`=4, `_token_history`=1, `_pending_comms`=1, `_pending_history_adds`=4 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._append_comms` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._repair_deepseek_history` | `whole_struct` | `append`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.provider_state.replace_all` | `mixed` | `lock`=1, `messages`=1 | high |
| `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_anthropic_history` | `whole_struct` | `append`=1 | high |
| `src.ai_client._strip_cache_controls` | `whole_struct` | | low |
| `src.aggregate.run` | `field_by_field` | `output`=1, `files`=2, `get`=7 | high |
| `src.models._save_config_to_disk` | `whole_struct` | | low |
| `src.ai_client._dashscope_call` | `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._add_history_cache_breakpoint` | `whole_struct` | | low |
| `src.ai_client._trim_minimax_history` | `whole_struct` | `pop`=4 | high |
### Frequency evidence
| function | frequency | source | note |
|---|---|---|---|
| `src.ai_client._extract_dashscope_tool_calls` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.api_hook_client.get_warmup_wait` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py |
| `src.app_controller.wait` | `per_turn` | `static_analysis` | producer from src\app_controller.py |
| `src.ai_client._dashscope_call` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.app_controller._pending_mma_spawn` | `per_turn` | `static_analysis` | producer from src\app_controller.py |
| `src.app_controller._api_get_context` | `per_turn` | `static_analysis` | producer from src\app_controller.py |
| `src.ai_client.get_comms_log` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.api_hook_client.post_project` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py |
| `src.api_hook_client.get_node_status` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py |
| `src.models.to_dict` | `per_turn` | `static_analysis` | producer from src\models.py |
File diff suppressed because it is too large Load Diff
@@ -23,123 +23,123 @@
### `src\ai_client.py` (16 producers)
- `src.ai_client._extract_dashscope_tool_calls` (line 2754)
- `src.ai_client._dashscope_call` (line 2716)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client._parse_tool_args_result` (line 741)
- `src.ai_client._build_chunked_context_blocks` (line 1281)
- `src.ai_client._get_anthropic_tools` (line 664)
- `src.ai_client._get_deepseek_tools` (line 1194)
- `src.ai_client._pre_dispatch` (line 2089)
- `src.ai_client.get_gemini_cache_stats` (line 1604)
- `src.ai_client._load_credentials` (line 282)
- `src.ai_client.get_token_stats` (line 3185)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client.get_comms_log` (line 273)
- `src.ai_client._content_block_to_dict` (line 1200)
- `src.ai_client._parse_tool_args_result` (line 741)
- `src.ai_client._get_anthropic_tools` (line 664)
- `src.ai_client._dashscope_call` (line 2716)
- `src.ai_client._pre_dispatch` (line 2089)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._load_credentials` (line 282)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client.get_token_stats` (line 3185)
- `src.ai_client._add_bleed_derived` (line 3332)
- `src.ai_client._send_cli_round_result` (line 1746)
- `src.ai_client._extract_dashscope_tool_calls` (line 2754)
- `src.ai_client.get_gemini_cache_stats` (line 1604)
- `src.ai_client._get_deepseek_tools` (line 1194)
- `src.ai_client._content_block_to_dict` (line 1200)
- `src.ai_client._build_chunked_context_blocks` (line 1281)
### `src\api_hook_client.py` (39 producers)
- `src.api_hook_client.get_warmup_wait` (line 332)
- `src.api_hook_client.wait_for_event` (line 136)
- `src.api_hook_client.clear_events` (line 129)
- `src.api_hook_client.get_warmup_status` (line 325)
- `src.api_hook_client.get_project` (line 367)
- `src.api_hook_client.get_mma_workers` (line 546)
- `src.api_hook_client.reject_patch` (line 288)
- `src.api_hook_client.get_gui_state` (line 165)
- `src.api_hook_client.get_events` (line 124)
- `src.api_hook_client.post_project` (line 473)
- `src.api_hook_client.get_session` (line 502)
- `src.api_hook_client.get_io_pool_status` (line 420)
- `src.api_hook_client.trigger_patch` (line 274)
- `src.api_hook_client.get_node_status` (line 532)
- `src.api_hook_client.click` (line 223)
- `src.api_hook_client.get_startup_timeline` (line 353)
- `src.api_hook_client.select_tab` (line 263)
- `src.api_hook_client.reject_patch` (line 288)
- `src.api_hook_client.clear_events` (line 129)
- `src.api_hook_client.post_gui` (line 149)
- `src.api_hook_client.get_warmup_status` (line 325)
- `src.api_hook_client.select_list_item` (line 256)
- `src.api_hook_client.get_gui_health` (line 434)
- `src.api_hook_client.wait_for_event` (line 136)
- `src.api_hook_client.post_project` (line 470)
- `src.api_hook_client.apply_patch` (line 281)
- `src.api_hook_client.get_project_switch_status` (line 374)
- `src.api_hook_client.get_io_pool_status` (line 420)
- `src.api_hook_client.get_financial_metrics` (line 520)
- `src.api_hook_client.drag` (line 230)
- `src.api_hook_client.get_warmup_canaries` (line 342)
- `src.api_hook_client.get_gui_diagnostics` (line 311)
- `src.api_hook_client.trigger_patch` (line 274)
- `src.api_hook_client.get_project` (line 367)
- `src.api_hook_client.get_events` (line 124)
- `src.api_hook_client.get_warmup_wait` (line 332)
- `src.api_hook_client.set_value` (line 212)
- `src.api_hook_client.get_mma_status` (line 539)
- `src.api_hook_client.post_session` (line 117)
- `src.api_hook_client.wait_for_project_switch` (line 389)
- `src.api_hook_client.get_performance` (line 318)
- `src.api_hook_client.get_system_telemetry` (line 524)
- `src.api_hook_client.push_event` (line 156)
- `src.api_hook_client.get_gui_state` (line 165)
- `src.api_hook_client._make_request` (line 65)
- `src.api_hook_client.get_status` (line 105)
- `src.api_hook_client.get_context_state` (line 491)
- `src.api_hook_client.set_value` (line 212)
- `src.api_hook_client.post_gui` (line 149)
- `src.api_hook_client.get_gui_diagnostics` (line 311)
- `src.api_hook_client.get_mma_status` (line 539)
- `src.api_hook_client.get_startup_timeline` (line 353)
- `src.api_hook_client.get_node_status` (line 532)
- `src.api_hook_client.get_performance` (line 318)
- `src.api_hook_client.post_session` (line 117)
- `src.api_hook_client.push_event` (line 156)
- `src.api_hook_client.get_warmup_canaries` (line 342)
- `src.api_hook_client.drag` (line 230)
- `src.api_hook_client.apply_patch` (line 281)
- `src.api_hook_client.post_project` (line 470)
- `src.api_hook_client.get_patch_status` (line 295)
- `src.api_hook_client.wait_for_project_switch` (line 389)
- `src.api_hook_client.click` (line 223)
- `src.api_hook_client.select_list_item` (line 256)
- `src.api_hook_client.get_project_switch_status` (line 374)
- `src.api_hook_client.get_system_telemetry` (line 524)
- `src.api_hook_client._make_request` (line 65)
- `src.api_hook_client.select_tab` (line 263)
- `src.api_hook_client.get_session` (line 502)
- `src.api_hook_client.get_mma_workers` (line 546)
- `src.api_hook_client.right_click` (line 237)
- `src.api_hook_client.get_financial_metrics` (line 520)
- `src.api_hook_client.get_patch_status` (line 295)
### `src\app_controller.py` (30 producers)
- `src.app_controller.wait` (line 5205)
- `src.app_controller._pending_mma_spawn` (line 2772)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller._api_get_diagnostics` (line 202)
- `src.app_controller.get_gui_state` (line 2829)
- `src.app_controller.load_config` (line 5142)
- `src.app_controller._api_get_session` (line 374)
- `src.app_controller._api_pending_actions` (line 335)
- `src.app_controller.get_context` (line 2892)
- `src.app_controller.token_stats` (line 2898)
- `src.app_controller._api_get_api_project` (line 188)
- `src.app_controller._api_get_context` (line 398)
- `src.app_controller._api_token_stats` (line 417)
- `src.app_controller.get_mma_status` (line 2835)
- `src.app_controller._api_get_performance` (line 195)
- `src.app_controller._api_get_api_session` (line 170)
- `src.app_controller._api_get_gui_state` (line 123)
- `src.app_controller.get_performance` (line 2856)
- `src.app_controller.pending_actions` (line 2874)
- `src.app_controller.status` (line 2865)
- `src.app_controller._api_get_mma_status` (line 144)
- `src.app_controller.generate` (line 2868)
- `src.app_controller.get_api_project` (line 2853)
- `src.app_controller._api_status` (line 209)
- `src.app_controller._api_generate` (line 221)
- `src.app_controller.get_session` (line 2883)
- `src.app_controller.get_diagnostics` (line 2862)
- `src.app_controller.get_session_insights` (line 3049)
- `src.app_controller._pending_mma_approval` (line 2776)
- `src.app_controller.get_api_session` (line 2847)
- `src.app_controller._api_get_gui_state` (line 123)
- `src.app_controller.get_api_project` (line 2853)
- `src.app_controller._api_get_performance` (line 195)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller.get_gui_state` (line 2829)
- `src.app_controller.get_performance` (line 2856)
- `src.app_controller._api_status` (line 209)
- `src.app_controller._api_get_mma_status` (line 144)
- `src.app_controller.get_mma_status` (line 2835)
- `src.app_controller._pending_mma_spawn` (line 2772)
- `src.app_controller.get_diagnostics` (line 2862)
- `src.app_controller._api_pending_actions` (line 335)
- `src.app_controller._api_token_stats` (line 417)
- `src.app_controller.wait` (line 5205)
- `src.app_controller.pending_actions` (line 2874)
- `src.app_controller.load_config` (line 5142)
- `src.app_controller._pending_mma_approval` (line 2776)
- `src.app_controller._api_get_diagnostics` (line 202)
- `src.app_controller.get_context` (line 2892)
- `src.app_controller.get_session` (line 2883)
- `src.app_controller._api_get_api_project` (line 188)
- `src.app_controller.get_session_insights` (line 3049)
- `src.app_controller._api_get_session` (line 374)
- `src.app_controller.token_stats` (line 2898)
- `src.app_controller._api_generate` (line 221)
- `src.app_controller.status` (line 2865)
- `src.app_controller.generate` (line 2868)
### `src\models.py` (23 producers)
- `src.models.to_dict` (line 646)
- `src.models.to_dict` (line 406)
- `src.models.to_dict` (line 855)
- `src.models.to_dict` (line 938)
- `src.models.to_dict` (line 1059)
- `src.models.parse_history_entries` (line 214)
- `src.models.to_dict` (line 288)
- `src.models.to_dict` (line 794)
- `src.models.to_dict` (line 1000)
- `src.models.to_dict` (line 672)
- `src.models.to_dict` (line 355)
- `src.models.to_dict` (line 486)
- `src.models.to_dict` (line 913)
- `src.models.to_dict` (line 596)
- `src.models.to_dict` (line 886)
- `src.models.to_dict` (line 701)
- `src.models.to_dict` (line 558)
- `src.models._load_config_from_disk` (line 186)
- `src.models.to_dict` (line 441)
- `src.models.to_dict` (line 1024)
- `src.models.to_dict` (line 971)
- `src.models.to_dict` (line 288)
- `src.models.to_dict` (line 737)
- `src.models.to_dict` (line 486)
- `src.models.to_dict` (line 618)
- `src.models.to_dict` (line 701)
- `src.models.to_dict` (line 886)
- `src.models.to_dict` (line 971)
- `src.models._load_config_from_disk` (line 186)
- `src.models.to_dict` (line 406)
- `src.models.to_dict` (line 646)
- `src.models.to_dict` (line 672)
- `src.models.to_dict` (line 355)
- `src.models.to_dict` (line 1059)
- `src.models.to_dict` (line 855)
- `src.models.to_dict` (line 1000)
- `src.models.parse_history_entries` (line 214)
- `src.models.to_dict` (line 938)
### `src\openai_compatible.py` (1 producer)
@@ -147,89 +147,89 @@
### `src\project_manager.py` (8 producers)
- `src.project_manager.get_all_tracks` (line 342)
- `src.project_manager.load_history` (line 209)
- `src.project_manager.str_to_entry` (line 75)
- `src.project_manager.load_project` (line 186)
- `src.project_manager.default_discussion` (line 117)
- `src.project_manager.default_project` (line 123)
- `src.project_manager.migrate_from_legacy_config` (line 253)
- `src.project_manager.flat_config` (line 267)
- `src.project_manager.load_project` (line 186)
- `src.project_manager.default_discussion` (line 117)
- `src.project_manager.get_all_tracks` (line 342)
## Consumers (67)
### `src\aggregate.py` (5 consumers)
- `src.aggregate.build_markdown_from_items` (line 348)
- `src.aggregate.build_tier3_context` (line 382)
- `src.aggregate.build_markdown_no_history` (line 366)
- `src.aggregate.run` (line 479)
- `src.aggregate._build_files_section_from_items` (line 300)
- `src.aggregate.build_markdown_from_items` (line 348)
- `src.aggregate.run` (line 479)
- `src.aggregate.build_markdown_no_history` (line 366)
### `src\ai_client.py` (29 consumers)
- `src.ai_client._invalidate_token_estimate` (line 1240)
- `src.ai_client._create_gemini_cache_result` (line 1706)
- `src.ai_client._send_grok` (line 2530)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client._send_gemini_cli` (line 2019)
- `src.ai_client._send_gemini` (line 1802)
- `src.ai_client._send_anthropic` (line 1405)
- `src.ai_client._trim_anthropic_history` (line 1353)
- `src.ai_client._send_llama` (line 2858)
- `src.ai_client._repair_minimax_history` (line 2462)
- `src.ai_client._strip_stale_file_refreshes` (line 1253)
- `src.ai_client._send_deepseek` (line 2165)
- `src.ai_client._add_bleed_derived` (line 3332)
- `src.ai_client._send_llama_native` (line 2958)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._send_qwen` (line 2773)
- `src.ai_client._repair_deepseek_history` (line 2138)
- `src.ai_client._execute_single_tool_call_async` (line 945)
- `src.ai_client._repair_anthropic_history` (line 1381)
- `src.ai_client._strip_cache_controls` (line 1291)
- `src.ai_client._dashscope_call` (line 2716)
- `src.ai_client._estimate_prompt_tokens` (line 1243)
- `src.ai_client._append_comms` (line 257)
- `src.ai_client._estimate_message_tokens` (line 1218)
- `src.ai_client._add_history_cache_breakpoint` (line 1299)
- `src.ai_client._send_grok` (line 2530)
- `src.ai_client._create_gemini_cache_result` (line 1706)
- `src.ai_client._send_deepseek` (line 2165)
- `src.ai_client._send_gemini_cli` (line 2019)
- `src.ai_client._send_qwen` (line 2773)
- `src.ai_client._repair_anthropic_history` (line 1381)
- `src.ai_client._pre_dispatch` (line 2089)
- `src.ai_client._trim_minimax_history` (line 2482)
- `src.ai_client._send_minimax` (line 2616)
- `src.ai_client._strip_stale_file_refreshes` (line 1253)
- `src.ai_client._send_anthropic` (line 1405)
- `src.ai_client._invalidate_token_estimate` (line 1240)
- `src.ai_client._add_bleed_derived` (line 3332)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._trim_anthropic_history` (line 1353)
- `src.ai_client.send` (line 3208)
- `src.ai_client._estimate_message_tokens` (line 1218)
- `src.ai_client._append_comms` (line 257)
- `src.ai_client._repair_deepseek_history` (line 2138)
- `src.ai_client._add_history_cache_breakpoint` (line 1299)
- `src.ai_client._trim_minimax_history` (line 2482)
- `src.ai_client._send_gemini` (line 1802)
- `src.ai_client._execute_single_tool_call_async` (line 945)
- `src.ai_client._send_llama_native` (line 2958)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client._send_minimax` (line 2616)
- `src.ai_client._repair_minimax_history` (line 2462)
- `src.ai_client._dashscope_call` (line 2716)
### `src\app_controller.py` (5 consumers)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller._on_comms_entry` (line 4282)
- `src.app_controller._start_track_logic_result` (line 4728)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller._refresh_api_metrics` (line 3074)
- `src.app_controller._on_comms_entry` (line 4282)
- `src.app_controller._start_track_logic` (line 4721)
### `src\models.py` (22 consumers)
- `src.models.from_dict` (line 920)
- `src.models.from_dict` (line 603)
- `src.models.from_dict` (line 506)
- `src.models.from_dict` (line 814)
- `src.models.from_dict` (line 893)
- `src.models.from_dict` (line 378)
- `src.models.from_dict` (line 1038)
- `src.models.from_dict` (line 1007)
- `src.models.from_dict` (line 747)
- `src.models.from_dict` (line 683)
- `src.models.from_dict` (line 712)
- `src.models.from_dict` (line 866)
- `src.models.from_dict` (line 454)
- `src.models.from_dict` (line 575)
- `src.models.from_dict` (line 630)
- `src.models.from_dict` (line 712)
- `src.models.from_dict` (line 747)
- `src.models._save_config_to_disk` (line 199)
- `src.models.from_dict` (line 575)
- `src.models.from_dict` (line 683)
- `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 295)
- `src.models.from_dict` (line 416)
- `src.models.from_dict` (line 656)
- `src.models.from_dict` (line 1072)
- `src.models.from_dict` (line 295)
- `src.models.from_dict` (line 656)
- `src.models.from_dict` (line 416)
- `src.models.from_dict` (line 603)
- `src.models.from_dict` (line 920)
- `src.models.from_dict` (line 814)
- `src.models.from_dict` (line 506)
- `src.models.from_dict` (line 893)
- `src.models.from_dict` (line 378)
### `src\openai_compatible.py` (1 consumer)
@@ -237,68 +237,68 @@
### `src\project_manager.py` (5 consumers)
- `src.project_manager.save_project` (line 229)
- `src.project_manager.format_discussion` (line 69)
- `src.project_manager.entry_to_str` (line 49)
- `src.project_manager.flat_config` (line 267)
- `src.project_manager.save_project` (line 229)
- `src.project_manager.migrate_from_legacy_config` (line 253)
## Field access matrix
| consumer | _offload_entry_payload | _pending_comms | _pending_comms_lock | _pending_gui_tasks | _pending_gui_tasks_lock | _pending_history_adds | _pending_history_adds_lock | _token_history | _topological_sort_tickets_result | active_discussion | active_project_path | active_project_root | ai_status | append | config | content | context_files | discussion | encode | engines |
| consumer | _est_tokens | _gemini_cache_text | _offload_entry_payload | _pending_comms | _pending_comms_lock | _pending_gui_tasks | _pending_gui_tasks_lock | _pending_history_adds | _pending_history_adds_lock | _recalculate_session_usage | _token_history | _token_stats | _topological_sort_tickets_result | _update_cached_stats | active_discussion | active_project_path | active_project_root | ai_status | append | config |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| `_invalidate_token_estimate` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `build_markdown_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_create_gemini_cache_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_grok` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_strip_private_keys` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_send_gemini_cli` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_send_gemini` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_send_anthropic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `save_project` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 2 | . | . |
| `_trim_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_llama` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `build_tier3_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_offload_entry_payload` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `entry_to_str` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_strip_stale_file_refreshes` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_deepseek` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_add_bleed_derived` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `build_markdown_no_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `flat_config` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_llama_native` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `ollama_chat` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_qwen` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_on_comms_entry` | 1 | 1 | 1 | . | . | 4 | 4 | 1 | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_repair_deepseek_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_execute_single_tool_call_async` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_to_dict_tool_call` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_strip_cache_controls` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `run` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_estimate_prompt_tokens` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `build_tier3_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_grok` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_create_gemini_cache_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_deepseek` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_gemini_cli` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_build_files_section_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `build_markdown_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_to_dict_tool_call` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_qwen` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_pre_dispatch` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_save_config_to_disk` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_dashscope_call` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_start_track_logic_result` | . | . | . | 2 | 2 | . | . | . | 1 | 1 | 1 | 1 | 4 | . | 1 | . | 1 | . | . | 1 |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_strip_stale_file_refreshes` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `run` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_anthropic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_invalidate_token_estimate` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_add_bleed_derived` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_start_track_logic_result` | . | . | . | . | . | 2 | 2 | . | . | . | . | . | 1 | . | 1 | 1 | 1 | 4 | . | 1 |
| `entry_to_str` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `ollama_chat` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_trim_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_offload_entry_payload` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `send` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 |
| `_estimate_message_tokens` | 1 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_refresh_api_metrics` | . | 1 | . | . | . | . | . | . | . | 1 | . | 1 | . | 1 | . | . | . | . | . | . |
| `_on_comms_entry` | . | . | 1 | 1 | 1 | . | . | 4 | 4 | . | 1 | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_append_comms` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_deepseek_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_add_history_cache_breakpoint` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_trim_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_gemini` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
_... 24 more fields_
_... 33 more fields_
## Access pattern
@@ -308,80 +308,80 @@ _... 24 more fields_
**Per-function pattern distribution:**
- `whole_struct`: 28 functions (56%)
- `mixed`: 18 functions (36%)
- `field_by_field`: 4 functions (8%)
- `mixed`: 17 functions (34%)
- `field_by_field`: 5 functions (10%)
## SSDL Sketch for `ToolCall`
```
[Q:ToolCall entry-point] -> [Q:PCG lookup]
-> [1: _invalidate_token_estimate] [B:check] (branches=0)
-> [1: _send_llama] [B:check] (branches=13)
-> [2: from_dict] [B:check] (branches=0)
-> [3: build_markdown_from_items] [B:check] (branches=9)
-> [4: from_dict] [B:check] (branches=0)
-> [5: _create_gemini_cache_result] [B:check] (branches=3)
-> [6: _send_grok] [B:check] (branches=14)
-> [7: _strip_private_keys] [B:check] (branches=0)
-> [8: from_dict] [B:check] (branches=0)
-> [9: _send_gemini_cli] [B:is None?] (branches=23) [N:safe]
-> [10: from_dict] [B:check] (branches=0)
-> [11: from_dict] [B:check] (branches=0)
-> [12: _send_gemini] [B:is None?] (branches=75) [N:safe]
-> [3: _strip_cache_controls] [B:check] (branches=4)
-> [4: _estimate_prompt_tokens] [B:check] (branches=2)
-> [5: build_tier3_context] [B:check] (branches=50)
-> [6: format_discussion] [B:check] (branches=0)
-> [7: _send_grok] [B:check] (branches=14)
-> [8: _create_gemini_cache_result] [B:check] (branches=3)
-> [9: _send_deepseek] [B:check] (branches=71)
-> [10: _send_gemini_cli] [B:is None?] (branches=23) [N:safe]
-> [11: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe]
-> [12: from_dict] [B:check] (branches=0)
-> [13: from_dict] [B:check] (branches=0)
-> [14: from_dict] [B:check] (branches=0)
-> [15: _send_anthropic] [B:is None?] (branches=40) [N:safe]
-> [16: save_project] [B:is None?] (branches=7) [N:safe]
-> [17: _trim_anthropic_history] [B:check] (branches=13)
-> [18: _send_llama] [B:check] (branches=13)
-> [19: build_tier3_context] [B:check] (branches=50)
-> [20: _offload_entry_payload] [B:check] (branches=10)
-> [21: format_discussion] [B:check] (branches=0)
-> [22: entry_to_str] [B:check] (branches=3)
-> [23: _repair_minimax_history] [B:check] (branches=10)
-> [14: build_markdown_from_items] [B:check] (branches=9)
-> [15: from_dict] [B:check] (branches=0)
-> [16: _to_dict_tool_call] [B:check] (branches=0)
-> [17: _send_qwen] [B:check] (branches=9)
-> [18: _repair_anthropic_history] [B:check] (branches=6)
-> [19: from_dict] [B:check] (branches=0)
-> [20: _pre_dispatch] [B:check] (branches=8)
-> [21: _save_config_to_disk] [B:check] (branches=1)
-> [22: from_dict] [B:check] (branches=0)
-> [23: from_dict] [B:check] (branches=0)
-> [24: from_dict] [B:check] (branches=0)
-> [25: from_dict] [B:check] (branches=0)
-> [26: _strip_stale_file_refreshes] [B:check] (branches=12)
-> [27: _send_deepseek] [B:check] (branches=71)
-> [28: _add_bleed_derived] [B:check] (branches=0)
-> [29: from_dict] [B:check] (branches=0)
-> [30: build_markdown_no_history] [B:check] (branches=0)
-> [31: flat_config] [B:check] (branches=2)
-> [32: _send_llama_native] [B:check] (branches=12)
-> [27: run] [B:check] (branches=1)
-> [28: _send_anthropic] [B:is None?] (branches=40) [N:safe]
-> [29: _invalidate_token_estimate] [B:check] (branches=0)
-> [30: _add_bleed_derived] [B:check] (branches=0)
-> [31: _start_track_logic_result] [B:check] (branches=10)
-> [32: entry_to_str] [B:check] (branches=3)
-> [33: ollama_chat] [B:check] (branches=3)
-> [34: _send_qwen] [B:check] (branches=9)
-> [35: _on_comms_entry] [B:check] (branches=32)
-> [34: _trim_anthropic_history] [B:check] (branches=13)
-> [35: _offload_entry_payload] [B:check] (branches=10)
-> [36: from_dict] [B:check] (branches=0)
-> [37: from_dict] [B:check] (branches=0)
-> [38: _repair_deepseek_history] [B:check] (branches=6)
-> [39: from_dict] [B:check] (branches=0)
-> [40: from_dict] [B:check] (branches=0)
-> [41: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe]
-> [42: from_dict] [B:check] (branches=0)
-> [43: _to_dict_tool_call] [B:check] (branches=0)
-> [44: _repair_anthropic_history] [B:check] (branches=6)
-> [45: _strip_cache_controls] [B:check] (branches=4)
-> [46: run] [B:check] (branches=1)
-> [47: _save_config_to_disk] [B:check] (branches=1)
-> [48: _dashscope_call] [B:check] (branches=5)
-> [49: _start_track_logic_result] [B:check] (branches=10)
-> [50: from_dict] [B:check] (branches=0)
-> [51: _estimate_prompt_tokens] [B:check] (branches=2)
-> [52: _append_comms] [B:is None?] (branches=1) [N:safe]
-> [53: from_dict] [B:check] (branches=0)
-> [54: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe]
-> [55: _add_history_cache_breakpoint] [B:check] (branches=5)
-> [56: _pre_dispatch] [B:check] (branches=8)
-> [38: from_dict] [B:check] (branches=0)
-> [39: send] [B:check] (branches=19)
-> [40: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe]
-> [41: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe]
-> [42: _on_comms_entry] [B:check] (branches=32)
-> [43: from_dict] [B:check] (branches=0)
-> [44: _append_comms] [B:is None?] (branches=1) [N:safe]
-> [45: from_dict] [B:check] (branches=0)
-> [46: _repair_deepseek_history] [B:check] (branches=6)
-> [47: from_dict] [B:check] (branches=0)
-> [48: _add_history_cache_breakpoint] [B:check] (branches=5)
-> [49: _trim_minimax_history] [B:check] (branches=8)
-> [50: _send_gemini] [B:is None?] (branches=75) [N:safe]
-> [51: flat_config] [B:check] (branches=2)
-> [52: save_project] [B:is None?] (branches=7) [N:safe]
-> [53: build_markdown_no_history] [B:check] (branches=0)
-> [54: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe]
-> [55: _send_llama_native] [B:check] (branches=12)
-> [56: _strip_private_keys] [B:check] (branches=0)
-> [57: from_dict] [B:check] (branches=0)
-> [58: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe]
-> [59: _trim_minimax_history] [B:check] (branches=8)
-> [60: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe]
-> [61: _start_track_logic] [B:check] (branches=1)
-> [62: from_dict] [B:check] (branches=0)
-> [63: from_dict] [B:check] (branches=0)
-> [64: from_dict] [B:check] (branches=0)
-> [65: migrate_from_legacy_config] [B:check] (branches=2)
-> [66: _send_minimax] [B:check] (branches=11)
-> [67: send] [B:check] (branches=19)
-> [58: from_dict] [B:check] (branches=0)
-> [59: _send_minimax] [B:check] (branches=11)
-> [60: from_dict] [B:check] (branches=0)
-> [61: from_dict] [B:check] (branches=0)
-> [62: _repair_minimax_history] [B:check] (branches=10)
-> [63: _start_track_logic] [B:check] (branches=1)
-> [64: migrate_from_legacy_config] [B:check] (branches=2)
-> [65: _dashscope_call] [B:check] (branches=5)
-> [66: from_dict] [B:check] (branches=0)
-> [67: from_dict] [B:check] (branches=0)
-> [T:done]
```
@@ -393,8 +393,8 @@ _... 24 more fields_
- **Nil Sentinel `[N]`**: Introduce a module-level `NIL_<AGGREGATE>` sentinel whose field accesses return safe defaults. Replace None checks with the sentinel. Collapses 2^branch_count into ~1.
- Effective codepaths: 40140116231395706750391 -> 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 136 field-check branches to 1 cache lookup.
- Effective codepaths: 40140116231395706750391 -> 136
- **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 142 field-check branches to 1 cache lookup.
- Effective codepaths: 40140116231395706750391 -> 142
- **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: 40140116231395706750391 -> 67
@@ -421,13 +421,13 @@ _... 24 more fields_
## Type alias coverage
**Summary:** 136 sites; 0 typed (0%); 136 untyped (100%)
**Summary:** 142 sites; 0 typed (0%); 142 untyped (100%)
| metric | value |
|---|---|
| total field-access sites | 136 |
| total field-access sites | 142 |
| typed sites (canonical field) | 0 |
| untyped sites (wildcard) | 136 |
| untyped sites (wildcard) | 142 |
## Cross-audit findings
@@ -447,14 +447,16 @@ _(no cross-audit findings mapped to this aggregate)_
| field | access count | access pattern |
|---|---|---|
| `content` | 16 | hot |
| `marker` | 16 | hot |
| `content` | 15 | hot |
| `marker` | 15 | hot |
| `get` | 7 | hot |
| `append` | 3 | hot |
| `pop` | 2 | used |
| `files` | 2 | used |
| `encode` | 1 | used |
| `discussion` | 1 | used |
| `pop` | 3 | hot |
| `append` | 2 | used |
| `config` | 2 | used |
| `session_usage` | 2 | used |
| `to_dict` | 1 | used |
| `output` | 1 | used |
| `files` | 1 | used |
| `estimated_prompt_tokens` | 1 | used |
| `max_prompt_tokens` | 1 | used |
| `utilization_pct` | 1 | used |
@@ -463,18 +465,6 @@ _(no cross-audit findings mapped to this aggregate)_
| `sys_tokens` | 1 | used |
| `tool_tokens` | 1 | used |
| `history_tokens` | 1 | used |
| `local_ts` | 1 | used |
| `_offload_entry_payload` | 1 | used |
| `ui_auto_add_history` | 1 | used |
| `_pending_comms_lock` | 1 | used |
| `session_usage` | 1 | used |
| `_pending_history_adds_lock` | 1 | used |
| `_token_history` | 1 | used |
| `_pending_comms` | 1 | used |
| `_pending_history_adds` | 1 | used |
| `items` | 1 | used |
| `to_dict` | 1 | used |
| `output` | 1 | used |
| `ai_status` | 1 | used |
| `context_files` | 1 | used |
| `_pending_gui_tasks_lock` | 1 | used |
@@ -486,11 +476,30 @@ _(no cross-audit findings mapped to this aggregate)_
| `active_discussion` | 1 | used |
| `submit_io` | 1 | used |
| `tracks` | 1 | used |
| `config` | 1 | used |
| `mma_tier_usage` | 1 | used |
| `_pending_gui_tasks` | 1 | used |
| `mma_step_mode` | 1 | used |
| `active_project_path` | 1 | used |
| `search` | 1 | used |
| `_est_tokens` | 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 |
| `usage` | 1 | used |
| `local_ts` | 1 | used |
| `_offload_entry_payload` | 1 | used |
| `ui_auto_add_history` | 1 | used |
| `_pending_comms_lock` | 1 | used |
| `_pending_history_adds_lock` | 1 | used |
| `_token_history` | 1 | used |
| `_pending_comms` | 1 | used |
| `_pending_history_adds` | 1 | used |
| `encode` | 1 | used |
## Optimization candidates
@@ -506,63 +515,63 @@ ToolCall: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5,
| function | pattern | field_accesses | confidence |
|---|---|---|---|
| `src.ai_client._invalidate_token_estimate` | `whole_struct` | `pop`=1 | high |
| `src.ai_client._send_llama` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._strip_cache_controls` | `whole_struct` | | low |
| `src.ai_client._estimate_prompt_tokens` | `whole_struct` | | low |
| `src.aggregate.build_tier3_context` | `whole_struct` | | low |
| `src.project_manager.format_discussion` | `whole_struct` | | low |
| `src.ai_client._send_grok` | `whole_struct` | | low |
| `src.ai_client._create_gemini_cache_result` | `whole_struct` | | low |
| `src.ai_client._send_deepseek` | `whole_struct` | | low |
| `src.ai_client._send_gemini_cli` | `whole_struct` | | low |
| `src.aggregate._build_files_section_from_items` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.aggregate.build_markdown_from_items` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._create_gemini_cache_result` | `whole_struct` | | low |
| `src.ai_client._send_grok` | `whole_struct` | | low |
| `src.ai_client._strip_private_keys` | `whole_struct` | | low |
| `src.openai_compatible._to_dict_tool_call` | `whole_struct` | `to_dict`=1 | high |
| `src.ai_client._send_qwen` | `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.ai_client._send_gemini_cli` | `whole_struct` | | low |
| `src.ai_client._pre_dispatch` | `whole_struct` | | low |
| `src.models._save_config_to_disk` | `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.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.project_manager.save_project` | `mixed` | `discussion`=2, `files`=3 | high |
| `src.ai_client._trim_anthropic_history` | `whole_struct` | `pop`=5 | high |
| `src.ai_client._send_llama` | `whole_struct` | | low |
| `src.aggregate.build_tier3_context` | `whole_struct` | | low |
| `src.app_controller._offload_entry_payload` | `whole_struct` | | low |
| `src.project_manager.format_discussion` | `whole_struct` | | low |
| `src.project_manager.entry_to_str` | `whole_struct` | `get`=4 | high |
| `src.ai_client._repair_minimax_history` | `whole_struct` | `append`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._strip_stale_file_refreshes` | `whole_struct` | | low |
| `src.ai_client._send_deepseek` | `whole_struct` | | low |
| `src.aggregate.run` | `field_by_field` | `output`=1, `files`=2, `get`=7 | high |
| `src.ai_client._send_anthropic` | `whole_struct` | | low |
| `src.ai_client._invalidate_token_estimate` | `whole_struct` | `pop`=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.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.aggregate.build_markdown_no_history` | `whole_struct` | | low |
| `src.project_manager.flat_config` | `whole_struct` | `get`=7 | high |
| `src.ai_client._send_llama_native` | `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.project_manager.entry_to_str` | `whole_struct` | `get`=4 | high |
| `src.ai_client.ollama_chat` | `whole_struct` | | low |
| `src.ai_client._send_qwen` | `whole_struct` | | low |
| `src.ai_client._trim_anthropic_history` | `whole_struct` | `pop`=5 | high |
| `src.app_controller._offload_entry_payload` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client.send` | `mixed` | `config`=1, `search`=1 | high |
| `src.ai_client._estimate_message_tokens` | `mixed` | `_est_tokens`=1, `get`=2 | high |
| `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.app_controller._on_comms_entry` | `field_by_field` | `local_ts`=1, `_offload_entry_payload`=1, `get`=7, `ui_auto_add_history`=3, `_pending_comms_lock`=1, `session_usage`=5, `_pending_history_adds_lock`=4, `_token_history`=1, `_pending_comms`=1, `_pending_history_adds`=4 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._append_comms` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._repair_deepseek_history` | `whole_struct` | `append`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `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.openai_compatible._to_dict_tool_call` | `whole_struct` | `to_dict`=1 | high |
| `src.ai_client._repair_anthropic_history` | `whole_struct` | `append`=1 | high |
| `src.ai_client._strip_cache_controls` | `whole_struct` | | low |
| `src.aggregate.run` | `field_by_field` | `output`=1, `files`=2, `get`=7 | high |
| `src.models._save_config_to_disk` | `whole_struct` | | low |
| `src.ai_client._dashscope_call` | `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.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._add_history_cache_breakpoint` | `whole_struct` | | low |
| `src.ai_client._trim_minimax_history` | `whole_struct` | `pop`=4 | high |
| `src.ai_client._send_gemini` | `whole_struct` | `encode`=1 | high |
### Frequency evidence
| function | frequency | source | note |
|---|---|---|---|
| `src.ai_client._extract_dashscope_tool_calls` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.api_hook_client.get_warmup_wait` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py |
| `src.app_controller.wait` | `per_turn` | `static_analysis` | producer from src\app_controller.py |
| `src.ai_client._dashscope_call` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.app_controller._pending_mma_spawn` | `per_turn` | `static_analysis` | producer from src\app_controller.py |
| `src.app_controller._api_get_context` | `per_turn` | `static_analysis` | producer from src\app_controller.py |
| `src.ai_client.get_comms_log` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.api_hook_client.post_project` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py |
| `src.api_hook_client.get_node_status` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py |
| `src.models.to_dict` | `per_turn` | `static_analysis` | producer from src\models.py |
@@ -23,276 +23,276 @@
### `src\ai_client.py` (18 producers)
- `src.ai_client._extract_dashscope_tool_calls` (line 2754)
- `src.ai_client._dashscope_call` (line 2716)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client._build_deepseek_tools` (line 1148)
- `src.ai_client._parse_tool_args_result` (line 741)
- `src.ai_client._build_chunked_context_blocks` (line 1281)
- `src.ai_client._get_anthropic_tools` (line 664)
- `src.ai_client._get_deepseek_tools` (line 1194)
- `src.ai_client._pre_dispatch` (line 2089)
- `src.ai_client.get_gemini_cache_stats` (line 1604)
- `src.ai_client._load_credentials` (line 282)
- `src.ai_client.get_token_stats` (line 3185)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._build_anthropic_tools` (line 623)
- `src.ai_client.get_comms_log` (line 273)
- `src.ai_client._content_block_to_dict` (line 1200)
- `src.ai_client._parse_tool_args_result` (line 741)
- `src.ai_client._get_anthropic_tools` (line 664)
- `src.ai_client._dashscope_call` (line 2716)
- `src.ai_client._pre_dispatch` (line 2089)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._load_credentials` (line 282)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client.get_token_stats` (line 3185)
- `src.ai_client._add_bleed_derived` (line 3332)
- `src.ai_client._send_cli_round_result` (line 1746)
- `src.ai_client._extract_dashscope_tool_calls` (line 2754)
- `src.ai_client.get_gemini_cache_stats` (line 1604)
- `src.ai_client._get_deepseek_tools` (line 1194)
- `src.ai_client._build_deepseek_tools` (line 1148)
- `src.ai_client._content_block_to_dict` (line 1200)
- `src.ai_client._build_anthropic_tools` (line 623)
- `src.ai_client._build_chunked_context_blocks` (line 1281)
### `src\api_hook_client.py` (39 producers)
- `src.api_hook_client.get_warmup_wait` (line 332)
- `src.api_hook_client.wait_for_event` (line 136)
- `src.api_hook_client.clear_events` (line 129)
- `src.api_hook_client.get_warmup_status` (line 325)
- `src.api_hook_client.get_project` (line 367)
- `src.api_hook_client.get_mma_workers` (line 546)
- `src.api_hook_client.reject_patch` (line 288)
- `src.api_hook_client.get_gui_state` (line 165)
- `src.api_hook_client.get_events` (line 124)
- `src.api_hook_client.post_project` (line 473)
- `src.api_hook_client.get_session` (line 502)
- `src.api_hook_client.get_io_pool_status` (line 420)
- `src.api_hook_client.trigger_patch` (line 274)
- `src.api_hook_client.get_node_status` (line 532)
- `src.api_hook_client.click` (line 223)
- `src.api_hook_client.get_startup_timeline` (line 353)
- `src.api_hook_client.select_tab` (line 263)
- `src.api_hook_client.reject_patch` (line 288)
- `src.api_hook_client.clear_events` (line 129)
- `src.api_hook_client.post_gui` (line 149)
- `src.api_hook_client.get_warmup_status` (line 325)
- `src.api_hook_client.select_list_item` (line 256)
- `src.api_hook_client.get_gui_health` (line 434)
- `src.api_hook_client.wait_for_event` (line 136)
- `src.api_hook_client.post_project` (line 470)
- `src.api_hook_client.apply_patch` (line 281)
- `src.api_hook_client.get_project_switch_status` (line 374)
- `src.api_hook_client.get_io_pool_status` (line 420)
- `src.api_hook_client.get_financial_metrics` (line 520)
- `src.api_hook_client.drag` (line 230)
- `src.api_hook_client.get_warmup_canaries` (line 342)
- `src.api_hook_client.get_gui_diagnostics` (line 311)
- `src.api_hook_client.trigger_patch` (line 274)
- `src.api_hook_client.get_project` (line 367)
- `src.api_hook_client.get_events` (line 124)
- `src.api_hook_client.get_warmup_wait` (line 332)
- `src.api_hook_client.set_value` (line 212)
- `src.api_hook_client.get_mma_status` (line 539)
- `src.api_hook_client.post_session` (line 117)
- `src.api_hook_client.wait_for_project_switch` (line 389)
- `src.api_hook_client.get_performance` (line 318)
- `src.api_hook_client.get_system_telemetry` (line 524)
- `src.api_hook_client.push_event` (line 156)
- `src.api_hook_client.get_gui_state` (line 165)
- `src.api_hook_client._make_request` (line 65)
- `src.api_hook_client.get_status` (line 105)
- `src.api_hook_client.get_context_state` (line 491)
- `src.api_hook_client.set_value` (line 212)
- `src.api_hook_client.post_gui` (line 149)
- `src.api_hook_client.get_gui_diagnostics` (line 311)
- `src.api_hook_client.get_mma_status` (line 539)
- `src.api_hook_client.get_startup_timeline` (line 353)
- `src.api_hook_client.get_node_status` (line 532)
- `src.api_hook_client.get_performance` (line 318)
- `src.api_hook_client.post_session` (line 117)
- `src.api_hook_client.push_event` (line 156)
- `src.api_hook_client.get_warmup_canaries` (line 342)
- `src.api_hook_client.drag` (line 230)
- `src.api_hook_client.apply_patch` (line 281)
- `src.api_hook_client.post_project` (line 470)
- `src.api_hook_client.get_patch_status` (line 295)
- `src.api_hook_client.wait_for_project_switch` (line 389)
- `src.api_hook_client.click` (line 223)
- `src.api_hook_client.select_list_item` (line 256)
- `src.api_hook_client.get_project_switch_status` (line 374)
- `src.api_hook_client.get_system_telemetry` (line 524)
- `src.api_hook_client._make_request` (line 65)
- `src.api_hook_client.select_tab` (line 263)
- `src.api_hook_client.get_session` (line 502)
- `src.api_hook_client.get_mma_workers` (line 546)
- `src.api_hook_client.right_click` (line 237)
- `src.api_hook_client.get_financial_metrics` (line 520)
- `src.api_hook_client.get_patch_status` (line 295)
### `src\app_controller.py` (30 producers)
- `src.app_controller.wait` (line 5205)
- `src.app_controller._pending_mma_spawn` (line 2772)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller._api_get_diagnostics` (line 202)
- `src.app_controller.get_gui_state` (line 2829)
- `src.app_controller.load_config` (line 5142)
- `src.app_controller._api_get_session` (line 374)
- `src.app_controller._api_pending_actions` (line 335)
- `src.app_controller.get_context` (line 2892)
- `src.app_controller.token_stats` (line 2898)
- `src.app_controller._api_get_api_project` (line 188)
- `src.app_controller._api_get_context` (line 398)
- `src.app_controller._api_token_stats` (line 417)
- `src.app_controller.get_mma_status` (line 2835)
- `src.app_controller._api_get_performance` (line 195)
- `src.app_controller._api_get_api_session` (line 170)
- `src.app_controller._api_get_gui_state` (line 123)
- `src.app_controller.get_performance` (line 2856)
- `src.app_controller.pending_actions` (line 2874)
- `src.app_controller.status` (line 2865)
- `src.app_controller._api_get_mma_status` (line 144)
- `src.app_controller.generate` (line 2868)
- `src.app_controller.get_api_project` (line 2853)
- `src.app_controller._api_status` (line 209)
- `src.app_controller._api_generate` (line 221)
- `src.app_controller.get_session` (line 2883)
- `src.app_controller.get_diagnostics` (line 2862)
- `src.app_controller.get_session_insights` (line 3049)
- `src.app_controller._pending_mma_approval` (line 2776)
- `src.app_controller.get_api_session` (line 2847)
- `src.app_controller._api_get_gui_state` (line 123)
- `src.app_controller.get_api_project` (line 2853)
- `src.app_controller._api_get_performance` (line 195)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller.get_gui_state` (line 2829)
- `src.app_controller.get_performance` (line 2856)
- `src.app_controller._api_status` (line 209)
- `src.app_controller._api_get_mma_status` (line 144)
- `src.app_controller.get_mma_status` (line 2835)
- `src.app_controller._pending_mma_spawn` (line 2772)
- `src.app_controller.get_diagnostics` (line 2862)
- `src.app_controller._api_pending_actions` (line 335)
- `src.app_controller._api_token_stats` (line 417)
- `src.app_controller.wait` (line 5205)
- `src.app_controller.pending_actions` (line 2874)
- `src.app_controller.load_config` (line 5142)
- `src.app_controller._pending_mma_approval` (line 2776)
- `src.app_controller._api_get_diagnostics` (line 202)
- `src.app_controller.get_context` (line 2892)
- `src.app_controller.get_session` (line 2883)
- `src.app_controller._api_get_api_project` (line 188)
- `src.app_controller.get_session_insights` (line 3049)
- `src.app_controller._api_get_session` (line 374)
- `src.app_controller.token_stats` (line 2898)
- `src.app_controller._api_generate` (line 221)
- `src.app_controller.status` (line 2865)
- `src.app_controller.generate` (line 2868)
### `src\models.py` (23 producers)
- `src.models.to_dict` (line 646)
- `src.models.to_dict` (line 406)
- `src.models.to_dict` (line 855)
- `src.models.to_dict` (line 938)
- `src.models.to_dict` (line 1059)
- `src.models.parse_history_entries` (line 214)
- `src.models.to_dict` (line 288)
- `src.models.to_dict` (line 794)
- `src.models.to_dict` (line 1000)
- `src.models.to_dict` (line 672)
- `src.models.to_dict` (line 355)
- `src.models.to_dict` (line 486)
- `src.models.to_dict` (line 913)
- `src.models.to_dict` (line 596)
- `src.models.to_dict` (line 886)
- `src.models.to_dict` (line 701)
- `src.models.to_dict` (line 558)
- `src.models._load_config_from_disk` (line 186)
- `src.models.to_dict` (line 441)
- `src.models.to_dict` (line 1024)
- `src.models.to_dict` (line 971)
- `src.models.to_dict` (line 288)
- `src.models.to_dict` (line 737)
- `src.models.to_dict` (line 486)
- `src.models.to_dict` (line 618)
- `src.models.to_dict` (line 701)
- `src.models.to_dict` (line 886)
- `src.models.to_dict` (line 971)
- `src.models._load_config_from_disk` (line 186)
- `src.models.to_dict` (line 406)
- `src.models.to_dict` (line 646)
- `src.models.to_dict` (line 672)
- `src.models.to_dict` (line 355)
- `src.models.to_dict` (line 1059)
- `src.models.to_dict` (line 855)
- `src.models.to_dict` (line 1000)
- `src.models.parse_history_entries` (line 214)
- `src.models.to_dict` (line 938)
### `src\project_manager.py` (8 producers)
- `src.project_manager.get_all_tracks` (line 342)
- `src.project_manager.load_history` (line 209)
- `src.project_manager.str_to_entry` (line 75)
- `src.project_manager.load_project` (line 186)
- `src.project_manager.default_discussion` (line 117)
- `src.project_manager.default_project` (line 123)
- `src.project_manager.migrate_from_legacy_config` (line 253)
- `src.project_manager.flat_config` (line 267)
- `src.project_manager.load_project` (line 186)
- `src.project_manager.default_discussion` (line 117)
- `src.project_manager.get_all_tracks` (line 342)
## Consumers (66)
### `src\aggregate.py` (5 consumers)
- `src.aggregate.build_markdown_from_items` (line 348)
- `src.aggregate.build_tier3_context` (line 382)
- `src.aggregate.build_markdown_no_history` (line 366)
- `src.aggregate.run` (line 479)
- `src.aggregate._build_files_section_from_items` (line 300)
- `src.aggregate.build_markdown_from_items` (line 348)
- `src.aggregate.run` (line 479)
- `src.aggregate.build_markdown_no_history` (line 366)
### `src\ai_client.py` (29 consumers)
- `src.ai_client._invalidate_token_estimate` (line 1240)
- `src.ai_client._create_gemini_cache_result` (line 1706)
- `src.ai_client._send_grok` (line 2530)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client._send_gemini_cli` (line 2019)
- `src.ai_client._send_gemini` (line 1802)
- `src.ai_client._send_anthropic` (line 1405)
- `src.ai_client._trim_anthropic_history` (line 1353)
- `src.ai_client._send_llama` (line 2858)
- `src.ai_client._repair_minimax_history` (line 2462)
- `src.ai_client._strip_stale_file_refreshes` (line 1253)
- `src.ai_client._send_deepseek` (line 2165)
- `src.ai_client._add_bleed_derived` (line 3332)
- `src.ai_client._send_llama_native` (line 2958)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._send_qwen` (line 2773)
- `src.ai_client._repair_deepseek_history` (line 2138)
- `src.ai_client._execute_single_tool_call_async` (line 945)
- `src.ai_client._repair_anthropic_history` (line 1381)
- `src.ai_client._strip_cache_controls` (line 1291)
- `src.ai_client._dashscope_call` (line 2716)
- `src.ai_client._estimate_prompt_tokens` (line 1243)
- `src.ai_client._append_comms` (line 257)
- `src.ai_client._estimate_message_tokens` (line 1218)
- `src.ai_client._add_history_cache_breakpoint` (line 1299)
- `src.ai_client._send_grok` (line 2530)
- `src.ai_client._create_gemini_cache_result` (line 1706)
- `src.ai_client._send_deepseek` (line 2165)
- `src.ai_client._send_gemini_cli` (line 2019)
- `src.ai_client._send_qwen` (line 2773)
- `src.ai_client._repair_anthropic_history` (line 1381)
- `src.ai_client._pre_dispatch` (line 2089)
- `src.ai_client._trim_minimax_history` (line 2482)
- `src.ai_client._send_minimax` (line 2616)
- `src.ai_client._strip_stale_file_refreshes` (line 1253)
- `src.ai_client._send_anthropic` (line 1405)
- `src.ai_client._invalidate_token_estimate` (line 1240)
- `src.ai_client._add_bleed_derived` (line 3332)
- `src.ai_client.ollama_chat` (line 2938)
- `src.ai_client._trim_anthropic_history` (line 1353)
- `src.ai_client.send` (line 3208)
- `src.ai_client._estimate_message_tokens` (line 1218)
- `src.ai_client._append_comms` (line 257)
- `src.ai_client._repair_deepseek_history` (line 2138)
- `src.ai_client._add_history_cache_breakpoint` (line 1299)
- `src.ai_client._trim_minimax_history` (line 2482)
- `src.ai_client._send_gemini` (line 1802)
- `src.ai_client._execute_single_tool_call_async` (line 945)
- `src.ai_client._send_llama_native` (line 2958)
- `src.ai_client._strip_private_keys` (line 1464)
- `src.ai_client._send_minimax` (line 2616)
- `src.ai_client._repair_minimax_history` (line 2462)
- `src.ai_client._dashscope_call` (line 2716)
### `src\app_controller.py` (5 consumers)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller._on_comms_entry` (line 4282)
- `src.app_controller._start_track_logic_result` (line 4728)
- `src.app_controller._offload_entry_payload` (line 4240)
- `src.app_controller._refresh_api_metrics` (line 3074)
- `src.app_controller._on_comms_entry` (line 4282)
- `src.app_controller._start_track_logic` (line 4721)
### `src\models.py` (22 consumers)
- `src.models.from_dict` (line 920)
- `src.models.from_dict` (line 603)
- `src.models.from_dict` (line 506)
- `src.models.from_dict` (line 814)
- `src.models.from_dict` (line 893)
- `src.models.from_dict` (line 378)
- `src.models.from_dict` (line 1038)
- `src.models.from_dict` (line 1007)
- `src.models.from_dict` (line 747)
- `src.models.from_dict` (line 683)
- `src.models.from_dict` (line 712)
- `src.models.from_dict` (line 866)
- `src.models.from_dict` (line 454)
- `src.models.from_dict` (line 575)
- `src.models.from_dict` (line 630)
- `src.models.from_dict` (line 712)
- `src.models.from_dict` (line 747)
- `src.models._save_config_to_disk` (line 199)
- `src.models.from_dict` (line 575)
- `src.models.from_dict` (line 683)
- `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 295)
- `src.models.from_dict` (line 416)
- `src.models.from_dict` (line 656)
- `src.models.from_dict` (line 1072)
- `src.models.from_dict` (line 295)
- `src.models.from_dict` (line 656)
- `src.models.from_dict` (line 416)
- `src.models.from_dict` (line 603)
- `src.models.from_dict` (line 920)
- `src.models.from_dict` (line 814)
- `src.models.from_dict` (line 506)
- `src.models.from_dict` (line 893)
- `src.models.from_dict` (line 378)
### `src\project_manager.py` (5 consumers)
- `src.project_manager.save_project` (line 229)
- `src.project_manager.format_discussion` (line 69)
- `src.project_manager.entry_to_str` (line 49)
- `src.project_manager.flat_config` (line 267)
- `src.project_manager.save_project` (line 229)
- `src.project_manager.migrate_from_legacy_config` (line 253)
## Field access matrix
| consumer | _offload_entry_payload | _pending_comms | _pending_comms_lock | _pending_gui_tasks | _pending_gui_tasks_lock | _pending_history_adds | _pending_history_adds_lock | _token_history | _topological_sort_tickets_result | active_discussion | active_project_path | active_project_root | ai_status | append | config | content | context_files | discussion | encode | engines |
| consumer | _est_tokens | _gemini_cache_text | _offload_entry_payload | _pending_comms | _pending_comms_lock | _pending_gui_tasks | _pending_gui_tasks_lock | _pending_history_adds | _pending_history_adds_lock | _recalculate_session_usage | _token_history | _token_stats | _topological_sort_tickets_result | _update_cached_stats | active_discussion | active_project_path | active_project_root | ai_status | append | config |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| `_invalidate_token_estimate` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `build_markdown_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_create_gemini_cache_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_grok` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_strip_private_keys` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_send_gemini_cli` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_send_gemini` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_send_anthropic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `save_project` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 2 | . | . |
| `_trim_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_llama` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `build_tier3_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_offload_entry_payload` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `entry_to_str` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_strip_stale_file_refreshes` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_deepseek` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_add_bleed_derived` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `build_markdown_no_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `flat_config` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_llama_native` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `ollama_chat` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_qwen` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_on_comms_entry` | 1 | 1 | 1 | . | . | 4 | 4 | 1 | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_repair_deepseek_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_execute_single_tool_call_async` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_repair_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_strip_cache_controls` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `run` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_save_config_to_disk` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_dashscope_call` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_start_track_logic_result` | . | . | . | 2 | 2 | . | . | . | 1 | 1 | 1 | 1 | 4 | . | 1 | . | 1 | . | . | 1 |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | . | . |
| `_estimate_prompt_tokens` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `build_tier3_context` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `format_discussion` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_grok` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_create_gemini_cache_result` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_deepseek` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_gemini_cli` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_build_files_section_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `build_markdown_from_items` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_qwen` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_pre_dispatch` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_save_config_to_disk` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_strip_stale_file_refreshes` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `run` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_anthropic` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_invalidate_token_estimate` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_add_bleed_derived` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_start_track_logic_result` | . | . | . | . | . | 2 | 2 | . | . | . | . | . | 1 | . | 1 | 1 | 1 | 4 | . | 1 |
| `entry_to_str` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `ollama_chat` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_trim_anthropic_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_offload_entry_payload` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `send` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 |
| `_estimate_message_tokens` | 1 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_refresh_api_metrics` | . | 1 | . | . | . | . | . | . | . | 1 | . | 1 | . | 1 | . | . | . | . | . | . |
| `_on_comms_entry` | . | . | 1 | 1 | 1 | . | . | 4 | 4 | . | 1 | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_append_comms` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_repair_deepseek_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 1 | . |
| `from_dict` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_add_history_cache_breakpoint` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_trim_minimax_history` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_send_gemini` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `flat_config` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
_... 23 more fields_
_... 32 more fields_
## Access pattern
@@ -302,79 +302,79 @@ _... 23 more fields_
**Per-function pattern distribution:**
- `whole_struct`: 28 functions (56%)
- `mixed`: 18 functions (36%)
- `field_by_field`: 4 functions (8%)
- `mixed`: 17 functions (34%)
- `field_by_field`: 5 functions (10%)
## SSDL Sketch for `ToolDefinition`
```
[Q:ToolDefinition entry-point] -> [Q:PCG lookup]
-> [1: _invalidate_token_estimate] [B:check] (branches=0)
-> [1: _send_llama] [B:check] (branches=13)
-> [2: from_dict] [B:check] (branches=0)
-> [3: build_markdown_from_items] [B:check] (branches=9)
-> [4: from_dict] [B:check] (branches=0)
-> [5: _create_gemini_cache_result] [B:check] (branches=3)
-> [6: _send_grok] [B:check] (branches=14)
-> [7: _strip_private_keys] [B:check] (branches=0)
-> [8: from_dict] [B:check] (branches=0)
-> [9: _send_gemini_cli] [B:is None?] (branches=23) [N:safe]
-> [10: from_dict] [B:check] (branches=0)
-> [11: from_dict] [B:check] (branches=0)
-> [12: _send_gemini] [B:is None?] (branches=75) [N:safe]
-> [3: _strip_cache_controls] [B:check] (branches=4)
-> [4: _estimate_prompt_tokens] [B:check] (branches=2)
-> [5: build_tier3_context] [B:check] (branches=50)
-> [6: format_discussion] [B:check] (branches=0)
-> [7: _send_grok] [B:check] (branches=14)
-> [8: _create_gemini_cache_result] [B:check] (branches=3)
-> [9: _send_deepseek] [B:check] (branches=71)
-> [10: _send_gemini_cli] [B:is None?] (branches=23) [N:safe]
-> [11: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe]
-> [12: from_dict] [B:check] (branches=0)
-> [13: from_dict] [B:check] (branches=0)
-> [14: from_dict] [B:check] (branches=0)
-> [15: _send_anthropic] [B:is None?] (branches=40) [N:safe]
-> [16: save_project] [B:is None?] (branches=7) [N:safe]
-> [17: _trim_anthropic_history] [B:check] (branches=13)
-> [18: _send_llama] [B:check] (branches=13)
-> [19: build_tier3_context] [B:check] (branches=50)
-> [20: _offload_entry_payload] [B:check] (branches=10)
-> [21: format_discussion] [B:check] (branches=0)
-> [22: entry_to_str] [B:check] (branches=3)
-> [23: _repair_minimax_history] [B:check] (branches=10)
-> [14: build_markdown_from_items] [B:check] (branches=9)
-> [15: from_dict] [B:check] (branches=0)
-> [16: _send_qwen] [B:check] (branches=9)
-> [17: _repair_anthropic_history] [B:check] (branches=6)
-> [18: from_dict] [B:check] (branches=0)
-> [19: _pre_dispatch] [B:check] (branches=8)
-> [20: _save_config_to_disk] [B:check] (branches=1)
-> [21: from_dict] [B:check] (branches=0)
-> [22: from_dict] [B:check] (branches=0)
-> [23: from_dict] [B:check] (branches=0)
-> [24: from_dict] [B:check] (branches=0)
-> [25: from_dict] [B:check] (branches=0)
-> [26: _strip_stale_file_refreshes] [B:check] (branches=12)
-> [27: _send_deepseek] [B:check] (branches=71)
-> [28: _add_bleed_derived] [B:check] (branches=0)
-> [29: from_dict] [B:check] (branches=0)
-> [30: build_markdown_no_history] [B:check] (branches=0)
-> [31: flat_config] [B:check] (branches=2)
-> [32: _send_llama_native] [B:check] (branches=12)
-> [33: ollama_chat] [B:check] (branches=3)
-> [34: _send_qwen] [B:check] (branches=9)
-> [35: _on_comms_entry] [B:check] (branches=32)
-> [25: _strip_stale_file_refreshes] [B:check] (branches=12)
-> [26: run] [B:check] (branches=1)
-> [27: _send_anthropic] [B:is None?] (branches=40) [N:safe]
-> [28: _invalidate_token_estimate] [B:check] (branches=0)
-> [29: _add_bleed_derived] [B:check] (branches=0)
-> [30: _start_track_logic_result] [B:check] (branches=10)
-> [31: entry_to_str] [B:check] (branches=3)
-> [32: ollama_chat] [B:check] (branches=3)
-> [33: _trim_anthropic_history] [B:check] (branches=13)
-> [34: _offload_entry_payload] [B:check] (branches=10)
-> [35: from_dict] [B:check] (branches=0)
-> [36: from_dict] [B:check] (branches=0)
-> [37: from_dict] [B:check] (branches=0)
-> [38: _repair_deepseek_history] [B:check] (branches=6)
-> [39: from_dict] [B:check] (branches=0)
-> [40: from_dict] [B:check] (branches=0)
-> [41: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe]
-> [38: send] [B:check] (branches=19)
-> [39: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe]
-> [40: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe]
-> [41: _on_comms_entry] [B:check] (branches=32)
-> [42: from_dict] [B:check] (branches=0)
-> [43: _repair_anthropic_history] [B:check] (branches=6)
-> [44: _strip_cache_controls] [B:check] (branches=4)
-> [45: run] [B:check] (branches=1)
-> [46: _save_config_to_disk] [B:check] (branches=1)
-> [47: _dashscope_call] [B:check] (branches=5)
-> [48: _start_track_logic_result] [B:check] (branches=10)
-> [49: from_dict] [B:check] (branches=0)
-> [50: _estimate_prompt_tokens] [B:check] (branches=2)
-> [51: _append_comms] [B:is None?] (branches=1) [N:safe]
-> [52: from_dict] [B:check] (branches=0)
-> [53: _estimate_message_tokens] [B:is None?] (branches=9) [N:safe]
-> [54: _add_history_cache_breakpoint] [B:check] (branches=5)
-> [55: _pre_dispatch] [B:check] (branches=8)
-> [43: _append_comms] [B:is None?] (branches=1) [N:safe]
-> [44: from_dict] [B:check] (branches=0)
-> [45: _repair_deepseek_history] [B:check] (branches=6)
-> [46: from_dict] [B:check] (branches=0)
-> [47: _add_history_cache_breakpoint] [B:check] (branches=5)
-> [48: _trim_minimax_history] [B:check] (branches=8)
-> [49: _send_gemini] [B:is None?] (branches=75) [N:safe]
-> [50: flat_config] [B:check] (branches=2)
-> [51: save_project] [B:is None?] (branches=7) [N:safe]
-> [52: build_markdown_no_history] [B:check] (branches=0)
-> [53: _execute_single_tool_call_async] [B:is None?] (branches=15) [N:safe]
-> [54: _send_llama_native] [B:check] (branches=12)
-> [55: _strip_private_keys] [B:check] (branches=0)
-> [56: from_dict] [B:check] (branches=0)
-> [57: _build_files_section_from_items] [B:is None?] (branches=5) [N:safe]
-> [58: _trim_minimax_history] [B:check] (branches=8)
-> [59: _refresh_api_metrics] [B:is None?] (branches=11) [N:safe]
-> [60: _start_track_logic] [B:check] (branches=1)
-> [61: from_dict] [B:check] (branches=0)
-> [62: from_dict] [B:check] (branches=0)
-> [63: from_dict] [B:check] (branches=0)
-> [64: migrate_from_legacy_config] [B:check] (branches=2)
-> [65: _send_minimax] [B:check] (branches=11)
-> [66: send] [B:check] (branches=19)
-> [57: from_dict] [B:check] (branches=0)
-> [58: _send_minimax] [B:check] (branches=11)
-> [59: from_dict] [B:check] (branches=0)
-> [60: from_dict] [B:check] (branches=0)
-> [61: _repair_minimax_history] [B:check] (branches=10)
-> [62: _start_track_logic] [B:check] (branches=1)
-> [63: migrate_from_legacy_config] [B:check] (branches=2)
-> [64: _dashscope_call] [B:check] (branches=5)
-> [65: from_dict] [B:check] (branches=0)
-> [66: from_dict] [B:check] (branches=0)
-> [T:done]
```
@@ -386,8 +386,8 @@ _... 23 more fields_
- **Nil Sentinel `[N]`**: Introduce a module-level `NIL_<AGGREGATE>` 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 135 field-check branches to 1 cache lookup.
- Effective codepaths: 40140116231395706750390 -> 135
- **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 148 field-check branches to 1 cache lookup.
- Effective codepaths: 40140116231395706750390 -> 148
- **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
@@ -414,13 +414,13 @@ _... 23 more fields_
## Type alias coverage
**Summary:** 135 sites; 0 typed (0%); 135 untyped (100%)
**Summary:** 148 sites; 0 typed (0%); 148 untyped (100%)
| metric | value |
|---|---|
| total field-access sites | 135 |
| total field-access sites | 148 |
| typed sites (canonical field) | 0 |
| untyped sites (wildcard) | 135 |
| untyped sites (wildcard) | 148 |
## Cross-audit findings
@@ -442,14 +442,15 @@ _... 23 more fields_
| field | access count | access pattern |
|---|---|---|
| `content` | 16 | hot |
| `marker` | 16 | hot |
| `get` | 7 | hot |
| `append` | 3 | hot |
| `pop` | 2 | used |
| `files` | 2 | used |
| `encode` | 1 | used |
| `discussion` | 1 | used |
| `content` | 15 | hot |
| `marker` | 15 | hot |
| `get` | 8 | hot |
| `pop` | 3 | hot |
| `append` | 2 | used |
| `config` | 2 | used |
| `session_usage` | 2 | used |
| `output` | 1 | used |
| `files` | 1 | used |
| `estimated_prompt_tokens` | 1 | used |
| `max_prompt_tokens` | 1 | used |
| `utilization_pct` | 1 | used |
@@ -458,17 +459,6 @@ _... 23 more fields_
| `sys_tokens` | 1 | used |
| `tool_tokens` | 1 | used |
| `history_tokens` | 1 | used |
| `local_ts` | 1 | used |
| `_offload_entry_payload` | 1 | used |
| `ui_auto_add_history` | 1 | used |
| `_pending_comms_lock` | 1 | used |
| `session_usage` | 1 | used |
| `_pending_history_adds_lock` | 1 | used |
| `_token_history` | 1 | used |
| `_pending_comms` | 1 | used |
| `_pending_history_adds` | 1 | used |
| `items` | 1 | used |
| `output` | 1 | used |
| `ai_status` | 1 | used |
| `context_files` | 1 | used |
| `_pending_gui_tasks_lock` | 1 | used |
@@ -480,11 +470,30 @@ _... 23 more fields_
| `active_discussion` | 1 | used |
| `submit_io` | 1 | used |
| `tracks` | 1 | used |
| `config` | 1 | used |
| `mma_tier_usage` | 1 | used |
| `_pending_gui_tasks` | 1 | used |
| `mma_step_mode` | 1 | used |
| `active_project_path` | 1 | used |
| `search` | 1 | used |
| `_est_tokens` | 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 |
| `usage` | 1 | used |
| `local_ts` | 1 | used |
| `_offload_entry_payload` | 1 | used |
| `ui_auto_add_history` | 1 | used |
| `_pending_comms_lock` | 1 | used |
| `_pending_history_adds_lock` | 1 | used |
| `_token_history` | 1 | used |
| `_pending_comms` | 1 | used |
| `_pending_history_adds` | 1 | used |
| `encode` | 1 | used |
## Optimization candidates
@@ -500,63 +509,63 @@ ToolDefinition: access_pattern=whole_struct, frequency=per_turn, struct_field_co
| function | pattern | field_accesses | confidence |
|---|---|---|---|
| `src.ai_client._invalidate_token_estimate` | `whole_struct` | `pop`=1 | high |
| `src.ai_client._send_llama` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._strip_cache_controls` | `whole_struct` | | low |
| `src.ai_client._estimate_prompt_tokens` | `whole_struct` | | low |
| `src.aggregate.build_tier3_context` | `whole_struct` | | low |
| `src.project_manager.format_discussion` | `whole_struct` | | low |
| `src.ai_client._send_grok` | `whole_struct` | | low |
| `src.ai_client._create_gemini_cache_result` | `whole_struct` | | low |
| `src.ai_client._send_deepseek` | `whole_struct` | | low |
| `src.ai_client._send_gemini_cli` | `whole_struct` | | low |
| `src.aggregate._build_files_section_from_items` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.aggregate.build_markdown_from_items` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._create_gemini_cache_result` | `whole_struct` | | low |
| `src.ai_client._send_grok` | `whole_struct` | | low |
| `src.ai_client._strip_private_keys` | `whole_struct` | | low |
| `src.ai_client._send_qwen` | `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.ai_client._send_gemini_cli` | `whole_struct` | | low |
| `src.ai_client._pre_dispatch` | `whole_struct` | | low |
| `src.models._save_config_to_disk` | `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.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.project_manager.save_project` | `mixed` | `discussion`=2, `files`=3 | high |
| `src.ai_client._trim_anthropic_history` | `whole_struct` | `pop`=5 | high |
| `src.ai_client._send_llama` | `whole_struct` | | low |
| `src.aggregate.build_tier3_context` | `whole_struct` | | low |
| `src.app_controller._offload_entry_payload` | `whole_struct` | | low |
| `src.project_manager.format_discussion` | `whole_struct` | | low |
| `src.project_manager.entry_to_str` | `whole_struct` | `get`=4 | high |
| `src.ai_client._repair_minimax_history` | `whole_struct` | `append`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._strip_stale_file_refreshes` | `whole_struct` | | low |
| `src.ai_client._send_deepseek` | `whole_struct` | | low |
| `src.aggregate.run` | `field_by_field` | `output`=1, `files`=2, `get`=7 | high |
| `src.ai_client._send_anthropic` | `whole_struct` | | low |
| `src.ai_client._invalidate_token_estimate` | `whole_struct` | `pop`=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.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.aggregate.build_markdown_no_history` | `whole_struct` | | low |
| `src.project_manager.flat_config` | `whole_struct` | `get`=7 | high |
| `src.ai_client._send_llama_native` | `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.project_manager.entry_to_str` | `whole_struct` | `get`=4 | high |
| `src.ai_client.ollama_chat` | `whole_struct` | | low |
| `src.ai_client._send_qwen` | `whole_struct` | | low |
| `src.ai_client._trim_anthropic_history` | `whole_struct` | `pop`=5 | high |
| `src.app_controller._offload_entry_payload` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client.send` | `mixed` | `config`=1, `search`=1 | high |
| `src.ai_client._estimate_message_tokens` | `mixed` | `_est_tokens`=1, `get`=2 | high |
| `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.app_controller._on_comms_entry` | `field_by_field` | `local_ts`=1, `_offload_entry_payload`=1, `get`=7, `ui_auto_add_history`=3, `_pending_comms_lock`=1, `session_usage`=5, `_pending_history_adds_lock`=4, `_token_history`=1, `_pending_comms`=1, `_pending_history_adds`=4 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._append_comms` | `whole_struct` | | low |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._repair_deepseek_history` | `whole_struct` | `append`=1 | high |
| `src.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `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_anthropic_history` | `whole_struct` | `append`=1 | high |
| `src.ai_client._strip_cache_controls` | `whole_struct` | | low |
| `src.aggregate.run` | `field_by_field` | `output`=1, `files`=2, `get`=7 | high |
| `src.models._save_config_to_disk` | `whole_struct` | | low |
| `src.ai_client._dashscope_call` | `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.models.from_dict` | `mixed` | `content`=1, `marker`=1 | high |
| `src.ai_client._estimate_prompt_tokens` | `whole_struct` | | low |
| `src.ai_client._add_history_cache_breakpoint` | `whole_struct` | | low |
| `src.ai_client._trim_minimax_history` | `whole_struct` | `pop`=4 | high |
| `src.ai_client._send_gemini` | `whole_struct` | `encode`=1 | high |
| `src.project_manager.flat_config` | `whole_struct` | `get`=7 | high |
### Frequency evidence
| function | frequency | source | note |
|---|---|---|---|
| `src.ai_client._extract_dashscope_tool_calls` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.api_hook_client.get_warmup_wait` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py |
| `src.app_controller.wait` | `per_turn` | `static_analysis` | producer from src\app_controller.py |
| `src.ai_client._dashscope_call` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.app_controller._pending_mma_spawn` | `per_turn` | `static_analysis` | producer from src\app_controller.py |
| `src.app_controller._api_get_context` | `per_turn` | `static_analysis` | producer from src\app_controller.py |
| `src.ai_client.get_comms_log` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.api_hook_client.post_project` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py |
| `src.api_hook_client.get_node_status` | `per_turn` | `static_analysis` | producer from src\api_hook_client.py |
| `src.models.to_dict` | `per_turn` | `static_analysis` | producer from src\models.py |
@@ -1,97 +1,21 @@
# Code Path & Data Pipeline Audit Summary
# Code Path Audit - TOC
Generated for 13 aggregates on 2026-06-22
- **Real aggregates (in scope):** 10
- **Candidate aggregates (placeholders):** 3
- **Total producers:** 1091
- **Total consumers:** 1106
- **Total current cost (us/turn):** 4750
- **Total actionable savings (us/turn):** 560
**Read [AUDIT_REPORT.md](AUDIT_REPORT.md) for the full audit.**
## 4-mem-dim rollup
## Per-aggregate profiles
- **control** (3): ToolDefinition, ToolCall, Result
- **curation** (2): FileItem, FileItems
- **discussion** (6): Metadata, CommsLogEntry, CommsLog, HistoryMessage, History, ChatMessage
- **unknown** (2): ToolSpec, ProviderHistory
## Per-aggregate memory_dim + access pattern
| Aggregate | Kind | Memory dim | Access pattern | Producers | Consumers |
|---|---|---|---|---|---|
| `CommsLog` | `typealias` | `discussion` | `whole_struct` | 6 | 5 |
| `CommsLogEntry` | `typealias` | `discussion` | `whole_struct` | 117 | 66 |
| `FileItem` | `typealias` | `curation` | `whole_struct` | 117 | 66 |
| `FileItems` | `typealias` | `curation` | `whole_struct` | 6 | 9 |
| `History` | `typealias` | `discussion` | `whole_struct` | 7 | 7 |
| `HistoryMessage` | `typealias` | `discussion` | `whole_struct` | 118 | 68 |
| `Metadata` | `typealias` | `discussion` | `whole_struct` | 483 | 752 |
| `Result` | `typealias` | `control` | `mixed` | 0 | 0 |
| `ToolCall` | `typealias` | `control` | `whole_struct` | 118 | 67 |
| `ToolDefinition` | `typealias` | `control` | `whole_struct` | 119 | 66 |
| `ChatMessage` | `candidate_dataclass` | `discussion` | `mixed` | 0 | 0 |
| `ProviderHistory` | `candidate_dataclass` | `unknown` | `mixed` | 0 | 0 |
| `ToolSpec` | `candidate_dataclass` | `unknown` | `mixed` | 0 | 0 |
## Cross-validation verdict
### `CommsLog`
- **Result coverage:** 6 producers, 5 consumers
- **Type alias coverage:** 4 sites; 0 typed (0%); 4 untyped (100%)
- **Cross-audit findings (total sites):** 1
### `CommsLogEntry`
- **Result coverage:** 96 producers, 46 consumers
- **Type alias coverage:** 135 sites; 0 typed (0%); 135 untyped (100%)
- **Cross-audit findings (total sites):** 0
### `FileItem`
- **Result coverage:** 96 producers, 46 consumers
- **Type alias coverage:** 135 sites; 0 typed (0%); 135 untyped (100%)
- **Cross-audit findings (total sites):** 0
### `FileItems`
- **Result coverage:** 6 producers, 9 consumers
- **Type alias coverage:** 6 sites; 0 typed (0%); 6 untyped (100%)
- **Cross-audit findings (total sites):** 0
### `History`
- **Result coverage:** 7 producers, 7 consumers
- **Type alias coverage:** 8 sites; 0 typed (0%); 8 untyped (100%)
- **Cross-audit findings (total sites):** 0
### `HistoryMessage`
- **Result coverage:** 97 producers, 48 consumers
- **Type alias coverage:** 137 sites; 0 typed (0%); 137 untyped (100%)
- **Cross-audit findings (total sites):** 0
### `Metadata`
- **Result coverage:** 457 producers, 697 consumers
- **Type alias coverage:** 123 sites; 0 typed (0%); 123 untyped (100%)
- **Cross-audit findings (total sites):** 1
### `Result`
- **Result coverage:** 0 producers, 0 consumers
- **Type alias coverage:** 0 sites
- **Cross-audit findings (total sites):** 0
### `ToolCall`
- **Result coverage:** 97 producers, 47 consumers
- **Type alias coverage:** 136 sites; 0 typed (0%); 136 untyped (100%)
- **Cross-audit findings (total sites):** 0
### `ToolDefinition`
- **Result coverage:** 98 producers, 46 consumers
- **Type alias coverage:** 135 sites; 0 typed (0%); 135 untyped (100%)
- **Cross-audit findings (total sites):** 1
- `Metadata.md` - typealias, discussion-dim, whole_struct, 485 producers / 754 consumers
- `FileItem.md` - typealias, curation-dim, whole_struct, 117 producers / 66 consumers
- `FileItems.md` - typealias, curation-dim, whole_struct, 6 producers / 9 consumers
- `CommsLogEntry.md` - typealias, discussion-dim, whole_struct, 117 producers / 66 consumers
- `CommsLog.md` - typealias, discussion-dim, whole_struct, 6 producers / 5 consumers
- `HistoryMessage.md` - typealias, discussion-dim, whole_struct, 118 producers / 68 consumers
- `History.md` - typealias, discussion-dim, whole_struct, 7 producers / 7 consumers
- `ToolDefinition.md` - typealias, control-dim, whole_struct, 119 producers / 66 consumers
- `ToolCall.md` - typealias, control-dim, whole_struct, 118 producers / 67 consumers
- `Result.md` - typealias, control-dim, mixed, 0 producers / 0 consumers
- `ToolSpec.md` - candidate_dataclass, unknown-dim, mixed, 0 producers / 0 consumers
- `ChatMessage.md` - candidate_dataclass, discussion-dim, mixed, 0 producers / 0 consumers
- `ProviderHistory.md` - candidate_dataclass, unknown-dim, mixed, 0 producers / 0 consumers