Private
Public Access
0
0

feat(audit): alias resolution - all real aggregates now have data

This commit is contained in:
2026-06-22 12:52:22 -04:00
parent 077149011b
commit f7f616abb9
38 changed files with 20604 additions and 3009 deletions
File diff suppressed because it is too large Load Diff
@@ -7,31 +7,53 @@
\ === memory_dim ===
"discussion" mem-dim
\ === producers (0 items) ===
\ === producers (6 items) ===
"src.gui_2._render_beads_tab_list_result" "src\gui_2.py" 8314 "producer" fn-ref
"src.gui_2._drain_normalize_errors" "src\gui_2.py" 7417 "producer" fn-ref
"src.ai_client._list_gemini_models_result" "src\ai_client.py" 1626 "producer" fn-ref
"src.ai_client._list_anthropic_models_result" "src\ai_client.py" 1317 "producer" fn-ref
"src.ai_client._list_minimax_models_result" "src\ai_client.py" 2436 "producer" fn-ref
"src.ai_client._set_minimax_provider_result" "src\ai_client.py" 398 "producer" fn-ref
\ === consumers (0 items) ===
\ === consumers (5 items) ===
"src.app_controller._symbol_resolution_result" "src\app_controller.py" 3506 "consumer" fn-ref
"src.app_controller._topological_sort_tickets_result" "src\app_controller.py" 4708 "consumer" fn-ref
"src.gui_2.__init__" "src\gui_2.py" 7550 "consumer" fn-ref
"src.app_controller._serialize_tool_calls_result" "src\app_controller.py" 2217 "consumer" fn-ref
"src.project_manager.calculate_track_progress" "src\project_manager.py" 420 "consumer" fn-ref
\ === access_pattern ===
"mixed" access-pattern
"whole_struct" access-pattern
\ === access_pattern_evidence (0 items) ===
\ === access_pattern_evidence (5 items) ===
"src.app_controller._symbol_resolution_result" "whole_struct" 0 "low" ap-evidence
"src.app_controller._topological_sort_tickets_result" "whole_struct" 1 "high" ap-evidence
"src.gui_2.__init__" "field_by_field" 3 "high" ap-evidence
"src.app_controller._serialize_tool_calls_result" "whole_struct" 0 "low" ap-evidence
"src.project_manager.calculate_track_progress" "whole_struct" 0 "low" ap-evidence
\ === frequency ===
"per_turn" frequency
\ === frequency_evidence (0 items) ===
\ === frequency_evidence (5 items) ===
"src.gui_2._render_beads_tab_list_result" "per_turn" "static_analysis" "producer from src\gui_2.py" freq-evidence
"src.gui_2._drain_normalize_errors" "per_turn" "static_analysis" "producer from src\gui_2.py" freq-evidence
"src.ai_client._list_gemini_models_result" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.ai_client._list_anthropic_models_result" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.ai_client._list_minimax_models_result" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
\ === result_coverage ===
0 0 0 0 result-coverage
6 6 5 0 result-coverage
\ === type_alias_coverage ===
0 0 0 type-alias-coverage
4 0 4 type-alias-coverage
\ === cross_audit_findings ===
"audit_optional_in_3_files" 76 "src\ai_client.py" 159 "76 sites" cross-audit-finding
5 cross-audit-findings
\ === decomposition_cost ===
470 0 0 "insufficient_data" "CommsLog: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern." nil 5 true decomp-cost
470 0 70 "hold" "CommsLog: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern." nil 5 true decomp-cost
\ === optimization_candidates (0 items) ===
@@ -6,92 +6,141 @@
## Pipeline summary
- Producers: 0
- Consumers: 0
- Distinct producer fqnames: 0
- Distinct consumer fqnames: 0
- Access pattern (aggregate): mixed
- Producers: 6
- Consumers: 5
- Distinct producer fqnames: 6
- Distinct consumer fqnames: 5
- Access pattern (aggregate): whole_struct
- Frequency (aggregate): per_turn
- Decomposition direction: insufficient_data
- Decomposition direction: hold
- Struct field count (estimated): 5
## Producers (0)
## Producers (6)
_(none)_
### `src\ai_client.py` (4 producers)
## Consumers (0)
- `src.ai_client._list_gemini_models_result` (line 1626)
- `src.ai_client._list_anthropic_models_result` (line 1317)
- `src.ai_client._list_minimax_models_result` (line 2436)
- `src.ai_client._set_minimax_provider_result` (line 398)
_(none)_
### `src\gui_2.py` (2 producers)
- `src.gui_2._render_beads_tab_list_result` (line 8314)
- `src.gui_2._drain_normalize_errors` (line 7417)
## Consumers (5)
### `src\app_controller.py` (3 consumers)
- `src.app_controller._symbol_resolution_result` (line 3506)
- `src.app_controller._topological_sort_tickets_result` (line 4708)
- `src.app_controller._serialize_tool_calls_result` (line 2217)
### `src\gui_2.py` (1 consumer)
- `src.gui_2.__init__` (line 7550)
### `src\project_manager.py` (1 consumer)
- `src.project_manager.calculate_track_progress` (line 420)
## Field access matrix
_(no field accesses detected)_
| consumer | _attr_name | _cached | _module_name | _report_worker_error |
|---|---|---|---|---|
| `_symbol_resolution_result` | . | . | . | . |
| `_topological_sort_tickets_result` | . | . | . | 1 |
| `__init__` | 1 | 1 | 1 | . |
| `_serialize_tool_calls_result` | . | . | . | . |
| `calculate_track_progress` | . | . | . | . |
## Access pattern
**Dominant pattern:** mixed
**Evidence count:** 0
**Dominant pattern:** whole_struct
**Evidence count:** 5
**Per-function pattern distribution:**
- `whole_struct`: 4 functions (80%)
- `field_by_field`: 1 functions (20%)
## SSDL Sketch for `CommsLog`
```
[Q:CommsLog entry-point] -> [Q:PCG lookup]
-> [1: _symbol_resolution_result] [B:check] (branches=4)
-> [2: _topological_sort_tickets_result] [B:check] (branches=2)
-> [3: __init__] [B:check] (branches=0)
-> [4: _serialize_tool_calls_result] [B:check] (branches=2)
-> [5: calculate_track_progress] [B:check] (branches=1)
-> [T:done]
```
**Effective codepaths:** 0 (sum of 2^branches across 0 consumers)
**Total branch points:** 0
**Effective codepaths:** 27 (sum of 2^branches across 5 consumers)
**Total branch points:** 9
**Nil-check functions:** 0
**Defusing opportunities:**
- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `commslog_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 0 field-check branches to 1 cache lookup.
- Effective codepaths: 0 -> 1
- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `commslog_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 4 field-check branches to 1 cache lookup.
- Effective codepaths: 27 -> 4
## Frequency
**Dominant frequency:** per_turn
**Evidence count:** 0
**Evidence count:** 5
**Per-function frequency distribution:**
- `per_turn`: 5 functions
## Result coverage
**Summary:** 0 producers, 0 consumers
**Summary:** 6 producers, 5 consumers
| metric | value |
|---|---|
| total producers | 0 |
| result producers | 0 |
| total consumers | 0 |
| total producers | 6 |
| result producers | 6 |
| total consumers | 5 |
| result consumers | 0 |
## Type alias coverage
**Summary:** 0 sites
**Summary:** 4 sites; 0 typed (0%); 4 untyped (100%)
| metric | value |
|---|---|
| total field-access sites | 0 |
| total field-access sites | 4 |
| typed sites (canonical field) | 0 |
| untyped sites (wildcard) | 0 |
| untyped sites (wildcard) | 4 |
## Cross-audit findings
_(no cross-audit findings mapped to this aggregate)_
| bucket | audit script | site count | example file | example line | note |
|---|---|---|---|---|---|
| optional_in_baseline | `audit_optional_in_3_files` | 76 | `src\ai_client.py` | 159 | 76 sites |
## Decomposition cost
**Current cost estimate:** 470 us/turn
**Componentize savings:** 0 us/turn
**Unify savings:** 0 us/turn
**Recommended direction:** insufficient_data
**Rationale:** CommsLog: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern.
**Unify savings:** 70 us/turn
**Recommended direction:** hold
**Rationale:** CommsLog: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern.
**Struct field count (estimated):** 5
**Struct frozen:** True
## Struct shape (inferred from producer returns)
_(no producers; cannot infer shape)_
| field | access count | access pattern |
|---|---|---|
| `_report_worker_error` | 1 | used |
| `_module_name` | 1 | used |
| `_attr_name` | 1 | used |
| `_cached` | 1 | used |
## Optimization candidates
@@ -99,6 +148,26 @@ _(no optimization candidates generated)_
## Verdict
CommsLog: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern.
CommsLog: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern.
## Evidence appendix
### Access pattern evidence
| function | pattern | field_accesses | confidence |
|---|---|---|---|
| `src.app_controller._symbol_resolution_result` | `whole_struct` | | low |
| `src.app_controller._topological_sort_tickets_result` | `whole_struct` | `_report_worker_error`=1 | high |
| `src.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 |
### 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_minimax_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
@@ -1,12 +1,23 @@
Metadata: CommsLog
|- kind: typealias
|- memory_dim: discussion
|- producers: [0]
|- consumers: [0]
|- access_pattern: mixed
|- producers: [6]
| |- src.gui_2._render_beads_tab_list_result (producer)
| |- src.gui_2._drain_normalize_errors (producer)
| |- src.ai_client._list_gemini_models_result (producer)
| |- src.ai_client._list_anthropic_models_result (producer)
| |- src.ai_client._list_minimax_models_result (producer)
| |- src.ai_client._set_minimax_provider_result (producer)
|- consumers: [5]
| |- src.app_controller._symbol_resolution_result (consumer)
| |- src.app_controller._topological_sort_tickets_result (consumer)
| |- src.gui_2.__init__ (consumer)
| |- src.app_controller._serialize_tool_calls_result (consumer)
| |- src.project_manager.calculate_track_progress (consumer)
|- access_pattern: whole_struct
|- frequency: per_turn
|- result_coverage: 0 producers, 0 consumers
|- type_alias_coverage: 0 sites
|- cross_audit_findings: 0 findings
|- decomposition_cost: insufficient_data (470 us)
|- result_coverage: 6 producers, 5 consumers
|- type_alias_coverage: 4 sites; 0 typed (0%); 4 untyped (100%)
|- cross_audit_findings: 1 findings
|- decomposition_cost: hold (470 us)
|- optimization_candidates: [0]
@@ -7,31 +7,269 @@
\ === memory_dim ===
"discussion" mem-dim
\ === producers (0 items) ===
\ === producers (117 items) ===
"src.ai_client._extract_dashscope_tool_calls" "src\ai_client.py" 2754 "producer" fn-ref
"src.api_hook_client.get_warmup_wait" "src\api_hook_client.py" 332 "producer" fn-ref
"src.app_controller.wait" "src\app_controller.py" 5205 "producer" fn-ref
"src.ai_client._dashscope_call" "src\ai_client.py" 2716 "producer" fn-ref
"src.app_controller._pending_mma_spawn" "src\app_controller.py" 2772 "producer" fn-ref
"src.api_hook_client.wait_for_event" "src\api_hook_client.py" 136 "producer" fn-ref
"src.api_hook_client.clear_events" "src\api_hook_client.py" 129 "producer" fn-ref
"src.project_manager.get_all_tracks" "src\project_manager.py" 342 "producer" fn-ref
"src.app_controller._offload_entry_payload" "src\app_controller.py" 4240 "producer" fn-ref
"src.ai_client._strip_private_keys" "src\ai_client.py" 1464 "producer" fn-ref
"src.app_controller._api_get_diagnostics" "src\app_controller.py" 202 "producer" fn-ref
"src.app_controller.get_gui_state" "src\app_controller.py" 2829 "producer" fn-ref
"src.app_controller.load_config" "src\app_controller.py" 5142 "producer" fn-ref
"src.api_hook_client.get_warmup_status" "src\api_hook_client.py" 325 "producer" fn-ref
"src.api_hook_client.get_project" "src\api_hook_client.py" 367 "producer" fn-ref
"src.api_hook_client.get_mma_workers" "src\api_hook_client.py" 546 "producer" fn-ref
"src.models.to_dict" "src\models.py" 646 "producer" fn-ref
"src.api_hook_client.reject_patch" "src\api_hook_client.py" 288 "producer" fn-ref
"src.models.to_dict" "src\models.py" 406 "producer" fn-ref
"src.app_controller._api_get_session" "src\app_controller.py" 374 "producer" fn-ref
"src.ai_client._parse_tool_args_result" "src\ai_client.py" 741 "producer" fn-ref
"src.app_controller._api_pending_actions" "src\app_controller.py" 335 "producer" fn-ref
"src.models.to_dict" "src\models.py" 855 "producer" fn-ref
"src.project_manager.load_history" "src\project_manager.py" 209 "producer" fn-ref
"src.app_controller.get_context" "src\app_controller.py" 2892 "producer" fn-ref
"src.ai_client._build_chunked_context_blocks" "src\ai_client.py" 1281 "producer" fn-ref
"src.ai_client._get_anthropic_tools" "src\ai_client.py" 664 "producer" fn-ref
"src.api_hook_client.get_gui_state" "src\api_hook_client.py" 165 "producer" fn-ref
"src.models.to_dict" "src\models.py" 938 "producer" fn-ref
"src.models.to_dict" "src\models.py" 1059 "producer" fn-ref
"src.ai_client._get_deepseek_tools" "src\ai_client.py" 1194 "producer" fn-ref
"src.models.parse_history_entries" "src\models.py" 214 "producer" fn-ref
"src.api_hook_client.get_events" "src\api_hook_client.py" 124 "producer" fn-ref
"src.ai_client._pre_dispatch" "src\ai_client.py" 2089 "producer" fn-ref
"src.project_manager.str_to_entry" "src\project_manager.py" 75 "producer" fn-ref
"src.api_hook_client.post_project" "src\api_hook_client.py" 473 "producer" fn-ref
"src.models.to_dict" "src\models.py" 794 "producer" fn-ref
"src.api_hook_client.get_session" "src\api_hook_client.py" 502 "producer" fn-ref
"src.app_controller.token_stats" "src\app_controller.py" 2898 "producer" fn-ref
"src.api_hook_client.get_io_pool_status" "src\api_hook_client.py" 420 "producer" fn-ref
"src.api_hook_client.trigger_patch" "src\api_hook_client.py" 274 "producer" fn-ref
"src.api_hook_client.get_gui_health" "src\api_hook_client.py" 434 "producer" fn-ref
"src.ai_client.get_gemini_cache_stats" "src\ai_client.py" 1604 "producer" fn-ref
"src.app_controller._api_get_api_project" "src\app_controller.py" 188 "producer" fn-ref
"src.api_hook_client.get_status" "src\api_hook_client.py" 105 "producer" fn-ref
"src.app_controller._api_get_context" "src\app_controller.py" 398 "producer" fn-ref
"src.app_controller._api_token_stats" "src\app_controller.py" 417 "producer" fn-ref
"src.api_hook_client.get_context_state" "src\api_hook_client.py" 491 "producer" fn-ref
"src.api_hook_client.set_value" "src\api_hook_client.py" 212 "producer" fn-ref
"src.app_controller.get_mma_status" "src\app_controller.py" 2835 "producer" fn-ref
"src.api_hook_client.post_gui" "src\api_hook_client.py" 149 "producer" fn-ref
"src.api_hook_client.get_gui_diagnostics" "src\api_hook_client.py" 311 "producer" fn-ref
"src.app_controller._api_get_performance" "src\app_controller.py" 195 "producer" fn-ref
"src.app_controller._api_get_api_session" "src\app_controller.py" 170 "producer" fn-ref
"src.api_hook_client.get_mma_status" "src\api_hook_client.py" 539 "producer" fn-ref
"src.models.to_dict" "src\models.py" 1000 "producer" fn-ref
"src.models.to_dict" "src\models.py" 672 "producer" fn-ref
"src.models.to_dict" "src\models.py" 355 "producer" fn-ref
"src.aggregate.build_file_items" "src\aggregate.py" 158 "producer" fn-ref
"src.api_hook_client.get_startup_timeline" "src\api_hook_client.py" 353 "producer" fn-ref
"src.api_hook_client.get_node_status" "src\api_hook_client.py" 532 "producer" fn-ref
"src.api_hook_client.get_performance" "src\api_hook_client.py" 318 "producer" fn-ref
"src.ai_client._load_credentials" "src\ai_client.py" 282 "producer" fn-ref
"src.app_controller._api_get_gui_state" "src\app_controller.py" 123 "producer" fn-ref
"src.project_manager.default_project" "src\project_manager.py" 123 "producer" fn-ref
"src.api_hook_client.post_session" "src\api_hook_client.py" 117 "producer" fn-ref
"src.app_controller.get_performance" "src\app_controller.py" 2856 "producer" fn-ref
"src.project_manager.migrate_from_legacy_config" "src\project_manager.py" 253 "producer" fn-ref
"src.models.to_dict" "src\models.py" 486 "producer" fn-ref
"src.models.to_dict" "src\models.py" 913 "producer" fn-ref
"src.models.to_dict" "src\models.py" 596 "producer" fn-ref
"src.api_hook_client.push_event" "src\api_hook_client.py" 156 "producer" fn-ref
"src.api_hook_client.get_warmup_canaries" "src\api_hook_client.py" 342 "producer" fn-ref
"src.api_hook_client.drag" "src\api_hook_client.py" 230 "producer" fn-ref
"src.app_controller.pending_actions" "src\app_controller.py" 2874 "producer" fn-ref
"src.ai_client.get_token_stats" "src\ai_client.py" 3185 "producer" fn-ref
"src.models.to_dict" "src\models.py" 886 "producer" fn-ref
"src.app_controller.status" "src\app_controller.py" 2865 "producer" fn-ref
"src.models.to_dict" "src\models.py" 558 "producer" fn-ref
"src.api_hook_client.apply_patch" "src\api_hook_client.py" 281 "producer" fn-ref
"src.models._load_config_from_disk" "src\models.py" 186 "producer" fn-ref
"src.api_hook_client.post_project" "src\api_hook_client.py" 470 "producer" fn-ref
"src.app_controller._api_get_mma_status" "src\app_controller.py" 144 "producer" fn-ref
"src.api_hook_client.get_patch_status" "src\api_hook_client.py" 295 "producer" fn-ref
"src.app_controller.generate" "src\app_controller.py" 2868 "producer" fn-ref
"src.models.to_dict" "src\models.py" 441 "producer" fn-ref
"src.app_controller.get_api_project" "src\app_controller.py" 2853 "producer" fn-ref
"src.app_controller._api_status" "src\app_controller.py" 209 "producer" fn-ref
"src.project_manager.flat_config" "src\project_manager.py" 267 "producer" fn-ref
"src.models.to_dict" "src\models.py" 1024 "producer" fn-ref
"src.ai_client.ollama_chat" "src\ai_client.py" 2938 "producer" fn-ref
"src.api_hook_client.wait_for_project_switch" "src\api_hook_client.py" 389 "producer" fn-ref
"src.models.to_dict" "src\models.py" 971 "producer" fn-ref
"src.api_hook_client.click" "src\api_hook_client.py" 223 "producer" fn-ref
"src.ai_client.get_comms_log" "src\ai_client.py" 273 "producer" fn-ref
"src.app_controller._api_generate" "src\app_controller.py" 221 "producer" fn-ref
"src.api_hook_client.select_list_item" "src\api_hook_client.py" 256 "producer" fn-ref
"src.models.to_dict" "src\models.py" 288 "producer" fn-ref
"src.api_hook_client.get_project_switch_status" "src\api_hook_client.py" 374 "producer" fn-ref
"src.models.to_dict" "src\models.py" 737 "producer" fn-ref
"src.project_manager.load_project" "src\project_manager.py" 186 "producer" fn-ref
"src.app_controller.get_session" "src\app_controller.py" 2883 "producer" fn-ref
"src.api_hook_client.get_system_telemetry" "src\api_hook_client.py" 524 "producer" fn-ref
"src.models.to_dict" "src\models.py" 618 "producer" fn-ref
"src.api_hook_client._make_request" "src\api_hook_client.py" 65 "producer" fn-ref
"src.app_controller.get_diagnostics" "src\app_controller.py" 2862 "producer" fn-ref
"src.app_controller.get_session_insights" "src\app_controller.py" 3049 "producer" fn-ref
"src.ai_client._content_block_to_dict" "src\ai_client.py" 1200 "producer" fn-ref
"src.api_hook_client.select_tab" "src\api_hook_client.py" 263 "producer" fn-ref
"src.app_controller._pending_mma_approval" "src\app_controller.py" 2776 "producer" fn-ref
"src.ai_client._add_bleed_derived" "src\ai_client.py" 3332 "producer" fn-ref
"src.models.to_dict" "src\models.py" 701 "producer" fn-ref
"src.api_hook_client.right_click" "src\api_hook_client.py" 237 "producer" fn-ref
"src.app_controller.get_api_session" "src\app_controller.py" 2847 "producer" fn-ref
"src.project_manager.default_discussion" "src\project_manager.py" 117 "producer" fn-ref
"src.ai_client._send_cli_round_result" "src\ai_client.py" 1746 "producer" fn-ref
"src.api_hook_client.get_financial_metrics" "src\api_hook_client.py" 520 "producer" fn-ref
\ === consumers (0 items) ===
\ === consumers (66 items) ===
"src.ai_client._invalidate_token_estimate" "src\ai_client.py" 1240 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 920 "consumer" fn-ref
"src.aggregate.build_markdown_from_items" "src\aggregate.py" 348 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 603 "consumer" fn-ref
"src.ai_client._create_gemini_cache_result" "src\ai_client.py" 1706 "consumer" fn-ref
"src.ai_client._send_grok" "src\ai_client.py" 2530 "consumer" fn-ref
"src.ai_client._strip_private_keys" "src\ai_client.py" 1464 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 506 "consumer" fn-ref
"src.ai_client._send_gemini_cli" "src\ai_client.py" 2019 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 814 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 893 "consumer" fn-ref
"src.ai_client._send_gemini" "src\ai_client.py" 1802 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 378 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 1038 "consumer" fn-ref
"src.ai_client._send_anthropic" "src\ai_client.py" 1405 "consumer" fn-ref
"src.project_manager.save_project" "src\project_manager.py" 229 "consumer" fn-ref
"src.ai_client._trim_anthropic_history" "src\ai_client.py" 1353 "consumer" fn-ref
"src.ai_client._send_llama" "src\ai_client.py" 2858 "consumer" fn-ref
"src.aggregate.build_tier3_context" "src\aggregate.py" 382 "consumer" fn-ref
"src.app_controller._offload_entry_payload" "src\app_controller.py" 4240 "consumer" fn-ref
"src.project_manager.format_discussion" "src\project_manager.py" 69 "consumer" fn-ref
"src.project_manager.entry_to_str" "src\project_manager.py" 49 "consumer" fn-ref
"src.ai_client._repair_minimax_history" "src\ai_client.py" 2462 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 1007 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 747 "consumer" fn-ref
"src.ai_client._strip_stale_file_refreshes" "src\ai_client.py" 1253 "consumer" fn-ref
"src.ai_client._send_deepseek" "src\ai_client.py" 2165 "consumer" fn-ref
"src.ai_client._add_bleed_derived" "src\ai_client.py" 3332 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 683 "consumer" fn-ref
"src.aggregate.build_markdown_no_history" "src\aggregate.py" 366 "consumer" fn-ref
"src.project_manager.flat_config" "src\project_manager.py" 267 "consumer" fn-ref
"src.ai_client._send_llama_native" "src\ai_client.py" 2958 "consumer" fn-ref
"src.ai_client.ollama_chat" "src\ai_client.py" 2938 "consumer" fn-ref
"src.ai_client._send_qwen" "src\ai_client.py" 2773 "consumer" fn-ref
"src.app_controller._on_comms_entry" "src\app_controller.py" 4282 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 712 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 866 "consumer" fn-ref
"src.ai_client._repair_deepseek_history" "src\ai_client.py" 2138 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 454 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 575 "consumer" fn-ref
"src.ai_client._execute_single_tool_call_async" "src\ai_client.py" 945 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 630 "consumer" fn-ref
"src.ai_client._repair_anthropic_history" "src\ai_client.py" 1381 "consumer" fn-ref
"src.ai_client._strip_cache_controls" "src\ai_client.py" 1291 "consumer" fn-ref
"src.aggregate.run" "src\aggregate.py" 479 "consumer" fn-ref
"src.models._save_config_to_disk" "src\models.py" 199 "consumer" fn-ref
"src.ai_client._dashscope_call" "src\ai_client.py" 2716 "consumer" fn-ref
"src.app_controller._start_track_logic_result" "src\app_controller.py" 4728 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 949 "consumer" fn-ref
"src.ai_client._estimate_prompt_tokens" "src\ai_client.py" 1243 "consumer" fn-ref
"src.ai_client._append_comms" "src\ai_client.py" 257 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 982 "consumer" fn-ref
"src.ai_client._estimate_message_tokens" "src\ai_client.py" 1218 "consumer" fn-ref
"src.ai_client._add_history_cache_breakpoint" "src\ai_client.py" 1299 "consumer" fn-ref
"src.ai_client._pre_dispatch" "src\ai_client.py" 2089 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 295 "consumer" fn-ref
"src.aggregate._build_files_section_from_items" "src\aggregate.py" 300 "consumer" fn-ref
"src.ai_client._trim_minimax_history" "src\ai_client.py" 2482 "consumer" fn-ref
"src.app_controller._refresh_api_metrics" "src\app_controller.py" 3074 "consumer" fn-ref
"src.app_controller._start_track_logic" "src\app_controller.py" 4721 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 416 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 656 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 1072 "consumer" fn-ref
"src.project_manager.migrate_from_legacy_config" "src\project_manager.py" 253 "consumer" fn-ref
"src.ai_client._send_minimax" "src\ai_client.py" 2616 "consumer" fn-ref
"src.ai_client.send" "src\ai_client.py" 3208 "consumer" fn-ref
\ === access_pattern ===
"mixed" access-pattern
"whole_struct" access-pattern
\ === access_pattern_evidence (0 items) ===
\ === access_pattern_evidence (50 items) ===
"src.ai_client._invalidate_token_estimate" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.aggregate.build_markdown_from_items" "whole_struct" 0 "low" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._create_gemini_cache_result" "whole_struct" 0 "low" ap-evidence
"src.ai_client._send_grok" "whole_struct" 0 "low" ap-evidence
"src.ai_client._strip_private_keys" "whole_struct" 0 "low" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._send_gemini_cli" "whole_struct" 0 "low" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._send_gemini" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._send_anthropic" "whole_struct" 0 "low" ap-evidence
"src.project_manager.save_project" "mixed" 2 "high" ap-evidence
"src.ai_client._trim_anthropic_history" "whole_struct" 1 "high" ap-evidence
"src.ai_client._send_llama" "whole_struct" 0 "low" ap-evidence
"src.aggregate.build_tier3_context" "whole_struct" 0 "low" ap-evidence
"src.app_controller._offload_entry_payload" "whole_struct" 0 "low" ap-evidence
"src.project_manager.format_discussion" "whole_struct" 0 "low" ap-evidence
"src.project_manager.entry_to_str" "whole_struct" 1 "high" ap-evidence
"src.ai_client._repair_minimax_history" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._strip_stale_file_refreshes" "whole_struct" 0 "low" ap-evidence
"src.ai_client._send_deepseek" "whole_struct" 0 "low" ap-evidence
"src.ai_client._add_bleed_derived" "field_by_field" 9 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.aggregate.build_markdown_no_history" "whole_struct" 0 "low" ap-evidence
"src.project_manager.flat_config" "whole_struct" 1 "high" ap-evidence
"src.ai_client._send_llama_native" "whole_struct" 0 "low" ap-evidence
"src.ai_client.ollama_chat" "whole_struct" 0 "low" ap-evidence
"src.ai_client._send_qwen" "whole_struct" 0 "low" ap-evidence
"src.app_controller._on_comms_entry" "field_by_field" 10 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._repair_deepseek_history" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._execute_single_tool_call_async" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._repair_anthropic_history" "whole_struct" 1 "high" ap-evidence
"src.ai_client._strip_cache_controls" "whole_struct" 0 "low" ap-evidence
"src.aggregate.run" "field_by_field" 3 "high" ap-evidence
"src.models._save_config_to_disk" "whole_struct" 0 "low" ap-evidence
"src.ai_client._dashscope_call" "whole_struct" 0 "low" ap-evidence
"src.app_controller._start_track_logic_result" "field_by_field" 17 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._estimate_prompt_tokens" "whole_struct" 0 "low" ap-evidence
\ === frequency ===
"per_turn" frequency
\ === frequency_evidence (0 items) ===
\ === frequency_evidence (5 items) ===
"src.ai_client._extract_dashscope_tool_calls" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.api_hook_client.get_warmup_wait" "per_turn" "static_analysis" "producer from src\api_hook_client.py" freq-evidence
"src.app_controller.wait" "per_turn" "static_analysis" "producer from src\app_controller.py" freq-evidence
"src.ai_client._dashscope_call" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.app_controller._pending_mma_spawn" "per_turn" "static_analysis" "producer from src\app_controller.py" freq-evidence
\ === result_coverage ===
0 0 0 0 result-coverage
96 96 46 0 result-coverage
\ === type_alias_coverage ===
0 0 0 type-alias-coverage
135 0 135 type-alias-coverage
\ === cross_audit_findings ===
5 cross-audit-findings
\ === decomposition_cost ===
470 0 0 "insufficient_data" "CommsLogEntry: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern." nil 5 true decomp-cost
470 0 70 "hold" "CommsLogEntry: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern." nil 5 true decomp-cost
\ === optimization_candidates (0 items) ===
@@ -6,74 +6,419 @@
## Pipeline summary
- Producers: 0
- Consumers: 0
- Distinct producer fqnames: 0
- Distinct consumer fqnames: 0
- Access pattern (aggregate): mixed
- Producers: 117
- Consumers: 66
- Distinct producer fqnames: 96
- Distinct consumer fqnames: 46
- Access pattern (aggregate): whole_struct
- Frequency (aggregate): per_turn
- Decomposition direction: insufficient_data
- Decomposition direction: hold
- Struct field count (estimated): 5
## Producers (0)
## Producers (117)
_(none)_
### `src\aggregate.py` (1 producer)
## Consumers (0)
- `src.aggregate.build_file_items` (line 158)
_(none)_
### `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._add_bleed_derived` (line 3332)
- `src.ai_client._send_cli_round_result` (line 1746)
### `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_gui_health` (line 434)
- `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.right_click` (line 237)
- `src.api_hook_client.get_financial_metrics` (line 520)
### `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\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 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 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 618)
- `src.models.to_dict` (line 701)
### `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.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)
## 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\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._pre_dispatch` (line 2089)
- `src.ai_client._trim_minimax_history` (line 2482)
- `src.ai_client._send_minimax` (line 2616)
- `src.ai_client.send` (line 3208)
### `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._refresh_api_metrics` (line 3074)
- `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._save_config_to_disk` (line 199)
- `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\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.migrate_from_legacy_config` (line 253)
## Field access matrix
_(no field accesses detected)_
| 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| `_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 | . | . | . | . | . | . |
| `_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` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
_... 23 more fields_
## Access pattern
**Dominant pattern:** mixed
**Evidence count:** 0
**Dominant pattern:** whole_struct
**Evidence count:** 50
**Per-function pattern distribution:**
- `whole_struct`: 28 functions (56%)
- `mixed`: 18 functions (36%)
- `field_by_field`: 4 functions (8%)
## SSDL Sketch for `CommsLogEntry`
```
[Q:CommsLogEntry entry-point] -> [Q:PCG lookup]
-> [1: _invalidate_token_estimate] [B:check] (branches=0)
-> [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]
-> [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)
-> [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)
-> [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: _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)
-> [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)
-> [T:done]
```
**Effective codepaths:** 0 (sum of 2^branches across 0 consumers)
**Total branch points:** 0
**Nil-check functions:** 0
**Effective codepaths:** 40140116231395706750390 (sum of 2^branches across 66 consumers)
**Total branch points:** 541
**Nil-check functions:** 9
**Defusing opportunities:**
- **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 0 field-check branches to 1 cache lookup.
- Effective codepaths: 0 -> 1
- **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
- **Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`**: Wrap the aggregate in a generational handle (index + generation). Validation is one comparison; mismatch returns the nil sentinel. Reduces N lifetime branches to 1 handle validation + sentinel return.
- Effective codepaths: 40140116231395706750390 -> 66
## Frequency
**Dominant frequency:** per_turn
**Evidence count:** 0
**Evidence count:** 5
**Per-function frequency distribution:**
- `per_turn`: 5 functions
## Result coverage
**Summary:** 0 producers, 0 consumers
**Summary:** 96 producers, 46 consumers
| metric | value |
|---|---|
| total producers | 0 |
| result producers | 0 |
| total consumers | 0 |
| total producers | 96 |
| result producers | 96 |
| total consumers | 46 |
| result consumers | 0 |
## Type alias coverage
**Summary:** 0 sites
**Summary:** 135 sites; 0 typed (0%); 135 untyped (100%)
| metric | value |
|---|---|
| total field-access sites | 0 |
| total field-access sites | 135 |
| typed sites (canonical field) | 0 |
| untyped sites (wildcard) | 0 |
| untyped sites (wildcard) | 135 |
## Cross-audit findings
@@ -83,15 +428,59 @@ _(no cross-audit findings mapped to this aggregate)_
**Current cost estimate:** 470 us/turn
**Componentize savings:** 0 us/turn
**Unify savings:** 0 us/turn
**Recommended direction:** insufficient_data
**Rationale:** CommsLogEntry: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern.
**Unify savings:** 70 us/turn
**Recommended direction:** hold
**Rationale:** CommsLogEntry: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern.
**Struct field count (estimated):** 5
**Struct frozen:** True
## Struct shape (inferred from producer returns)
_(no producers; cannot infer shape)_
| 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 |
| `estimated_prompt_tokens` | 1 | used |
| `max_prompt_tokens` | 1 | used |
| `utilization_pct` | 1 | used |
| `headroom` | 1 | used |
| `would_trim` | 1 | used |
| `sys_tokens` | 1 | used |
| `tool_tokens` | 1 | used |
| `history_tokens` | 1 | used |
| `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 |
| `_topological_sort_tickets_result` | 1 | used |
| `active_project_root` | 1 | used |
| `event_queue` | 1 | used |
| `engines` | 1 | used |
| `project` | 1 | used |
| `active_discussion` | 1 | used |
| `submit_io` | 1 | used |
| `tracks` | 1 | used |
| `config` | 1 | used |
| `mma_tier_usage` | 1 | used |
| `_pending_gui_tasks` | 1 | used |
| `mma_step_mode` | 1 | used |
| `active_project_path` | 1 | used |
## Optimization candidates
@@ -99,6 +488,71 @@ _(no optimization candidates generated)_
## Verdict
CommsLogEntry: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern.
CommsLogEntry: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern.
## Evidence appendix
### Access pattern evidence
| function | pattern | field_accesses | confidence |
|---|---|---|---|
| `src.ai_client._invalidate_token_estimate` | `whole_struct` | `pop`=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.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.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.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 |
### 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 |
@@ -1,12 +1,195 @@
Metadata: CommsLogEntry
|- kind: typealias
|- memory_dim: discussion
|- producers: [0]
|- consumers: [0]
|- access_pattern: mixed
|- producers: [117]
| |- src.ai_client._extract_dashscope_tool_calls (producer)
| |- src.api_hook_client.get_warmup_wait (producer)
| |- src.app_controller.wait (producer)
| |- src.ai_client._dashscope_call (producer)
| |- src.app_controller._pending_mma_spawn (producer)
| |- src.api_hook_client.wait_for_event (producer)
| |- src.api_hook_client.clear_events (producer)
| |- src.project_manager.get_all_tracks (producer)
| |- src.app_controller._offload_entry_payload (producer)
| |- src.ai_client._strip_private_keys (producer)
| |- src.app_controller._api_get_diagnostics (producer)
| |- src.app_controller.get_gui_state (producer)
| |- src.app_controller.load_config (producer)
| |- src.api_hook_client.get_warmup_status (producer)
| |- src.api_hook_client.get_project (producer)
| |- src.api_hook_client.get_mma_workers (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.reject_patch (producer)
| |- src.models.to_dict (producer)
| |- src.app_controller._api_get_session (producer)
| |- src.ai_client._parse_tool_args_result (producer)
| |- src.app_controller._api_pending_actions (producer)
| |- src.models.to_dict (producer)
| |- src.project_manager.load_history (producer)
| |- src.app_controller.get_context (producer)
| |- src.ai_client._build_chunked_context_blocks (producer)
| |- src.ai_client._get_anthropic_tools (producer)
| |- src.api_hook_client.get_gui_state (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.ai_client._get_deepseek_tools (producer)
| |- src.models.parse_history_entries (producer)
| |- src.api_hook_client.get_events (producer)
| |- src.ai_client._pre_dispatch (producer)
| |- src.project_manager.str_to_entry (producer)
| |- src.api_hook_client.post_project (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.get_session (producer)
| |- src.app_controller.token_stats (producer)
| |- src.api_hook_client.get_io_pool_status (producer)
| |- src.api_hook_client.trigger_patch (producer)
| |- src.api_hook_client.get_gui_health (producer)
| |- src.ai_client.get_gemini_cache_stats (producer)
| |- src.app_controller._api_get_api_project (producer)
| |- src.api_hook_client.get_status (producer)
| |- src.app_controller._api_get_context (producer)
| |- src.app_controller._api_token_stats (producer)
| |- src.api_hook_client.get_context_state (producer)
| |- src.api_hook_client.set_value (producer)
| |- src.app_controller.get_mma_status (producer)
| |- src.api_hook_client.post_gui (producer)
| |- src.api_hook_client.get_gui_diagnostics (producer)
| |- src.app_controller._api_get_performance (producer)
| |- src.app_controller._api_get_api_session (producer)
| |- src.api_hook_client.get_mma_status (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.aggregate.build_file_items (producer)
| |- src.api_hook_client.get_startup_timeline (producer)
| |- src.api_hook_client.get_node_status (producer)
| |- src.api_hook_client.get_performance (producer)
| |- src.ai_client._load_credentials (producer)
| |- src.app_controller._api_get_gui_state (producer)
| |- src.project_manager.default_project (producer)
| |- src.api_hook_client.post_session (producer)
| |- src.app_controller.get_performance (producer)
| |- src.project_manager.migrate_from_legacy_config (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.push_event (producer)
| |- src.api_hook_client.get_warmup_canaries (producer)
| |- src.api_hook_client.drag (producer)
| |- src.app_controller.pending_actions (producer)
| |- src.ai_client.get_token_stats (producer)
| |- src.models.to_dict (producer)
| |- src.app_controller.status (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.apply_patch (producer)
| |- src.models._load_config_from_disk (producer)
| |- src.api_hook_client.post_project (producer)
| |- src.app_controller._api_get_mma_status (producer)
| |- src.api_hook_client.get_patch_status (producer)
| |- src.app_controller.generate (producer)
| |- src.models.to_dict (producer)
| |- src.app_controller.get_api_project (producer)
| |- src.app_controller._api_status (producer)
| |- src.project_manager.flat_config (producer)
| |- src.models.to_dict (producer)
| |- src.ai_client.ollama_chat (producer)
| |- src.api_hook_client.wait_for_project_switch (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.click (producer)
| |- src.ai_client.get_comms_log (producer)
| |- src.app_controller._api_generate (producer)
| |- src.api_hook_client.select_list_item (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.get_project_switch_status (producer)
| |- src.models.to_dict (producer)
| |- src.project_manager.load_project (producer)
| |- src.app_controller.get_session (producer)
| |- src.api_hook_client.get_system_telemetry (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client._make_request (producer)
| |- src.app_controller.get_diagnostics (producer)
| |- src.app_controller.get_session_insights (producer)
| |- src.ai_client._content_block_to_dict (producer)
| |- src.api_hook_client.select_tab (producer)
| |- src.app_controller._pending_mma_approval (producer)
| |- src.ai_client._add_bleed_derived (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.right_click (producer)
| |- src.app_controller.get_api_session (producer)
| |- src.project_manager.default_discussion (producer)
| |- src.ai_client._send_cli_round_result (producer)
| |- src.api_hook_client.get_financial_metrics (producer)
|- consumers: [66]
| |- src.ai_client._invalidate_token_estimate (consumer)
| |- src.models.from_dict (consumer)
| |- src.aggregate.build_markdown_from_items (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._create_gemini_cache_result (consumer)
| |- src.ai_client._send_grok (consumer)
| |- src.ai_client._strip_private_keys (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._send_gemini_cli (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._send_gemini (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._send_anthropic (consumer)
| |- src.project_manager.save_project (consumer)
| |- src.ai_client._trim_anthropic_history (consumer)
| |- src.ai_client._send_llama (consumer)
| |- src.aggregate.build_tier3_context (consumer)
| |- src.app_controller._offload_entry_payload (consumer)
| |- src.project_manager.format_discussion (consumer)
| |- src.project_manager.entry_to_str (consumer)
| |- src.ai_client._repair_minimax_history (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._strip_stale_file_refreshes (consumer)
| |- src.ai_client._send_deepseek (consumer)
| |- src.ai_client._add_bleed_derived (consumer)
| |- src.models.from_dict (consumer)
| |- src.aggregate.build_markdown_no_history (consumer)
| |- src.project_manager.flat_config (consumer)
| |- src.ai_client._send_llama_native (consumer)
| |- src.ai_client.ollama_chat (consumer)
| |- src.ai_client._send_qwen (consumer)
| |- src.app_controller._on_comms_entry (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._repair_deepseek_history (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._execute_single_tool_call_async (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._repair_anthropic_history (consumer)
| |- src.ai_client._strip_cache_controls (consumer)
| |- src.aggregate.run (consumer)
| |- src.models._save_config_to_disk (consumer)
| |- src.ai_client._dashscope_call (consumer)
| |- src.app_controller._start_track_logic_result (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._estimate_prompt_tokens (consumer)
| |- src.ai_client._append_comms (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._estimate_message_tokens (consumer)
| |- src.ai_client._add_history_cache_breakpoint (consumer)
| |- src.ai_client._pre_dispatch (consumer)
| |- src.models.from_dict (consumer)
| |- src.aggregate._build_files_section_from_items (consumer)
| |- src.ai_client._trim_minimax_history (consumer)
| |- src.app_controller._refresh_api_metrics (consumer)
| |- src.app_controller._start_track_logic (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.project_manager.migrate_from_legacy_config (consumer)
| |- src.ai_client._send_minimax (consumer)
| |- src.ai_client.send (consumer)
|- access_pattern: whole_struct
|- frequency: per_turn
|- result_coverage: 0 producers, 0 consumers
|- type_alias_coverage: 0 sites
|- result_coverage: 96 producers, 46 consumers
|- type_alias_coverage: 135 sites; 0 typed (0%); 135 untyped (100%)
|- cross_audit_findings: 0 findings
|- decomposition_cost: insufficient_data (470 us)
|- decomposition_cost: hold (470 us)
|- optimization_candidates: [0]
@@ -7,31 +7,269 @@
\ === memory_dim ===
"curation" mem-dim
\ === producers (0 items) ===
\ === producers (117 items) ===
"src.ai_client._extract_dashscope_tool_calls" "src\ai_client.py" 2754 "producer" fn-ref
"src.api_hook_client.get_warmup_wait" "src\api_hook_client.py" 332 "producer" fn-ref
"src.app_controller.wait" "src\app_controller.py" 5205 "producer" fn-ref
"src.ai_client._dashscope_call" "src\ai_client.py" 2716 "producer" fn-ref
"src.app_controller._pending_mma_spawn" "src\app_controller.py" 2772 "producer" fn-ref
"src.api_hook_client.wait_for_event" "src\api_hook_client.py" 136 "producer" fn-ref
"src.api_hook_client.clear_events" "src\api_hook_client.py" 129 "producer" fn-ref
"src.project_manager.get_all_tracks" "src\project_manager.py" 342 "producer" fn-ref
"src.app_controller._offload_entry_payload" "src\app_controller.py" 4240 "producer" fn-ref
"src.ai_client._strip_private_keys" "src\ai_client.py" 1464 "producer" fn-ref
"src.app_controller._api_get_diagnostics" "src\app_controller.py" 202 "producer" fn-ref
"src.app_controller.get_gui_state" "src\app_controller.py" 2829 "producer" fn-ref
"src.app_controller.load_config" "src\app_controller.py" 5142 "producer" fn-ref
"src.api_hook_client.get_warmup_status" "src\api_hook_client.py" 325 "producer" fn-ref
"src.api_hook_client.get_project" "src\api_hook_client.py" 367 "producer" fn-ref
"src.api_hook_client.get_mma_workers" "src\api_hook_client.py" 546 "producer" fn-ref
"src.models.to_dict" "src\models.py" 646 "producer" fn-ref
"src.api_hook_client.reject_patch" "src\api_hook_client.py" 288 "producer" fn-ref
"src.models.to_dict" "src\models.py" 406 "producer" fn-ref
"src.app_controller._api_get_session" "src\app_controller.py" 374 "producer" fn-ref
"src.ai_client._parse_tool_args_result" "src\ai_client.py" 741 "producer" fn-ref
"src.app_controller._api_pending_actions" "src\app_controller.py" 335 "producer" fn-ref
"src.models.to_dict" "src\models.py" 855 "producer" fn-ref
"src.project_manager.load_history" "src\project_manager.py" 209 "producer" fn-ref
"src.app_controller.get_context" "src\app_controller.py" 2892 "producer" fn-ref
"src.ai_client._build_chunked_context_blocks" "src\ai_client.py" 1281 "producer" fn-ref
"src.ai_client._get_anthropic_tools" "src\ai_client.py" 664 "producer" fn-ref
"src.api_hook_client.get_gui_state" "src\api_hook_client.py" 165 "producer" fn-ref
"src.models.to_dict" "src\models.py" 938 "producer" fn-ref
"src.models.to_dict" "src\models.py" 1059 "producer" fn-ref
"src.ai_client._get_deepseek_tools" "src\ai_client.py" 1194 "producer" fn-ref
"src.models.parse_history_entries" "src\models.py" 214 "producer" fn-ref
"src.api_hook_client.get_events" "src\api_hook_client.py" 124 "producer" fn-ref
"src.ai_client._pre_dispatch" "src\ai_client.py" 2089 "producer" fn-ref
"src.project_manager.str_to_entry" "src\project_manager.py" 75 "producer" fn-ref
"src.api_hook_client.post_project" "src\api_hook_client.py" 473 "producer" fn-ref
"src.models.to_dict" "src\models.py" 794 "producer" fn-ref
"src.api_hook_client.get_session" "src\api_hook_client.py" 502 "producer" fn-ref
"src.app_controller.token_stats" "src\app_controller.py" 2898 "producer" fn-ref
"src.api_hook_client.get_io_pool_status" "src\api_hook_client.py" 420 "producer" fn-ref
"src.api_hook_client.trigger_patch" "src\api_hook_client.py" 274 "producer" fn-ref
"src.api_hook_client.get_gui_health" "src\api_hook_client.py" 434 "producer" fn-ref
"src.ai_client.get_gemini_cache_stats" "src\ai_client.py" 1604 "producer" fn-ref
"src.app_controller._api_get_api_project" "src\app_controller.py" 188 "producer" fn-ref
"src.api_hook_client.get_status" "src\api_hook_client.py" 105 "producer" fn-ref
"src.app_controller._api_get_context" "src\app_controller.py" 398 "producer" fn-ref
"src.app_controller._api_token_stats" "src\app_controller.py" 417 "producer" fn-ref
"src.api_hook_client.get_context_state" "src\api_hook_client.py" 491 "producer" fn-ref
"src.api_hook_client.set_value" "src\api_hook_client.py" 212 "producer" fn-ref
"src.app_controller.get_mma_status" "src\app_controller.py" 2835 "producer" fn-ref
"src.api_hook_client.post_gui" "src\api_hook_client.py" 149 "producer" fn-ref
"src.api_hook_client.get_gui_diagnostics" "src\api_hook_client.py" 311 "producer" fn-ref
"src.app_controller._api_get_performance" "src\app_controller.py" 195 "producer" fn-ref
"src.app_controller._api_get_api_session" "src\app_controller.py" 170 "producer" fn-ref
"src.api_hook_client.get_mma_status" "src\api_hook_client.py" 539 "producer" fn-ref
"src.models.to_dict" "src\models.py" 1000 "producer" fn-ref
"src.models.to_dict" "src\models.py" 672 "producer" fn-ref
"src.models.to_dict" "src\models.py" 355 "producer" fn-ref
"src.aggregate.build_file_items" "src\aggregate.py" 158 "producer" fn-ref
"src.api_hook_client.get_startup_timeline" "src\api_hook_client.py" 353 "producer" fn-ref
"src.api_hook_client.get_node_status" "src\api_hook_client.py" 532 "producer" fn-ref
"src.api_hook_client.get_performance" "src\api_hook_client.py" 318 "producer" fn-ref
"src.ai_client._load_credentials" "src\ai_client.py" 282 "producer" fn-ref
"src.app_controller._api_get_gui_state" "src\app_controller.py" 123 "producer" fn-ref
"src.project_manager.default_project" "src\project_manager.py" 123 "producer" fn-ref
"src.api_hook_client.post_session" "src\api_hook_client.py" 117 "producer" fn-ref
"src.app_controller.get_performance" "src\app_controller.py" 2856 "producer" fn-ref
"src.project_manager.migrate_from_legacy_config" "src\project_manager.py" 253 "producer" fn-ref
"src.models.to_dict" "src\models.py" 486 "producer" fn-ref
"src.models.to_dict" "src\models.py" 913 "producer" fn-ref
"src.models.to_dict" "src\models.py" 596 "producer" fn-ref
"src.api_hook_client.push_event" "src\api_hook_client.py" 156 "producer" fn-ref
"src.api_hook_client.get_warmup_canaries" "src\api_hook_client.py" 342 "producer" fn-ref
"src.api_hook_client.drag" "src\api_hook_client.py" 230 "producer" fn-ref
"src.app_controller.pending_actions" "src\app_controller.py" 2874 "producer" fn-ref
"src.ai_client.get_token_stats" "src\ai_client.py" 3185 "producer" fn-ref
"src.models.to_dict" "src\models.py" 886 "producer" fn-ref
"src.app_controller.status" "src\app_controller.py" 2865 "producer" fn-ref
"src.models.to_dict" "src\models.py" 558 "producer" fn-ref
"src.api_hook_client.apply_patch" "src\api_hook_client.py" 281 "producer" fn-ref
"src.models._load_config_from_disk" "src\models.py" 186 "producer" fn-ref
"src.api_hook_client.post_project" "src\api_hook_client.py" 470 "producer" fn-ref
"src.app_controller._api_get_mma_status" "src\app_controller.py" 144 "producer" fn-ref
"src.api_hook_client.get_patch_status" "src\api_hook_client.py" 295 "producer" fn-ref
"src.app_controller.generate" "src\app_controller.py" 2868 "producer" fn-ref
"src.models.to_dict" "src\models.py" 441 "producer" fn-ref
"src.app_controller.get_api_project" "src\app_controller.py" 2853 "producer" fn-ref
"src.app_controller._api_status" "src\app_controller.py" 209 "producer" fn-ref
"src.project_manager.flat_config" "src\project_manager.py" 267 "producer" fn-ref
"src.models.to_dict" "src\models.py" 1024 "producer" fn-ref
"src.ai_client.ollama_chat" "src\ai_client.py" 2938 "producer" fn-ref
"src.api_hook_client.wait_for_project_switch" "src\api_hook_client.py" 389 "producer" fn-ref
"src.models.to_dict" "src\models.py" 971 "producer" fn-ref
"src.api_hook_client.click" "src\api_hook_client.py" 223 "producer" fn-ref
"src.ai_client.get_comms_log" "src\ai_client.py" 273 "producer" fn-ref
"src.app_controller._api_generate" "src\app_controller.py" 221 "producer" fn-ref
"src.api_hook_client.select_list_item" "src\api_hook_client.py" 256 "producer" fn-ref
"src.models.to_dict" "src\models.py" 288 "producer" fn-ref
"src.api_hook_client.get_project_switch_status" "src\api_hook_client.py" 374 "producer" fn-ref
"src.models.to_dict" "src\models.py" 737 "producer" fn-ref
"src.project_manager.load_project" "src\project_manager.py" 186 "producer" fn-ref
"src.app_controller.get_session" "src\app_controller.py" 2883 "producer" fn-ref
"src.api_hook_client.get_system_telemetry" "src\api_hook_client.py" 524 "producer" fn-ref
"src.models.to_dict" "src\models.py" 618 "producer" fn-ref
"src.api_hook_client._make_request" "src\api_hook_client.py" 65 "producer" fn-ref
"src.app_controller.get_diagnostics" "src\app_controller.py" 2862 "producer" fn-ref
"src.app_controller.get_session_insights" "src\app_controller.py" 3049 "producer" fn-ref
"src.ai_client._content_block_to_dict" "src\ai_client.py" 1200 "producer" fn-ref
"src.api_hook_client.select_tab" "src\api_hook_client.py" 263 "producer" fn-ref
"src.app_controller._pending_mma_approval" "src\app_controller.py" 2776 "producer" fn-ref
"src.ai_client._add_bleed_derived" "src\ai_client.py" 3332 "producer" fn-ref
"src.models.to_dict" "src\models.py" 701 "producer" fn-ref
"src.api_hook_client.right_click" "src\api_hook_client.py" 237 "producer" fn-ref
"src.app_controller.get_api_session" "src\app_controller.py" 2847 "producer" fn-ref
"src.project_manager.default_discussion" "src\project_manager.py" 117 "producer" fn-ref
"src.ai_client._send_cli_round_result" "src\ai_client.py" 1746 "producer" fn-ref
"src.api_hook_client.get_financial_metrics" "src\api_hook_client.py" 520 "producer" fn-ref
\ === consumers (0 items) ===
\ === consumers (66 items) ===
"src.ai_client._invalidate_token_estimate" "src\ai_client.py" 1240 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 920 "consumer" fn-ref
"src.aggregate.build_markdown_from_items" "src\aggregate.py" 348 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 603 "consumer" fn-ref
"src.ai_client._create_gemini_cache_result" "src\ai_client.py" 1706 "consumer" fn-ref
"src.ai_client._send_grok" "src\ai_client.py" 2530 "consumer" fn-ref
"src.ai_client._strip_private_keys" "src\ai_client.py" 1464 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 506 "consumer" fn-ref
"src.ai_client._send_gemini_cli" "src\ai_client.py" 2019 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 814 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 893 "consumer" fn-ref
"src.ai_client._send_gemini" "src\ai_client.py" 1802 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 378 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 1038 "consumer" fn-ref
"src.ai_client._send_anthropic" "src\ai_client.py" 1405 "consumer" fn-ref
"src.project_manager.save_project" "src\project_manager.py" 229 "consumer" fn-ref
"src.ai_client._trim_anthropic_history" "src\ai_client.py" 1353 "consumer" fn-ref
"src.ai_client._send_llama" "src\ai_client.py" 2858 "consumer" fn-ref
"src.aggregate.build_tier3_context" "src\aggregate.py" 382 "consumer" fn-ref
"src.app_controller._offload_entry_payload" "src\app_controller.py" 4240 "consumer" fn-ref
"src.project_manager.format_discussion" "src\project_manager.py" 69 "consumer" fn-ref
"src.project_manager.entry_to_str" "src\project_manager.py" 49 "consumer" fn-ref
"src.ai_client._repair_minimax_history" "src\ai_client.py" 2462 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 1007 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 747 "consumer" fn-ref
"src.ai_client._strip_stale_file_refreshes" "src\ai_client.py" 1253 "consumer" fn-ref
"src.ai_client._send_deepseek" "src\ai_client.py" 2165 "consumer" fn-ref
"src.ai_client._add_bleed_derived" "src\ai_client.py" 3332 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 683 "consumer" fn-ref
"src.aggregate.build_markdown_no_history" "src\aggregate.py" 366 "consumer" fn-ref
"src.project_manager.flat_config" "src\project_manager.py" 267 "consumer" fn-ref
"src.ai_client._send_llama_native" "src\ai_client.py" 2958 "consumer" fn-ref
"src.ai_client.ollama_chat" "src\ai_client.py" 2938 "consumer" fn-ref
"src.ai_client._send_qwen" "src\ai_client.py" 2773 "consumer" fn-ref
"src.app_controller._on_comms_entry" "src\app_controller.py" 4282 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 712 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 866 "consumer" fn-ref
"src.ai_client._repair_deepseek_history" "src\ai_client.py" 2138 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 454 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 575 "consumer" fn-ref
"src.ai_client._execute_single_tool_call_async" "src\ai_client.py" 945 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 630 "consumer" fn-ref
"src.ai_client._repair_anthropic_history" "src\ai_client.py" 1381 "consumer" fn-ref
"src.ai_client._strip_cache_controls" "src\ai_client.py" 1291 "consumer" fn-ref
"src.aggregate.run" "src\aggregate.py" 479 "consumer" fn-ref
"src.models._save_config_to_disk" "src\models.py" 199 "consumer" fn-ref
"src.ai_client._dashscope_call" "src\ai_client.py" 2716 "consumer" fn-ref
"src.app_controller._start_track_logic_result" "src\app_controller.py" 4728 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 949 "consumer" fn-ref
"src.ai_client._estimate_prompt_tokens" "src\ai_client.py" 1243 "consumer" fn-ref
"src.ai_client._append_comms" "src\ai_client.py" 257 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 982 "consumer" fn-ref
"src.ai_client._estimate_message_tokens" "src\ai_client.py" 1218 "consumer" fn-ref
"src.ai_client._add_history_cache_breakpoint" "src\ai_client.py" 1299 "consumer" fn-ref
"src.ai_client._pre_dispatch" "src\ai_client.py" 2089 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 295 "consumer" fn-ref
"src.aggregate._build_files_section_from_items" "src\aggregate.py" 300 "consumer" fn-ref
"src.ai_client._trim_minimax_history" "src\ai_client.py" 2482 "consumer" fn-ref
"src.app_controller._refresh_api_metrics" "src\app_controller.py" 3074 "consumer" fn-ref
"src.app_controller._start_track_logic" "src\app_controller.py" 4721 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 416 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 656 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 1072 "consumer" fn-ref
"src.project_manager.migrate_from_legacy_config" "src\project_manager.py" 253 "consumer" fn-ref
"src.ai_client._send_minimax" "src\ai_client.py" 2616 "consumer" fn-ref
"src.ai_client.send" "src\ai_client.py" 3208 "consumer" fn-ref
\ === access_pattern ===
"mixed" access-pattern
"whole_struct" access-pattern
\ === access_pattern_evidence (0 items) ===
\ === access_pattern_evidence (50 items) ===
"src.ai_client._invalidate_token_estimate" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.aggregate.build_markdown_from_items" "whole_struct" 0 "low" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._create_gemini_cache_result" "whole_struct" 0 "low" ap-evidence
"src.ai_client._send_grok" "whole_struct" 0 "low" ap-evidence
"src.ai_client._strip_private_keys" "whole_struct" 0 "low" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._send_gemini_cli" "whole_struct" 0 "low" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._send_gemini" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._send_anthropic" "whole_struct" 0 "low" ap-evidence
"src.project_manager.save_project" "mixed" 2 "high" ap-evidence
"src.ai_client._trim_anthropic_history" "whole_struct" 1 "high" ap-evidence
"src.ai_client._send_llama" "whole_struct" 0 "low" ap-evidence
"src.aggregate.build_tier3_context" "whole_struct" 0 "low" ap-evidence
"src.app_controller._offload_entry_payload" "whole_struct" 0 "low" ap-evidence
"src.project_manager.format_discussion" "whole_struct" 0 "low" ap-evidence
"src.project_manager.entry_to_str" "whole_struct" 1 "high" ap-evidence
"src.ai_client._repair_minimax_history" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._strip_stale_file_refreshes" "whole_struct" 0 "low" ap-evidence
"src.ai_client._send_deepseek" "whole_struct" 0 "low" ap-evidence
"src.ai_client._add_bleed_derived" "field_by_field" 9 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.aggregate.build_markdown_no_history" "whole_struct" 0 "low" ap-evidence
"src.project_manager.flat_config" "whole_struct" 1 "high" ap-evidence
"src.ai_client._send_llama_native" "whole_struct" 0 "low" ap-evidence
"src.ai_client.ollama_chat" "whole_struct" 0 "low" ap-evidence
"src.ai_client._send_qwen" "whole_struct" 0 "low" ap-evidence
"src.app_controller._on_comms_entry" "field_by_field" 10 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._repair_deepseek_history" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._execute_single_tool_call_async" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._repair_anthropic_history" "whole_struct" 1 "high" ap-evidence
"src.ai_client._strip_cache_controls" "whole_struct" 0 "low" ap-evidence
"src.aggregate.run" "field_by_field" 3 "high" ap-evidence
"src.models._save_config_to_disk" "whole_struct" 0 "low" ap-evidence
"src.ai_client._dashscope_call" "whole_struct" 0 "low" ap-evidence
"src.app_controller._start_track_logic_result" "field_by_field" 17 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._estimate_prompt_tokens" "whole_struct" 0 "low" ap-evidence
\ === frequency ===
"per_turn" frequency
\ === frequency_evidence (0 items) ===
\ === frequency_evidence (5 items) ===
"src.ai_client._extract_dashscope_tool_calls" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.api_hook_client.get_warmup_wait" "per_turn" "static_analysis" "producer from src\api_hook_client.py" freq-evidence
"src.app_controller.wait" "per_turn" "static_analysis" "producer from src\app_controller.py" freq-evidence
"src.ai_client._dashscope_call" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.app_controller._pending_mma_spawn" "per_turn" "static_analysis" "producer from src\app_controller.py" freq-evidence
\ === result_coverage ===
0 0 0 0 result-coverage
96 96 46 0 result-coverage
\ === type_alias_coverage ===
0 0 0 type-alias-coverage
135 0 135 type-alias-coverage
\ === cross_audit_findings ===
5 cross-audit-findings
\ === decomposition_cost ===
470 0 0 "insufficient_data" "FileItem: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern." nil 5 true decomp-cost
470 0 70 "hold" "FileItem: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern." nil 5 true decomp-cost
\ === optimization_candidates (0 items) ===
@@ -6,74 +6,419 @@
## Pipeline summary
- Producers: 0
- Consumers: 0
- Distinct producer fqnames: 0
- Distinct consumer fqnames: 0
- Access pattern (aggregate): mixed
- Producers: 117
- Consumers: 66
- Distinct producer fqnames: 96
- Distinct consumer fqnames: 46
- Access pattern (aggregate): whole_struct
- Frequency (aggregate): per_turn
- Decomposition direction: insufficient_data
- Decomposition direction: hold
- Struct field count (estimated): 5
## Producers (0)
## Producers (117)
_(none)_
### `src\aggregate.py` (1 producer)
## Consumers (0)
- `src.aggregate.build_file_items` (line 158)
_(none)_
### `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._add_bleed_derived` (line 3332)
- `src.ai_client._send_cli_round_result` (line 1746)
### `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_gui_health` (line 434)
- `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.right_click` (line 237)
- `src.api_hook_client.get_financial_metrics` (line 520)
### `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\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 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 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 618)
- `src.models.to_dict` (line 701)
### `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.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)
## 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\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._pre_dispatch` (line 2089)
- `src.ai_client._trim_minimax_history` (line 2482)
- `src.ai_client._send_minimax` (line 2616)
- `src.ai_client.send` (line 3208)
### `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._refresh_api_metrics` (line 3074)
- `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._save_config_to_disk` (line 199)
- `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\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.migrate_from_legacy_config` (line 253)
## Field access matrix
_(no field accesses detected)_
| 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| `_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 | . | . | . | . | . | . |
| `_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` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
_... 23 more fields_
## Access pattern
**Dominant pattern:** mixed
**Evidence count:** 0
**Dominant pattern:** whole_struct
**Evidence count:** 50
**Per-function pattern distribution:**
- `whole_struct`: 28 functions (56%)
- `mixed`: 18 functions (36%)
- `field_by_field`: 4 functions (8%)
## SSDL Sketch for `FileItem`
```
[Q:FileItem entry-point] -> [Q:PCG lookup]
-> [1: _invalidate_token_estimate] [B:check] (branches=0)
-> [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]
-> [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)
-> [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)
-> [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: _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)
-> [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)
-> [T:done]
```
**Effective codepaths:** 0 (sum of 2^branches across 0 consumers)
**Total branch points:** 0
**Nil-check functions:** 0
**Effective codepaths:** 40140116231395706750390 (sum of 2^branches across 66 consumers)
**Total branch points:** 541
**Nil-check functions:** 9
**Defusing opportunities:**
- **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 0 field-check branches to 1 cache lookup.
- Effective codepaths: 0 -> 1
- **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
- **Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`**: Wrap the aggregate in a generational handle (index + generation). Validation is one comparison; mismatch returns the nil sentinel. Reduces N lifetime branches to 1 handle validation + sentinel return.
- Effective codepaths: 40140116231395706750390 -> 66
## Frequency
**Dominant frequency:** per_turn
**Evidence count:** 0
**Evidence count:** 5
**Per-function frequency distribution:**
- `per_turn`: 5 functions
## Result coverage
**Summary:** 0 producers, 0 consumers
**Summary:** 96 producers, 46 consumers
| metric | value |
|---|---|
| total producers | 0 |
| result producers | 0 |
| total consumers | 0 |
| total producers | 96 |
| result producers | 96 |
| total consumers | 46 |
| result consumers | 0 |
## Type alias coverage
**Summary:** 0 sites
**Summary:** 135 sites; 0 typed (0%); 135 untyped (100%)
| metric | value |
|---|---|
| total field-access sites | 0 |
| total field-access sites | 135 |
| typed sites (canonical field) | 0 |
| untyped sites (wildcard) | 0 |
| untyped sites (wildcard) | 135 |
## Cross-audit findings
@@ -83,15 +428,59 @@ _(no cross-audit findings mapped to this aggregate)_
**Current cost estimate:** 470 us/turn
**Componentize savings:** 0 us/turn
**Unify savings:** 0 us/turn
**Recommended direction:** insufficient_data
**Rationale:** FileItem: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern.
**Unify savings:** 70 us/turn
**Recommended direction:** hold
**Rationale:** FileItem: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern.
**Struct field count (estimated):** 5
**Struct frozen:** True
## Struct shape (inferred from producer returns)
_(no producers; cannot infer shape)_
| 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 |
| `estimated_prompt_tokens` | 1 | used |
| `max_prompt_tokens` | 1 | used |
| `utilization_pct` | 1 | used |
| `headroom` | 1 | used |
| `would_trim` | 1 | used |
| `sys_tokens` | 1 | used |
| `tool_tokens` | 1 | used |
| `history_tokens` | 1 | used |
| `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 |
| `_topological_sort_tickets_result` | 1 | used |
| `active_project_root` | 1 | used |
| `event_queue` | 1 | used |
| `engines` | 1 | used |
| `project` | 1 | used |
| `active_discussion` | 1 | used |
| `submit_io` | 1 | used |
| `tracks` | 1 | used |
| `config` | 1 | used |
| `mma_tier_usage` | 1 | used |
| `_pending_gui_tasks` | 1 | used |
| `mma_step_mode` | 1 | used |
| `active_project_path` | 1 | used |
## Optimization candidates
@@ -99,6 +488,71 @@ _(no optimization candidates generated)_
## Verdict
FileItem: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern.
FileItem: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern.
## Evidence appendix
### Access pattern evidence
| function | pattern | field_accesses | confidence |
|---|---|---|---|
| `src.ai_client._invalidate_token_estimate` | `whole_struct` | `pop`=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.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.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.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 |
### 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 |
@@ -1,12 +1,195 @@
Metadata: FileItem
|- kind: typealias
|- memory_dim: curation
|- producers: [0]
|- consumers: [0]
|- access_pattern: mixed
|- producers: [117]
| |- src.ai_client._extract_dashscope_tool_calls (producer)
| |- src.api_hook_client.get_warmup_wait (producer)
| |- src.app_controller.wait (producer)
| |- src.ai_client._dashscope_call (producer)
| |- src.app_controller._pending_mma_spawn (producer)
| |- src.api_hook_client.wait_for_event (producer)
| |- src.api_hook_client.clear_events (producer)
| |- src.project_manager.get_all_tracks (producer)
| |- src.app_controller._offload_entry_payload (producer)
| |- src.ai_client._strip_private_keys (producer)
| |- src.app_controller._api_get_diagnostics (producer)
| |- src.app_controller.get_gui_state (producer)
| |- src.app_controller.load_config (producer)
| |- src.api_hook_client.get_warmup_status (producer)
| |- src.api_hook_client.get_project (producer)
| |- src.api_hook_client.get_mma_workers (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.reject_patch (producer)
| |- src.models.to_dict (producer)
| |- src.app_controller._api_get_session (producer)
| |- src.ai_client._parse_tool_args_result (producer)
| |- src.app_controller._api_pending_actions (producer)
| |- src.models.to_dict (producer)
| |- src.project_manager.load_history (producer)
| |- src.app_controller.get_context (producer)
| |- src.ai_client._build_chunked_context_blocks (producer)
| |- src.ai_client._get_anthropic_tools (producer)
| |- src.api_hook_client.get_gui_state (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.ai_client._get_deepseek_tools (producer)
| |- src.models.parse_history_entries (producer)
| |- src.api_hook_client.get_events (producer)
| |- src.ai_client._pre_dispatch (producer)
| |- src.project_manager.str_to_entry (producer)
| |- src.api_hook_client.post_project (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.get_session (producer)
| |- src.app_controller.token_stats (producer)
| |- src.api_hook_client.get_io_pool_status (producer)
| |- src.api_hook_client.trigger_patch (producer)
| |- src.api_hook_client.get_gui_health (producer)
| |- src.ai_client.get_gemini_cache_stats (producer)
| |- src.app_controller._api_get_api_project (producer)
| |- src.api_hook_client.get_status (producer)
| |- src.app_controller._api_get_context (producer)
| |- src.app_controller._api_token_stats (producer)
| |- src.api_hook_client.get_context_state (producer)
| |- src.api_hook_client.set_value (producer)
| |- src.app_controller.get_mma_status (producer)
| |- src.api_hook_client.post_gui (producer)
| |- src.api_hook_client.get_gui_diagnostics (producer)
| |- src.app_controller._api_get_performance (producer)
| |- src.app_controller._api_get_api_session (producer)
| |- src.api_hook_client.get_mma_status (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.aggregate.build_file_items (producer)
| |- src.api_hook_client.get_startup_timeline (producer)
| |- src.api_hook_client.get_node_status (producer)
| |- src.api_hook_client.get_performance (producer)
| |- src.ai_client._load_credentials (producer)
| |- src.app_controller._api_get_gui_state (producer)
| |- src.project_manager.default_project (producer)
| |- src.api_hook_client.post_session (producer)
| |- src.app_controller.get_performance (producer)
| |- src.project_manager.migrate_from_legacy_config (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.push_event (producer)
| |- src.api_hook_client.get_warmup_canaries (producer)
| |- src.api_hook_client.drag (producer)
| |- src.app_controller.pending_actions (producer)
| |- src.ai_client.get_token_stats (producer)
| |- src.models.to_dict (producer)
| |- src.app_controller.status (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.apply_patch (producer)
| |- src.models._load_config_from_disk (producer)
| |- src.api_hook_client.post_project (producer)
| |- src.app_controller._api_get_mma_status (producer)
| |- src.api_hook_client.get_patch_status (producer)
| |- src.app_controller.generate (producer)
| |- src.models.to_dict (producer)
| |- src.app_controller.get_api_project (producer)
| |- src.app_controller._api_status (producer)
| |- src.project_manager.flat_config (producer)
| |- src.models.to_dict (producer)
| |- src.ai_client.ollama_chat (producer)
| |- src.api_hook_client.wait_for_project_switch (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.click (producer)
| |- src.ai_client.get_comms_log (producer)
| |- src.app_controller._api_generate (producer)
| |- src.api_hook_client.select_list_item (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.get_project_switch_status (producer)
| |- src.models.to_dict (producer)
| |- src.project_manager.load_project (producer)
| |- src.app_controller.get_session (producer)
| |- src.api_hook_client.get_system_telemetry (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client._make_request (producer)
| |- src.app_controller.get_diagnostics (producer)
| |- src.app_controller.get_session_insights (producer)
| |- src.ai_client._content_block_to_dict (producer)
| |- src.api_hook_client.select_tab (producer)
| |- src.app_controller._pending_mma_approval (producer)
| |- src.ai_client._add_bleed_derived (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.right_click (producer)
| |- src.app_controller.get_api_session (producer)
| |- src.project_manager.default_discussion (producer)
| |- src.ai_client._send_cli_round_result (producer)
| |- src.api_hook_client.get_financial_metrics (producer)
|- consumers: [66]
| |- src.ai_client._invalidate_token_estimate (consumer)
| |- src.models.from_dict (consumer)
| |- src.aggregate.build_markdown_from_items (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._create_gemini_cache_result (consumer)
| |- src.ai_client._send_grok (consumer)
| |- src.ai_client._strip_private_keys (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._send_gemini_cli (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._send_gemini (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._send_anthropic (consumer)
| |- src.project_manager.save_project (consumer)
| |- src.ai_client._trim_anthropic_history (consumer)
| |- src.ai_client._send_llama (consumer)
| |- src.aggregate.build_tier3_context (consumer)
| |- src.app_controller._offload_entry_payload (consumer)
| |- src.project_manager.format_discussion (consumer)
| |- src.project_manager.entry_to_str (consumer)
| |- src.ai_client._repair_minimax_history (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._strip_stale_file_refreshes (consumer)
| |- src.ai_client._send_deepseek (consumer)
| |- src.ai_client._add_bleed_derived (consumer)
| |- src.models.from_dict (consumer)
| |- src.aggregate.build_markdown_no_history (consumer)
| |- src.project_manager.flat_config (consumer)
| |- src.ai_client._send_llama_native (consumer)
| |- src.ai_client.ollama_chat (consumer)
| |- src.ai_client._send_qwen (consumer)
| |- src.app_controller._on_comms_entry (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._repair_deepseek_history (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._execute_single_tool_call_async (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._repair_anthropic_history (consumer)
| |- src.ai_client._strip_cache_controls (consumer)
| |- src.aggregate.run (consumer)
| |- src.models._save_config_to_disk (consumer)
| |- src.ai_client._dashscope_call (consumer)
| |- src.app_controller._start_track_logic_result (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._estimate_prompt_tokens (consumer)
| |- src.ai_client._append_comms (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._estimate_message_tokens (consumer)
| |- src.ai_client._add_history_cache_breakpoint (consumer)
| |- src.ai_client._pre_dispatch (consumer)
| |- src.models.from_dict (consumer)
| |- src.aggregate._build_files_section_from_items (consumer)
| |- src.ai_client._trim_minimax_history (consumer)
| |- src.app_controller._refresh_api_metrics (consumer)
| |- src.app_controller._start_track_logic (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.project_manager.migrate_from_legacy_config (consumer)
| |- src.ai_client._send_minimax (consumer)
| |- src.ai_client.send (consumer)
|- access_pattern: whole_struct
|- frequency: per_turn
|- result_coverage: 0 producers, 0 consumers
|- type_alias_coverage: 0 sites
|- result_coverage: 96 producers, 46 consumers
|- type_alias_coverage: 135 sites; 0 typed (0%); 135 untyped (100%)
|- cross_audit_findings: 0 findings
|- decomposition_cost: insufficient_data (470 us)
|- decomposition_cost: hold (470 us)
|- optimization_candidates: [0]
@@ -7,33 +7,54 @@
\ === memory_dim ===
"curation" mem-dim
\ === producers (0 items) ===
\ === producers (6 items) ===
"src.gui_2._render_beads_tab_list_result" "src\gui_2.py" 8314 "producer" fn-ref
"src.gui_2._drain_normalize_errors" "src\gui_2.py" 7417 "producer" fn-ref
"src.ai_client._list_gemini_models_result" "src\ai_client.py" 1626 "producer" fn-ref
"src.ai_client._list_anthropic_models_result" "src\ai_client.py" 1317 "producer" fn-ref
"src.ai_client._list_minimax_models_result" "src\ai_client.py" 2436 "producer" fn-ref
"src.ai_client._set_minimax_provider_result" "src\ai_client.py" 398 "producer" fn-ref
\ === consumers (4 items) ===
"src.ai_client._build_file_diff_text" "src\ai_client.py" 1105 "consumer" fn-ref
"src.ai_client.run_with_tool_loop" "src\ai_client.py" 833 "consumer" fn-ref
\ === consumers (9 items) ===
"src.app_controller._symbol_resolution_result" "src\app_controller.py" 3506 "consumer" fn-ref
"src.app_controller._topological_sort_tickets_result" "src\app_controller.py" 4708 "consumer" fn-ref
"src.ai_client._build_file_context_text" "src\ai_client.py" 1092 "consumer" fn-ref
"src.ai_client._reread_file_items_result" "src\ai_client.py" 1056 "consumer" fn-ref
"src.ai_client._build_file_diff_text" "src\ai_client.py" 1105 "consumer" fn-ref
"src.gui_2.__init__" "src\gui_2.py" 7550 "consumer" fn-ref
"src.app_controller._serialize_tool_calls_result" "src\app_controller.py" 2217 "consumer" fn-ref
"src.project_manager.calculate_track_progress" "src\project_manager.py" 420 "consumer" fn-ref
"src.ai_client.run_with_tool_loop" "src\ai_client.py" 833 "consumer" fn-ref
\ === access_pattern ===
"whole_struct" access-pattern
\ === access_pattern_evidence (4 items) ===
"src.ai_client._build_file_diff_text" "whole_struct" 0 "low" ap-evidence
"src.ai_client.run_with_tool_loop" "whole_struct" 1 "high" ap-evidence
\ === access_pattern_evidence (9 items) ===
"src.app_controller._symbol_resolution_result" "whole_struct" 0 "low" ap-evidence
"src.app_controller._topological_sort_tickets_result" "whole_struct" 1 "high" ap-evidence
"src.ai_client._build_file_context_text" "whole_struct" 0 "low" ap-evidence
"src.ai_client._reread_file_items_result" "whole_struct" 0 "low" ap-evidence
"src.ai_client._build_file_diff_text" "whole_struct" 0 "low" ap-evidence
"src.gui_2.__init__" "field_by_field" 3 "high" ap-evidence
"src.app_controller._serialize_tool_calls_result" "whole_struct" 0 "low" ap-evidence
"src.project_manager.calculate_track_progress" "whole_struct" 0 "low" ap-evidence
"src.ai_client.run_with_tool_loop" "whole_struct" 1 "high" ap-evidence
\ === frequency ===
"per_turn" frequency
\ === frequency_evidence (0 items) ===
\ === frequency_evidence (5 items) ===
"src.gui_2._render_beads_tab_list_result" "per_turn" "static_analysis" "producer from src\gui_2.py" freq-evidence
"src.gui_2._drain_normalize_errors" "per_turn" "static_analysis" "producer from src\gui_2.py" freq-evidence
"src.ai_client._list_gemini_models_result" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.ai_client._list_anthropic_models_result" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.ai_client._list_minimax_models_result" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
\ === result_coverage ===
0 0 4 0 result-coverage
6 6 9 0 result-coverage
\ === type_alias_coverage ===
2 0 2 type-alias-coverage
6 0 6 type-alias-coverage
\ === cross_audit_findings ===
5 cross-audit-findings
@@ -6,96 +6,135 @@
## Pipeline summary
- Producers: 0
- Consumers: 4
- Distinct producer fqnames: 0
- Distinct consumer fqnames: 4
- Producers: 6
- Consumers: 9
- Distinct producer fqnames: 6
- Distinct consumer fqnames: 9
- Access pattern (aggregate): whole_struct
- Frequency (aggregate): per_turn
- Decomposition direction: hold
- Struct field count (estimated): 5
## Producers (0)
## Producers (6)
_(none)_
### `src\ai_client.py` (4 producers)
## Consumers (4)
- `src.ai_client._list_gemini_models_result` (line 1626)
- `src.ai_client._list_anthropic_models_result` (line 1317)
- `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)
## Consumers (9)
### `src\ai_client.py` (4 consumers)
- `src.ai_client._build_file_diff_text` (line 1105)
- `src.ai_client.run_with_tool_loop` (line 833)
- `src.ai_client._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\app_controller.py` (3 consumers)
- `src.app_controller._symbol_resolution_result` (line 3506)
- `src.app_controller._topological_sort_tickets_result` (line 4708)
- `src.app_controller._serialize_tool_calls_result` (line 2217)
### `src\gui_2.py` (1 consumer)
- `src.gui_2.__init__` (line 7550)
### `src\project_manager.py` (1 consumer)
- `src.project_manager.calculate_track_progress` (line 420)
## Field access matrix
| consumer | append |
|---|---|
| `_build_file_diff_text` | . |
| `run_with_tool_loop` | 2 |
| `_build_file_context_text` | . |
| `_reread_file_items_result` | . |
| 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` | . | . | . | . | . |
| `run_with_tool_loop` | . | . | . | . | 2 |
## Access pattern
**Dominant pattern:** whole_struct
**Evidence count:** 4
**Evidence count:** 9
**Per-function pattern distribution:**
- `whole_struct`: 4 functions (100%)
- `whole_struct`: 8 functions (89%)
- `field_by_field`: 1 functions (11%)
## SSDL Sketch for `FileItems`
```
[Q:FileItems entry-point] -> [Q:PCG lookup]
-> [1: _build_file_diff_text] [B:check] (branches=6)
-> [2: run_with_tool_loop] [B:is None?] (branches=23) [N:safe]
-> [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)
-> [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]
-> [T:done]
```
**Effective codepaths:** 8388712 (sum of 2^branches across 4 consumers)
**Total branch points:** 37
**Effective codepaths:** 8388739 (sum of 2^branches across 9 consumers)
**Total branch points:** 46
**Nil-check functions:** 2
**Defusing opportunities:**
- **Nil Sentinel `[N]`**: Introduce a module-level `NIL_<AGGREGATE>` sentinel whose field accesses return safe defaults. Replace None checks with the sentinel. Collapses 2^branch_count into ~1.
- Effective codepaths: 8388712 -> 8388708
- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `fileitems_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 2 field-check branches to 1 cache lookup.
- Effective codepaths: 8388712 -> 2
- Effective codepaths: 8388739 -> 8388735
- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `fileitems_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 6 field-check branches to 1 cache lookup.
- Effective codepaths: 8388739 -> 6
- **Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`**: Wrap the aggregate in a generational handle (index + generation). Validation is one comparison; mismatch returns the nil sentinel. Reduces N lifetime branches to 1 handle validation + sentinel return.
- Effective codepaths: 8388712 -> 4
- Effective codepaths: 8388739 -> 9
## Frequency
**Dominant frequency:** per_turn
**Evidence count:** 0
**Evidence count:** 5
**Per-function frequency distribution:**
- `per_turn`: 5 functions
## Result coverage
**Summary:** 0 producers, 4 consumers
**Summary:** 6 producers, 9 consumers
| metric | value |
|---|---|
| total producers | 0 |
| result producers | 0 |
| total consumers | 4 |
| total producers | 6 |
| result producers | 6 |
| total consumers | 9 |
| result consumers | 0 |
## Type alias coverage
**Summary:** 2 sites; 0 typed (0%); 2 untyped (100%)
**Summary:** 6 sites; 0 typed (0%); 6 untyped (100%)
| metric | value |
|---|---|
| total field-access sites | 2 |
| total field-access sites | 6 |
| typed sites (canonical field) | 0 |
| untyped sites (wildcard) | 2 |
| untyped sites (wildcard) | 6 |
## Cross-audit findings
@@ -113,7 +152,13 @@ _(no cross-audit findings mapped to this aggregate)_
## Struct shape (inferred from producer returns)
_(no producers; cannot infer shape)_
| field | access count | access pattern |
|---|---|---|
| `_report_worker_error` | 1 | used |
| `_module_name` | 1 | used |
| `_attr_name` | 1 | used |
| `_cached` | 1 | used |
| `append` | 1 | used |
## Optimization candidates
@@ -129,7 +174,22 @@ FileItems: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5
| function | pattern | field_accesses | confidence |
|---|---|---|---|
| `src.ai_client._build_file_diff_text` | `whole_struct` | | low |
| `src.ai_client.run_with_tool_loop` | `whole_struct` | `append`=2 | 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.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.run_with_tool_loop` | `whole_struct` | `append`=2 | high |
### 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_minimax_models_result` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
@@ -1,16 +1,27 @@
Metadata: FileItems
|- kind: typealias
|- memory_dim: curation
|- producers: [0]
|- consumers: [4]
| |- src.ai_client._build_file_diff_text (consumer)
| |- src.ai_client.run_with_tool_loop (consumer)
|- producers: [6]
| |- src.gui_2._render_beads_tab_list_result (producer)
| |- src.gui_2._drain_normalize_errors (producer)
| |- src.ai_client._list_gemini_models_result (producer)
| |- src.ai_client._list_anthropic_models_result (producer)
| |- src.ai_client._list_minimax_models_result (producer)
| |- src.ai_client._set_minimax_provider_result (producer)
|- consumers: [9]
| |- src.app_controller._symbol_resolution_result (consumer)
| |- src.app_controller._topological_sort_tickets_result (consumer)
| |- src.ai_client._build_file_context_text (consumer)
| |- src.ai_client._reread_file_items_result (consumer)
| |- src.ai_client._build_file_diff_text (consumer)
| |- src.gui_2.__init__ (consumer)
| |- src.app_controller._serialize_tool_calls_result (consumer)
| |- src.project_manager.calculate_track_progress (consumer)
| |- src.ai_client.run_with_tool_loop (consumer)
|- access_pattern: whole_struct
|- frequency: per_turn
|- result_coverage: 0 producers, 4 consumers
|- type_alias_coverage: 2 sites; 0 typed (0%); 2 untyped (100%)
|- result_coverage: 6 producers, 9 consumers
|- type_alias_coverage: 6 sites; 0 typed (0%); 6 untyped (100%)
|- cross_audit_findings: 0 findings
|- decomposition_cost: hold (470 us)
|- optimization_candidates: [0]
@@ -7,31 +7,57 @@
\ === memory_dim ===
"discussion" mem-dim
\ === producers (0 items) ===
\ === producers (7 items) ===
"src.gui_2._render_beads_tab_list_result" "src\gui_2.py" 8314 "producer" fn-ref
"src.gui_2._drain_normalize_errors" "src\gui_2.py" 7417 "producer" fn-ref
"src.ai_client._list_gemini_models_result" "src\ai_client.py" 1626 "producer" fn-ref
"src.provider_state.get_all" "src\provider_state.py" 34 "producer" fn-ref
"src.ai_client._list_anthropic_models_result" "src\ai_client.py" 1317 "producer" fn-ref
"src.ai_client._list_minimax_models_result" "src\ai_client.py" 2436 "producer" fn-ref
"src.ai_client._set_minimax_provider_result" "src\ai_client.py" 398 "producer" fn-ref
\ === consumers (0 items) ===
\ === consumers (7 items) ===
"src.provider_state.append" "src\provider_state.py" 30 "consumer" fn-ref
"src.app_controller._symbol_resolution_result" "src\app_controller.py" 3506 "consumer" fn-ref
"src.app_controller._topological_sort_tickets_result" "src\app_controller.py" 4708 "consumer" fn-ref
"src.provider_state.replace_all" "src\provider_state.py" 38 "consumer" fn-ref
"src.gui_2.__init__" "src\gui_2.py" 7550 "consumer" fn-ref
"src.app_controller._serialize_tool_calls_result" "src\app_controller.py" 2217 "consumer" fn-ref
"src.project_manager.calculate_track_progress" "src\project_manager.py" 420 "consumer" fn-ref
\ === access_pattern ===
"mixed" access-pattern
"whole_struct" access-pattern
\ === access_pattern_evidence (0 items) ===
\ === access_pattern_evidence (7 items) ===
"src.provider_state.append" "mixed" 2 "high" ap-evidence
"src.app_controller._symbol_resolution_result" "whole_struct" 0 "low" ap-evidence
"src.app_controller._topological_sort_tickets_result" "whole_struct" 1 "high" ap-evidence
"src.provider_state.replace_all" "mixed" 2 "high" ap-evidence
"src.gui_2.__init__" "field_by_field" 3 "high" ap-evidence
"src.app_controller._serialize_tool_calls_result" "whole_struct" 0 "low" ap-evidence
"src.project_manager.calculate_track_progress" "whole_struct" 0 "low" ap-evidence
\ === frequency ===
"per_turn" frequency
\ === frequency_evidence (0 items) ===
\ === frequency_evidence (5 items) ===
"src.gui_2._render_beads_tab_list_result" "per_turn" "static_analysis" "producer from src\gui_2.py" freq-evidence
"src.gui_2._drain_normalize_errors" "per_turn" "static_analysis" "producer from src\gui_2.py" freq-evidence
"src.ai_client._list_gemini_models_result" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.provider_state.get_all" "per_turn" "static_analysis" "producer from src\provider_state.py" freq-evidence
"src.ai_client._list_anthropic_models_result" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
\ === result_coverage ===
0 0 0 0 result-coverage
7 7 7 0 result-coverage
\ === type_alias_coverage ===
0 0 0 type-alias-coverage
8 0 8 type-alias-coverage
\ === cross_audit_findings ===
5 cross-audit-findings
\ === decomposition_cost ===
470 0 0 "insufficient_data" "History: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern." nil 5 true decomp-cost
470 0 70 "hold" "History: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern." nil 5 true decomp-cost
\ === optimization_candidates (0 items) ===
@@ -6,74 +6,130 @@
## Pipeline summary
- Producers: 0
- Consumers: 0
- Distinct producer fqnames: 0
- Distinct consumer fqnames: 0
- Access pattern (aggregate): mixed
- Producers: 7
- Consumers: 7
- Distinct producer fqnames: 7
- Distinct consumer fqnames: 7
- Access pattern (aggregate): whole_struct
- Frequency (aggregate): per_turn
- Decomposition direction: insufficient_data
- Decomposition direction: hold
- Struct field count (estimated): 5
## Producers (0)
## Producers (7)
_(none)_
### `src\ai_client.py` (4 producers)
## Consumers (0)
- `src.ai_client._list_gemini_models_result` (line 1626)
- `src.ai_client._list_anthropic_models_result` (line 1317)
- `src.ai_client._list_minimax_models_result` (line 2436)
- `src.ai_client._set_minimax_provider_result` (line 398)
_(none)_
### `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\provider_state.py` (1 producer)
- `src.provider_state.get_all` (line 34)
## Consumers (7)
### `src\app_controller.py` (3 consumers)
- `src.app_controller._symbol_resolution_result` (line 3506)
- `src.app_controller._topological_sort_tickets_result` (line 4708)
- `src.app_controller._serialize_tool_calls_result` (line 2217)
### `src\gui_2.py` (1 consumer)
- `src.gui_2.__init__` (line 7550)
### `src\project_manager.py` (1 consumer)
- `src.project_manager.calculate_track_progress` (line 420)
### `src\provider_state.py` (2 consumers)
- `src.provider_state.append` (line 30)
- `src.provider_state.replace_all` (line 38)
## Field access matrix
_(no field accesses detected)_
| 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` | . | . | . | . | . | . |
| `calculate_track_progress` | . | . | . | . | . | . |
## Access pattern
**Dominant pattern:** mixed
**Evidence count:** 0
**Dominant pattern:** whole_struct
**Evidence count:** 7
**Per-function pattern distribution:**
- `whole_struct`: 4 functions (57%)
- `mixed`: 2 functions (29%)
- `field_by_field`: 1 functions (14%)
## SSDL Sketch for `History`
```
[Q:History entry-point] -> [Q:PCG lookup]
-> [1: 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)
-> [T:done]
```
**Effective codepaths:** 0 (sum of 2^branches across 0 consumers)
**Total branch points:** 0
**Effective codepaths:** 31 (sum of 2^branches across 7 consumers)
**Total branch points:** 11
**Nil-check functions:** 0
**Defusing opportunities:**
- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `history_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 0 field-check branches to 1 cache lookup.
- Effective codepaths: 0 -> 1
- **Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`**: Introduce a `history_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 8 field-check branches to 1 cache lookup.
- Effective codepaths: 31 -> 8
## Frequency
**Dominant frequency:** per_turn
**Evidence count:** 0
**Evidence count:** 5
**Per-function frequency distribution:**
- `per_turn`: 5 functions
## Result coverage
**Summary:** 0 producers, 0 consumers
**Summary:** 7 producers, 7 consumers
| metric | value |
|---|---|
| total producers | 0 |
| result producers | 0 |
| total consumers | 0 |
| total producers | 7 |
| result producers | 7 |
| total consumers | 7 |
| result consumers | 0 |
## Type alias coverage
**Summary:** 0 sites
**Summary:** 8 sites; 0 typed (0%); 8 untyped (100%)
| metric | value |
|---|---|
| total field-access sites | 0 |
| total field-access sites | 8 |
| typed sites (canonical field) | 0 |
| untyped sites (wildcard) | 0 |
| untyped sites (wildcard) | 8 |
## Cross-audit findings
@@ -83,15 +139,22 @@ _(no cross-audit findings mapped to this aggregate)_
**Current cost estimate:** 470 us/turn
**Componentize savings:** 0 us/turn
**Unify savings:** 0 us/turn
**Recommended direction:** insufficient_data
**Rationale:** History: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern.
**Unify savings:** 70 us/turn
**Recommended direction:** hold
**Rationale:** History: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern.
**Struct field count (estimated):** 5
**Struct frozen:** True
## Struct shape (inferred from producer returns)
_(no producers; cannot infer shape)_
| field | access count | access pattern |
|---|---|---|
| `lock` | 2 | used |
| `messages` | 2 | used |
| `_report_worker_error` | 1 | used |
| `_module_name` | 1 | used |
| `_attr_name` | 1 | used |
| `_cached` | 1 | used |
## Optimization candidates
@@ -99,6 +162,28 @@ _(no optimization candidates generated)_
## Verdict
History: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern.
History: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern.
## Evidence appendix
### Access pattern evidence
| function | pattern | field_accesses | confidence |
|---|---|---|---|
| `src.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.project_manager.calculate_track_progress` | `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 |
@@ -1,12 +1,26 @@
Metadata: History
|- kind: typealias
|- memory_dim: discussion
|- producers: [0]
|- consumers: [0]
|- access_pattern: mixed
|- producers: [7]
| |- src.gui_2._render_beads_tab_list_result (producer)
| |- src.gui_2._drain_normalize_errors (producer)
| |- src.ai_client._list_gemini_models_result (producer)
| |- src.provider_state.get_all (producer)
| |- src.ai_client._list_anthropic_models_result (producer)
| |- src.ai_client._list_minimax_models_result (producer)
| |- src.ai_client._set_minimax_provider_result (producer)
|- consumers: [7]
| |- src.provider_state.append (consumer)
| |- src.app_controller._symbol_resolution_result (consumer)
| |- src.app_controller._topological_sort_tickets_result (consumer)
| |- src.provider_state.replace_all (consumer)
| |- src.gui_2.__init__ (consumer)
| |- src.app_controller._serialize_tool_calls_result (consumer)
| |- src.project_manager.calculate_track_progress (consumer)
|- access_pattern: whole_struct
|- frequency: per_turn
|- result_coverage: 0 producers, 0 consumers
|- type_alias_coverage: 0 sites
|- result_coverage: 7 producers, 7 consumers
|- type_alias_coverage: 8 sites; 0 typed (0%); 8 untyped (100%)
|- cross_audit_findings: 0 findings
|- decomposition_cost: insufficient_data (470 us)
|- decomposition_cost: hold (470 us)
|- optimization_candidates: [0]
@@ -7,37 +7,272 @@
\ === memory_dim ===
"discussion" mem-dim
\ === producers (1 items) ===
\ === producers (118 items) ===
"src.ai_client._extract_dashscope_tool_calls" "src\ai_client.py" 2754 "producer" fn-ref
"src.api_hook_client.get_warmup_wait" "src\api_hook_client.py" 332 "producer" fn-ref
"src.app_controller.wait" "src\app_controller.py" 5205 "producer" fn-ref
"src.ai_client._dashscope_call" "src\ai_client.py" 2716 "producer" fn-ref
"src.app_controller._pending_mma_spawn" "src\app_controller.py" 2772 "producer" fn-ref
"src.api_hook_client.wait_for_event" "src\api_hook_client.py" 136 "producer" fn-ref
"src.api_hook_client.clear_events" "src\api_hook_client.py" 129 "producer" fn-ref
"src.project_manager.get_all_tracks" "src\project_manager.py" 342 "producer" fn-ref
"src.app_controller._offload_entry_payload" "src\app_controller.py" 4240 "producer" fn-ref
"src.ai_client._strip_private_keys" "src\ai_client.py" 1464 "producer" fn-ref
"src.app_controller._api_get_diagnostics" "src\app_controller.py" 202 "producer" fn-ref
"src.app_controller.get_gui_state" "src\app_controller.py" 2829 "producer" fn-ref
"src.app_controller.load_config" "src\app_controller.py" 5142 "producer" fn-ref
"src.api_hook_client.get_warmup_status" "src\api_hook_client.py" 325 "producer" fn-ref
"src.api_hook_client.get_project" "src\api_hook_client.py" 367 "producer" fn-ref
"src.api_hook_client.get_mma_workers" "src\api_hook_client.py" 546 "producer" fn-ref
"src.models.to_dict" "src\models.py" 646 "producer" fn-ref
"src.api_hook_client.reject_patch" "src\api_hook_client.py" 288 "producer" fn-ref
"src.models.to_dict" "src\models.py" 406 "producer" fn-ref
"src.app_controller._api_get_session" "src\app_controller.py" 374 "producer" fn-ref
"src.ai_client._parse_tool_args_result" "src\ai_client.py" 741 "producer" fn-ref
"src.app_controller._api_pending_actions" "src\app_controller.py" 335 "producer" fn-ref
"src.models.to_dict" "src\models.py" 855 "producer" fn-ref
"src.project_manager.load_history" "src\project_manager.py" 209 "producer" fn-ref
"src.app_controller.get_context" "src\app_controller.py" 2892 "producer" fn-ref
"src.ai_client._build_chunked_context_blocks" "src\ai_client.py" 1281 "producer" fn-ref
"src.ai_client._get_anthropic_tools" "src\ai_client.py" 664 "producer" fn-ref
"src.api_hook_client.get_gui_state" "src\api_hook_client.py" 165 "producer" fn-ref
"src.models.to_dict" "src\models.py" 938 "producer" fn-ref
"src.models.to_dict" "src\models.py" 1059 "producer" fn-ref
"src.ai_client._get_deepseek_tools" "src\ai_client.py" 1194 "producer" fn-ref
"src.models.parse_history_entries" "src\models.py" 214 "producer" fn-ref
"src.api_hook_client.get_events" "src\api_hook_client.py" 124 "producer" fn-ref
"src.ai_client._pre_dispatch" "src\ai_client.py" 2089 "producer" fn-ref
"src.project_manager.str_to_entry" "src\project_manager.py" 75 "producer" fn-ref
"src.api_hook_client.post_project" "src\api_hook_client.py" 473 "producer" fn-ref
"src.models.to_dict" "src\models.py" 794 "producer" fn-ref
"src.api_hook_client.get_session" "src\api_hook_client.py" 502 "producer" fn-ref
"src.app_controller.token_stats" "src\app_controller.py" 2898 "producer" fn-ref
"src.api_hook_client.get_io_pool_status" "src\api_hook_client.py" 420 "producer" fn-ref
"src.api_hook_client.trigger_patch" "src\api_hook_client.py" 274 "producer" fn-ref
"src.api_hook_client.get_gui_health" "src\api_hook_client.py" 434 "producer" fn-ref
"src.ai_client.get_gemini_cache_stats" "src\ai_client.py" 1604 "producer" fn-ref
"src.app_controller._api_get_api_project" "src\app_controller.py" 188 "producer" fn-ref
"src.api_hook_client.get_status" "src\api_hook_client.py" 105 "producer" fn-ref
"src.app_controller._api_get_context" "src\app_controller.py" 398 "producer" fn-ref
"src.app_controller._api_token_stats" "src\app_controller.py" 417 "producer" fn-ref
"src.api_hook_client.get_context_state" "src\api_hook_client.py" 491 "producer" fn-ref
"src.api_hook_client.set_value" "src\api_hook_client.py" 212 "producer" fn-ref
"src.app_controller.get_mma_status" "src\app_controller.py" 2835 "producer" fn-ref
"src.api_hook_client.post_gui" "src\api_hook_client.py" 149 "producer" fn-ref
"src.api_hook_client.get_gui_diagnostics" "src\api_hook_client.py" 311 "producer" fn-ref
"src.app_controller._api_get_performance" "src\app_controller.py" 195 "producer" fn-ref
"src.app_controller._api_get_api_session" "src\app_controller.py" 170 "producer" fn-ref
"src.api_hook_client.get_mma_status" "src\api_hook_client.py" 539 "producer" fn-ref
"src.models.to_dict" "src\models.py" 1000 "producer" fn-ref
"src.models.to_dict" "src\models.py" 672 "producer" fn-ref
"src.models.to_dict" "src\models.py" 355 "producer" fn-ref
"src.provider_state.get_all" "src\provider_state.py" 34 "producer" fn-ref
"src.aggregate.build_file_items" "src\aggregate.py" 158 "producer" fn-ref
"src.api_hook_client.get_startup_timeline" "src\api_hook_client.py" 353 "producer" fn-ref
"src.api_hook_client.get_node_status" "src\api_hook_client.py" 532 "producer" fn-ref
"src.api_hook_client.get_performance" "src\api_hook_client.py" 318 "producer" fn-ref
"src.ai_client._load_credentials" "src\ai_client.py" 282 "producer" fn-ref
"src.app_controller._api_get_gui_state" "src\app_controller.py" 123 "producer" fn-ref
"src.project_manager.default_project" "src\project_manager.py" 123 "producer" fn-ref
"src.api_hook_client.post_session" "src\api_hook_client.py" 117 "producer" fn-ref
"src.app_controller.get_performance" "src\app_controller.py" 2856 "producer" fn-ref
"src.project_manager.migrate_from_legacy_config" "src\project_manager.py" 253 "producer" fn-ref
"src.models.to_dict" "src\models.py" 486 "producer" fn-ref
"src.models.to_dict" "src\models.py" 913 "producer" fn-ref
"src.models.to_dict" "src\models.py" 596 "producer" fn-ref
"src.api_hook_client.push_event" "src\api_hook_client.py" 156 "producer" fn-ref
"src.api_hook_client.get_warmup_canaries" "src\api_hook_client.py" 342 "producer" fn-ref
"src.api_hook_client.drag" "src\api_hook_client.py" 230 "producer" fn-ref
"src.app_controller.pending_actions" "src\app_controller.py" 2874 "producer" fn-ref
"src.ai_client.get_token_stats" "src\ai_client.py" 3185 "producer" fn-ref
"src.models.to_dict" "src\models.py" 886 "producer" fn-ref
"src.app_controller.status" "src\app_controller.py" 2865 "producer" fn-ref
"src.models.to_dict" "src\models.py" 558 "producer" fn-ref
"src.api_hook_client.apply_patch" "src\api_hook_client.py" 281 "producer" fn-ref
"src.models._load_config_from_disk" "src\models.py" 186 "producer" fn-ref
"src.api_hook_client.post_project" "src\api_hook_client.py" 470 "producer" fn-ref
"src.app_controller._api_get_mma_status" "src\app_controller.py" 144 "producer" fn-ref
"src.api_hook_client.get_patch_status" "src\api_hook_client.py" 295 "producer" fn-ref
"src.app_controller.generate" "src\app_controller.py" 2868 "producer" fn-ref
"src.models.to_dict" "src\models.py" 441 "producer" fn-ref
"src.app_controller.get_api_project" "src\app_controller.py" 2853 "producer" fn-ref
"src.app_controller._api_status" "src\app_controller.py" 209 "producer" fn-ref
"src.project_manager.flat_config" "src\project_manager.py" 267 "producer" fn-ref
"src.models.to_dict" "src\models.py" 1024 "producer" fn-ref
"src.ai_client.ollama_chat" "src\ai_client.py" 2938 "producer" fn-ref
"src.api_hook_client.wait_for_project_switch" "src\api_hook_client.py" 389 "producer" fn-ref
"src.models.to_dict" "src\models.py" 971 "producer" fn-ref
"src.api_hook_client.click" "src\api_hook_client.py" 223 "producer" fn-ref
"src.ai_client.get_comms_log" "src\ai_client.py" 273 "producer" fn-ref
"src.app_controller._api_generate" "src\app_controller.py" 221 "producer" fn-ref
"src.api_hook_client.select_list_item" "src\api_hook_client.py" 256 "producer" fn-ref
"src.models.to_dict" "src\models.py" 288 "producer" fn-ref
"src.api_hook_client.get_project_switch_status" "src\api_hook_client.py" 374 "producer" fn-ref
"src.models.to_dict" "src\models.py" 737 "producer" fn-ref
"src.project_manager.load_project" "src\project_manager.py" 186 "producer" fn-ref
"src.app_controller.get_session" "src\app_controller.py" 2883 "producer" fn-ref
"src.api_hook_client.get_system_telemetry" "src\api_hook_client.py" 524 "producer" fn-ref
"src.models.to_dict" "src\models.py" 618 "producer" fn-ref
"src.api_hook_client._make_request" "src\api_hook_client.py" 65 "producer" fn-ref
"src.app_controller.get_diagnostics" "src\app_controller.py" 2862 "producer" fn-ref
"src.app_controller.get_session_insights" "src\app_controller.py" 3049 "producer" fn-ref
"src.ai_client._content_block_to_dict" "src\ai_client.py" 1200 "producer" fn-ref
"src.api_hook_client.select_tab" "src\api_hook_client.py" 263 "producer" fn-ref
"src.app_controller._pending_mma_approval" "src\app_controller.py" 2776 "producer" fn-ref
"src.ai_client._add_bleed_derived" "src\ai_client.py" 3332 "producer" fn-ref
"src.models.to_dict" "src\models.py" 701 "producer" fn-ref
"src.api_hook_client.right_click" "src\api_hook_client.py" 237 "producer" fn-ref
"src.app_controller.get_api_session" "src\app_controller.py" 2847 "producer" fn-ref
"src.project_manager.default_discussion" "src\project_manager.py" 117 "producer" fn-ref
"src.ai_client._send_cli_round_result" "src\ai_client.py" 1746 "producer" fn-ref
"src.api_hook_client.get_financial_metrics" "src\api_hook_client.py" 520 "producer" fn-ref
\ === consumers (2 items) ===
\ === consumers (68 items) ===
"src.ai_client._invalidate_token_estimate" "src\ai_client.py" 1240 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 920 "consumer" fn-ref
"src.aggregate.build_markdown_from_items" "src\aggregate.py" 348 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 603 "consumer" fn-ref
"src.ai_client._create_gemini_cache_result" "src\ai_client.py" 1706 "consumer" fn-ref
"src.ai_client._send_grok" "src\ai_client.py" 2530 "consumer" fn-ref
"src.ai_client._strip_private_keys" "src\ai_client.py" 1464 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 506 "consumer" fn-ref
"src.ai_client._send_gemini_cli" "src\ai_client.py" 2019 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 814 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 893 "consumer" fn-ref
"src.ai_client._send_gemini" "src\ai_client.py" 1802 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 378 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 1038 "consumer" fn-ref
"src.ai_client._send_anthropic" "src\ai_client.py" 1405 "consumer" fn-ref
"src.project_manager.save_project" "src\project_manager.py" 229 "consumer" fn-ref
"src.ai_client._trim_anthropic_history" "src\ai_client.py" 1353 "consumer" fn-ref
"src.provider_state.append" "src\provider_state.py" 30 "consumer" fn-ref
"src.ai_client._send_llama" "src\ai_client.py" 2858 "consumer" fn-ref
"src.aggregate.build_tier3_context" "src\aggregate.py" 382 "consumer" fn-ref
"src.app_controller._offload_entry_payload" "src\app_controller.py" 4240 "consumer" fn-ref
"src.project_manager.format_discussion" "src\project_manager.py" 69 "consumer" fn-ref
"src.project_manager.entry_to_str" "src\project_manager.py" 49 "consumer" fn-ref
"src.ai_client._repair_minimax_history" "src\ai_client.py" 2462 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 1007 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 747 "consumer" fn-ref
"src.ai_client._strip_stale_file_refreshes" "src\ai_client.py" 1253 "consumer" fn-ref
"src.ai_client._send_deepseek" "src\ai_client.py" 2165 "consumer" fn-ref
"src.ai_client._add_bleed_derived" "src\ai_client.py" 3332 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 683 "consumer" fn-ref
"src.aggregate.build_markdown_no_history" "src\aggregate.py" 366 "consumer" fn-ref
"src.project_manager.flat_config" "src\project_manager.py" 267 "consumer" fn-ref
"src.ai_client._send_llama_native" "src\ai_client.py" 2958 "consumer" fn-ref
"src.ai_client.ollama_chat" "src\ai_client.py" 2938 "consumer" fn-ref
"src.ai_client._send_qwen" "src\ai_client.py" 2773 "consumer" fn-ref
"src.app_controller._on_comms_entry" "src\app_controller.py" 4282 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 712 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 866 "consumer" fn-ref
"src.ai_client._repair_deepseek_history" "src\ai_client.py" 2138 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 454 "consumer" fn-ref
"src.provider_state.replace_all" "src\provider_state.py" 38 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 575 "consumer" fn-ref
"src.ai_client._execute_single_tool_call_async" "src\ai_client.py" 945 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 630 "consumer" fn-ref
"src.ai_client._repair_anthropic_history" "src\ai_client.py" 1381 "consumer" fn-ref
"src.ai_client._strip_cache_controls" "src\ai_client.py" 1291 "consumer" fn-ref
"src.aggregate.run" "src\aggregate.py" 479 "consumer" fn-ref
"src.models._save_config_to_disk" "src\models.py" 199 "consumer" fn-ref
"src.ai_client._dashscope_call" "src\ai_client.py" 2716 "consumer" fn-ref
"src.app_controller._start_track_logic_result" "src\app_controller.py" 4728 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 949 "consumer" fn-ref
"src.ai_client._estimate_prompt_tokens" "src\ai_client.py" 1243 "consumer" fn-ref
"src.ai_client._append_comms" "src\ai_client.py" 257 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 982 "consumer" fn-ref
"src.ai_client._estimate_message_tokens" "src\ai_client.py" 1218 "consumer" fn-ref
"src.ai_client._add_history_cache_breakpoint" "src\ai_client.py" 1299 "consumer" fn-ref
"src.ai_client._pre_dispatch" "src\ai_client.py" 2089 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 295 "consumer" fn-ref
"src.aggregate._build_files_section_from_items" "src\aggregate.py" 300 "consumer" fn-ref
"src.ai_client._trim_minimax_history" "src\ai_client.py" 2482 "consumer" fn-ref
"src.app_controller._refresh_api_metrics" "src\app_controller.py" 3074 "consumer" fn-ref
"src.app_controller._start_track_logic" "src\app_controller.py" 4721 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 416 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 656 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 1072 "consumer" fn-ref
"src.project_manager.migrate_from_legacy_config" "src\project_manager.py" 253 "consumer" fn-ref
"src.ai_client._send_minimax" "src\ai_client.py" 2616 "consumer" fn-ref
"src.ai_client.send" "src\ai_client.py" 3208 "consumer" fn-ref
\ === access_pattern ===
"mixed" access-pattern
"whole_struct" access-pattern
\ === access_pattern_evidence (2 items) ===
\ === access_pattern_evidence (50 items) ===
"src.ai_client._invalidate_token_estimate" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.aggregate.build_markdown_from_items" "whole_struct" 0 "low" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._create_gemini_cache_result" "whole_struct" 0 "low" ap-evidence
"src.ai_client._send_grok" "whole_struct" 0 "low" ap-evidence
"src.ai_client._strip_private_keys" "whole_struct" 0 "low" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._send_gemini_cli" "whole_struct" 0 "low" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._send_gemini" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._send_anthropic" "whole_struct" 0 "low" ap-evidence
"src.project_manager.save_project" "mixed" 2 "high" ap-evidence
"src.ai_client._trim_anthropic_history" "whole_struct" 1 "high" ap-evidence
"src.provider_state.append" "mixed" 2 "high" ap-evidence
"src.ai_client._send_llama" "whole_struct" 0 "low" ap-evidence
"src.aggregate.build_tier3_context" "whole_struct" 0 "low" ap-evidence
"src.app_controller._offload_entry_payload" "whole_struct" 0 "low" ap-evidence
"src.project_manager.format_discussion" "whole_struct" 0 "low" ap-evidence
"src.project_manager.entry_to_str" "whole_struct" 1 "high" ap-evidence
"src.ai_client._repair_minimax_history" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._strip_stale_file_refreshes" "whole_struct" 0 "low" ap-evidence
"src.ai_client._send_deepseek" "whole_struct" 0 "low" ap-evidence
"src.ai_client._add_bleed_derived" "field_by_field" 9 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.aggregate.build_markdown_no_history" "whole_struct" 0 "low" ap-evidence
"src.project_manager.flat_config" "whole_struct" 1 "high" ap-evidence
"src.ai_client._send_llama_native" "whole_struct" 0 "low" ap-evidence
"src.ai_client.ollama_chat" "whole_struct" 0 "low" ap-evidence
"src.ai_client._send_qwen" "whole_struct" 0 "low" ap-evidence
"src.app_controller._on_comms_entry" "field_by_field" 10 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._repair_deepseek_history" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.provider_state.replace_all" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._execute_single_tool_call_async" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._repair_anthropic_history" "whole_struct" 1 "high" ap-evidence
"src.ai_client._strip_cache_controls" "whole_struct" 0 "low" ap-evidence
"src.aggregate.run" "field_by_field" 3 "high" ap-evidence
"src.models._save_config_to_disk" "whole_struct" 0 "low" ap-evidence
"src.ai_client._dashscope_call" "whole_struct" 0 "low" ap-evidence
"src.app_controller._start_track_logic_result" "field_by_field" 17 "high" ap-evidence
\ === frequency ===
"per_turn" frequency
\ === frequency_evidence (1 items) ===
"src.provider_state.get_all" "per_turn" "static_analysis" "producer from src\provider_state.py" freq-evidence
\ === frequency_evidence (5 items) ===
"src.ai_client._extract_dashscope_tool_calls" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.api_hook_client.get_warmup_wait" "per_turn" "static_analysis" "producer from src\api_hook_client.py" freq-evidence
"src.app_controller.wait" "per_turn" "static_analysis" "producer from src\app_controller.py" freq-evidence
"src.ai_client._dashscope_call" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.app_controller._pending_mma_spawn" "per_turn" "static_analysis" "producer from src\app_controller.py" freq-evidence
\ === result_coverage ===
1 1 2 0 result-coverage
97 97 48 0 result-coverage
\ === type_alias_coverage ===
4 0 4 type-alias-coverage
137 0 137 type-alias-coverage
\ === cross_audit_findings ===
5 cross-audit-findings
\ === decomposition_cost ===
470 0 0 "insufficient_data" "HistoryMessage: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern." nil 5 true decomp-cost
470 0 70 "hold" "HistoryMessage: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern." nil 5 true decomp-cost
\ === optimization_candidates (0 items) ===
@@ -6,22 +6,238 @@
## Pipeline summary
- Producers: 1
- Consumers: 2
- Distinct producer fqnames: 1
- Distinct consumer fqnames: 2
- Access pattern (aggregate): mixed
- Producers: 118
- Consumers: 68
- Distinct producer fqnames: 97
- Distinct consumer fqnames: 48
- Access pattern (aggregate): whole_struct
- Frequency (aggregate): per_turn
- Decomposition direction: insufficient_data
- Decomposition direction: hold
- Struct field count (estimated): 5
## Producers (1)
## Producers (118)
### `src\aggregate.py` (1 producer)
- `src.aggregate.build_file_items` (line 158)
### `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._add_bleed_derived` (line 3332)
- `src.ai_client._send_cli_round_result` (line 1746)
### `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_gui_health` (line 434)
- `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.right_click` (line 237)
- `src.api_hook_client.get_financial_metrics` (line 520)
### `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\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 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 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 618)
- `src.models.to_dict` (line 701)
### `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.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\provider_state.py` (1 producer)
- `src.provider_state.get_all` (line 34)
## Consumers (2)
## Consumers (68)
### `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\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._pre_dispatch` (line 2089)
- `src.ai_client._trim_minimax_history` (line 2482)
- `src.ai_client._send_minimax` (line 2616)
- `src.ai_client.send` (line 3208)
### `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._refresh_api_metrics` (line 3074)
- `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._save_config_to_disk` (line 199)
- `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\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.migrate_from_legacy_config` (line 253)
### `src\provider_state.py` (2 consumers)
@@ -30,68 +246,190 @@
## Field access matrix
| consumer | lock | messages |
|---|---|---|
| `append` | 1 | 1 |
| `replace_all` | 1 | 1 |
| 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| `_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 | . | . | . | . | . | . |
| `_strip_cache_controls` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `run` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_save_config_to_disk` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_dashscope_call` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| `_start_track_logic_result` | . | . | . | 2 | 2 | . | . | . | 1 | 1 | 1 | 1 | 4 | . | 1 | . | 1 | . | . | 1 |
_... 25 more fields_
## Access pattern
**Dominant pattern:** mixed
**Evidence count:** 2
**Dominant pattern:** whole_struct
**Evidence count:** 50
**Per-function pattern distribution:**
- `mixed`: 2 functions (100%)
- `whole_struct`: 27 functions (54%)
- `mixed`: 19 functions (38%)
- `field_by_field`: 4 functions (8%)
## SSDL Sketch for `HistoryMessage`
```
[Q:HistoryMessage entry-point] -> [Q:PCG lookup]
-> [1: append] [B:check] (branches=1)
-> [2: replace_all] [B:check] (branches=1)
-> [1: _invalidate_token_estimate] [B:check] (branches=0)
-> [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]
-> [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)
-> [34: ollama_chat] [B:check] (branches=3)
-> [35: _send_qwen] [B:check] (branches=9)
-> [36: _on_comms_entry] [B:check] (branches=32)
-> [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]
-> [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)
-> [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)
-> [T:done]
```
**Effective codepaths:** 4 (sum of 2^branches across 2 consumers)
**Total branch points:** 2
**Nil-check functions:** 0
**Effective codepaths:** 40140116231395706750394 (sum of 2^branches across 68 consumers)
**Total branch points:** 543
**Nil-check functions:** 9
**Defusing opportunities:**
- **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 4 field-check branches to 1 cache lookup.
- Effective codepaths: 4 -> 4
- **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
- **Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`**: Wrap the aggregate in a generational handle (index + generation). Validation is one comparison; mismatch returns the nil sentinel. Reduces N lifetime branches to 1 handle validation + sentinel return.
- Effective codepaths: 40140116231395706750394 -> 68
## Frequency
**Dominant frequency:** per_turn
**Evidence count:** 1
**Evidence count:** 5
**Per-function frequency distribution:**
- `per_turn`: 1 functions
- `per_turn`: 5 functions
## Result coverage
**Summary:** 1 producers, 2 consumers
**Summary:** 97 producers, 48 consumers
| metric | value |
|---|---|
| total producers | 1 |
| result producers | 1 |
| total consumers | 2 |
| total producers | 97 |
| result producers | 97 |
| total consumers | 48 |
| result consumers | 0 |
## Type alias coverage
**Summary:** 4 sites; 0 typed (0%); 4 untyped (100%)
**Summary:** 137 sites; 0 typed (0%); 137 untyped (100%)
| metric | value |
|---|---|
| total field-access sites | 4 |
| total field-access sites | 137 |
| typed sites (canonical field) | 0 |
| untyped sites (wildcard) | 4 |
| untyped sites (wildcard) | 137 |
## Cross-audit findings
@@ -101,9 +439,9 @@ _(no cross-audit findings mapped to this aggregate)_
**Current cost estimate:** 470 us/turn
**Componentize savings:** 0 us/turn
**Unify savings:** 0 us/turn
**Recommended direction:** insufficient_data
**Rationale:** HistoryMessage: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern.
**Unify savings:** 70 us/turn
**Recommended direction:** hold
**Rationale:** HistoryMessage: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern.
**Struct field count (estimated):** 5
**Struct frozen:** True
@@ -111,8 +449,51 @@ _(no cross-audit findings mapped to this aggregate)_
| field | access count | access pattern |
|---|---|---|
| `content` | 15 | hot |
| `marker` | 15 | hot |
| `get` | 7 | hot |
| `append` | 3 | hot |
| `pop` | 2 | used |
| `files` | 2 | used |
| `lock` | 2 | used |
| `messages` | 2 | used |
| `encode` | 1 | used |
| `discussion` | 1 | used |
| `estimated_prompt_tokens` | 1 | used |
| `max_prompt_tokens` | 1 | used |
| `utilization_pct` | 1 | used |
| `headroom` | 1 | used |
| `would_trim` | 1 | used |
| `sys_tokens` | 1 | used |
| `tool_tokens` | 1 | used |
| `history_tokens` | 1 | used |
| `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 |
| `_topological_sort_tickets_result` | 1 | used |
| `active_project_root` | 1 | used |
| `event_queue` | 1 | used |
| `engines` | 1 | used |
| `project` | 1 | used |
| `active_discussion` | 1 | used |
| `submit_io` | 1 | used |
| `tracks` | 1 | used |
| `config` | 1 | used |
| `mma_tier_usage` | 1 | used |
| `_pending_gui_tasks` | 1 | used |
| `mma_step_mode` | 1 | used |
| `active_project_path` | 1 | used |
## Optimization candidates
@@ -120,7 +501,7 @@ _(no optimization candidates generated)_
## Verdict
HistoryMessage: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern.
HistoryMessage: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern.
## Evidence appendix
@@ -128,11 +509,63 @@ HistoryMessage: access_pattern=mixed, frequency=per_turn, struct_field_count=5,
| function | pattern | field_accesses | confidence |
|---|---|---|---|
| `src.ai_client._invalidate_token_estimate` | `whole_struct` | `pop`=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.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.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 |
### Frequency evidence
| function | frequency | source | note |
|---|---|---|---|
| `src.provider_state.get_all` | `per_turn` | `static_analysis` | producer from src\provider_state.py |
| `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 |
@@ -1,15 +1,198 @@
Metadata: HistoryMessage
|- kind: typealias
|- memory_dim: discussion
|- producers: [1]
|- producers: [118]
| |- src.ai_client._extract_dashscope_tool_calls (producer)
| |- src.api_hook_client.get_warmup_wait (producer)
| |- src.app_controller.wait (producer)
| |- src.ai_client._dashscope_call (producer)
| |- src.app_controller._pending_mma_spawn (producer)
| |- src.api_hook_client.wait_for_event (producer)
| |- src.api_hook_client.clear_events (producer)
| |- src.project_manager.get_all_tracks (producer)
| |- src.app_controller._offload_entry_payload (producer)
| |- src.ai_client._strip_private_keys (producer)
| |- src.app_controller._api_get_diagnostics (producer)
| |- src.app_controller.get_gui_state (producer)
| |- src.app_controller.load_config (producer)
| |- src.api_hook_client.get_warmup_status (producer)
| |- src.api_hook_client.get_project (producer)
| |- src.api_hook_client.get_mma_workers (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.reject_patch (producer)
| |- src.models.to_dict (producer)
| |- src.app_controller._api_get_session (producer)
| |- src.ai_client._parse_tool_args_result (producer)
| |- src.app_controller._api_pending_actions (producer)
| |- src.models.to_dict (producer)
| |- src.project_manager.load_history (producer)
| |- src.app_controller.get_context (producer)
| |- src.ai_client._build_chunked_context_blocks (producer)
| |- src.ai_client._get_anthropic_tools (producer)
| |- src.api_hook_client.get_gui_state (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.ai_client._get_deepseek_tools (producer)
| |- src.models.parse_history_entries (producer)
| |- src.api_hook_client.get_events (producer)
| |- src.ai_client._pre_dispatch (producer)
| |- src.project_manager.str_to_entry (producer)
| |- src.api_hook_client.post_project (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.get_session (producer)
| |- src.app_controller.token_stats (producer)
| |- src.api_hook_client.get_io_pool_status (producer)
| |- src.api_hook_client.trigger_patch (producer)
| |- src.api_hook_client.get_gui_health (producer)
| |- src.ai_client.get_gemini_cache_stats (producer)
| |- src.app_controller._api_get_api_project (producer)
| |- src.api_hook_client.get_status (producer)
| |- src.app_controller._api_get_context (producer)
| |- src.app_controller._api_token_stats (producer)
| |- src.api_hook_client.get_context_state (producer)
| |- src.api_hook_client.set_value (producer)
| |- src.app_controller.get_mma_status (producer)
| |- src.api_hook_client.post_gui (producer)
| |- src.api_hook_client.get_gui_diagnostics (producer)
| |- src.app_controller._api_get_performance (producer)
| |- src.app_controller._api_get_api_session (producer)
| |- src.api_hook_client.get_mma_status (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.provider_state.get_all (producer)
|- consumers: [2]
| |- src.aggregate.build_file_items (producer)
| |- src.api_hook_client.get_startup_timeline (producer)
| |- src.api_hook_client.get_node_status (producer)
| |- src.api_hook_client.get_performance (producer)
| |- src.ai_client._load_credentials (producer)
| |- src.app_controller._api_get_gui_state (producer)
| |- src.project_manager.default_project (producer)
| |- src.api_hook_client.post_session (producer)
| |- src.app_controller.get_performance (producer)
| |- src.project_manager.migrate_from_legacy_config (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.push_event (producer)
| |- src.api_hook_client.get_warmup_canaries (producer)
| |- src.api_hook_client.drag (producer)
| |- src.app_controller.pending_actions (producer)
| |- src.ai_client.get_token_stats (producer)
| |- src.models.to_dict (producer)
| |- src.app_controller.status (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.apply_patch (producer)
| |- src.models._load_config_from_disk (producer)
| |- src.api_hook_client.post_project (producer)
| |- src.app_controller._api_get_mma_status (producer)
| |- src.api_hook_client.get_patch_status (producer)
| |- src.app_controller.generate (producer)
| |- src.models.to_dict (producer)
| |- src.app_controller.get_api_project (producer)
| |- src.app_controller._api_status (producer)
| |- src.project_manager.flat_config (producer)
| |- src.models.to_dict (producer)
| |- src.ai_client.ollama_chat (producer)
| |- src.api_hook_client.wait_for_project_switch (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.click (producer)
| |- src.ai_client.get_comms_log (producer)
| |- src.app_controller._api_generate (producer)
| |- src.api_hook_client.select_list_item (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.get_project_switch_status (producer)
| |- src.models.to_dict (producer)
| |- src.project_manager.load_project (producer)
| |- src.app_controller.get_session (producer)
| |- src.api_hook_client.get_system_telemetry (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client._make_request (producer)
| |- src.app_controller.get_diagnostics (producer)
| |- src.app_controller.get_session_insights (producer)
| |- src.ai_client._content_block_to_dict (producer)
| |- src.api_hook_client.select_tab (producer)
| |- src.app_controller._pending_mma_approval (producer)
| |- src.ai_client._add_bleed_derived (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.right_click (producer)
| |- src.app_controller.get_api_session (producer)
| |- src.project_manager.default_discussion (producer)
| |- src.ai_client._send_cli_round_result (producer)
| |- src.api_hook_client.get_financial_metrics (producer)
|- consumers: [68]
| |- src.ai_client._invalidate_token_estimate (consumer)
| |- src.models.from_dict (consumer)
| |- src.aggregate.build_markdown_from_items (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._create_gemini_cache_result (consumer)
| |- src.ai_client._send_grok (consumer)
| |- src.ai_client._strip_private_keys (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._send_gemini_cli (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._send_gemini (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._send_anthropic (consumer)
| |- src.project_manager.save_project (consumer)
| |- src.ai_client._trim_anthropic_history (consumer)
| |- src.provider_state.append (consumer)
| |- src.ai_client._send_llama (consumer)
| |- src.aggregate.build_tier3_context (consumer)
| |- src.app_controller._offload_entry_payload (consumer)
| |- src.project_manager.format_discussion (consumer)
| |- src.project_manager.entry_to_str (consumer)
| |- src.ai_client._repair_minimax_history (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._strip_stale_file_refreshes (consumer)
| |- src.ai_client._send_deepseek (consumer)
| |- src.ai_client._add_bleed_derived (consumer)
| |- src.models.from_dict (consumer)
| |- src.aggregate.build_markdown_no_history (consumer)
| |- src.project_manager.flat_config (consumer)
| |- src.ai_client._send_llama_native (consumer)
| |- src.ai_client.ollama_chat (consumer)
| |- src.ai_client._send_qwen (consumer)
| |- src.app_controller._on_comms_entry (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._repair_deepseek_history (consumer)
| |- src.models.from_dict (consumer)
| |- src.provider_state.replace_all (consumer)
|- access_pattern: mixed
| |- src.models.from_dict (consumer)
| |- src.ai_client._execute_single_tool_call_async (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._repair_anthropic_history (consumer)
| |- src.ai_client._strip_cache_controls (consumer)
| |- src.aggregate.run (consumer)
| |- src.models._save_config_to_disk (consumer)
| |- src.ai_client._dashscope_call (consumer)
| |- src.app_controller._start_track_logic_result (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._estimate_prompt_tokens (consumer)
| |- src.ai_client._append_comms (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._estimate_message_tokens (consumer)
| |- src.ai_client._add_history_cache_breakpoint (consumer)
| |- src.ai_client._pre_dispatch (consumer)
| |- src.models.from_dict (consumer)
| |- src.aggregate._build_files_section_from_items (consumer)
| |- src.ai_client._trim_minimax_history (consumer)
| |- src.app_controller._refresh_api_metrics (consumer)
| |- src.app_controller._start_track_logic (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.project_manager.migrate_from_legacy_config (consumer)
| |- src.ai_client._send_minimax (consumer)
| |- src.ai_client.send (consumer)
|- access_pattern: whole_struct
|- frequency: per_turn
|- result_coverage: 1 producers, 2 consumers
|- type_alias_coverage: 4 sites; 0 typed (0%); 4 untyped (100%)
|- result_coverage: 97 producers, 48 consumers
|- type_alias_coverage: 137 sites; 0 typed (0%); 137 untyped (100%)
|- cross_audit_findings: 0 findings
|- decomposition_cost: insufficient_data (470 us)
|- decomposition_cost: hold (470 us)
|- optimization_candidates: [0]
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -7,29 +7,265 @@
\ === memory_dim ===
"control" mem-dim
\ === producers (1 items) ===
\ === producers (118 items) ===
"src.ai_client._extract_dashscope_tool_calls" "src\ai_client.py" 2754 "producer" fn-ref
"src.api_hook_client.get_warmup_wait" "src\api_hook_client.py" 332 "producer" fn-ref
"src.app_controller.wait" "src\app_controller.py" 5205 "producer" fn-ref
"src.ai_client._dashscope_call" "src\ai_client.py" 2716 "producer" fn-ref
"src.app_controller._pending_mma_spawn" "src\app_controller.py" 2772 "producer" fn-ref
"src.api_hook_client.wait_for_event" "src\api_hook_client.py" 136 "producer" fn-ref
"src.api_hook_client.clear_events" "src\api_hook_client.py" 129 "producer" fn-ref
"src.project_manager.get_all_tracks" "src\project_manager.py" 342 "producer" fn-ref
"src.app_controller._offload_entry_payload" "src\app_controller.py" 4240 "producer" fn-ref
"src.ai_client._strip_private_keys" "src\ai_client.py" 1464 "producer" fn-ref
"src.app_controller._api_get_diagnostics" "src\app_controller.py" 202 "producer" fn-ref
"src.app_controller.get_gui_state" "src\app_controller.py" 2829 "producer" fn-ref
"src.app_controller.load_config" "src\app_controller.py" 5142 "producer" fn-ref
"src.api_hook_client.get_warmup_status" "src\api_hook_client.py" 325 "producer" fn-ref
"src.api_hook_client.get_project" "src\api_hook_client.py" 367 "producer" fn-ref
"src.api_hook_client.get_mma_workers" "src\api_hook_client.py" 546 "producer" fn-ref
"src.models.to_dict" "src\models.py" 646 "producer" fn-ref
"src.api_hook_client.reject_patch" "src\api_hook_client.py" 288 "producer" fn-ref
"src.models.to_dict" "src\models.py" 406 "producer" fn-ref
"src.app_controller._api_get_session" "src\app_controller.py" 374 "producer" fn-ref
"src.ai_client._parse_tool_args_result" "src\ai_client.py" 741 "producer" fn-ref
"src.app_controller._api_pending_actions" "src\app_controller.py" 335 "producer" fn-ref
"src.models.to_dict" "src\models.py" 855 "producer" fn-ref
"src.project_manager.load_history" "src\project_manager.py" 209 "producer" fn-ref
"src.openai_compatible._to_typed_tool_call" "src\openai_compatible.py" 43 "producer" fn-ref
"src.app_controller.get_context" "src\app_controller.py" 2892 "producer" fn-ref
"src.ai_client._build_chunked_context_blocks" "src\ai_client.py" 1281 "producer" fn-ref
"src.ai_client._get_anthropic_tools" "src\ai_client.py" 664 "producer" fn-ref
"src.api_hook_client.get_gui_state" "src\api_hook_client.py" 165 "producer" fn-ref
"src.models.to_dict" "src\models.py" 938 "producer" fn-ref
"src.models.to_dict" "src\models.py" 1059 "producer" fn-ref
"src.ai_client._get_deepseek_tools" "src\ai_client.py" 1194 "producer" fn-ref
"src.models.parse_history_entries" "src\models.py" 214 "producer" fn-ref
"src.api_hook_client.get_events" "src\api_hook_client.py" 124 "producer" fn-ref
"src.ai_client._pre_dispatch" "src\ai_client.py" 2089 "producer" fn-ref
"src.project_manager.str_to_entry" "src\project_manager.py" 75 "producer" fn-ref
"src.api_hook_client.post_project" "src\api_hook_client.py" 473 "producer" fn-ref
"src.models.to_dict" "src\models.py" 794 "producer" fn-ref
"src.api_hook_client.get_session" "src\api_hook_client.py" 502 "producer" fn-ref
"src.app_controller.token_stats" "src\app_controller.py" 2898 "producer" fn-ref
"src.api_hook_client.get_io_pool_status" "src\api_hook_client.py" 420 "producer" fn-ref
"src.api_hook_client.trigger_patch" "src\api_hook_client.py" 274 "producer" fn-ref
"src.api_hook_client.get_gui_health" "src\api_hook_client.py" 434 "producer" fn-ref
"src.ai_client.get_gemini_cache_stats" "src\ai_client.py" 1604 "producer" fn-ref
"src.app_controller._api_get_api_project" "src\app_controller.py" 188 "producer" fn-ref
"src.api_hook_client.get_status" "src\api_hook_client.py" 105 "producer" fn-ref
"src.app_controller._api_get_context" "src\app_controller.py" 398 "producer" fn-ref
"src.app_controller._api_token_stats" "src\app_controller.py" 417 "producer" fn-ref
"src.api_hook_client.get_context_state" "src\api_hook_client.py" 491 "producer" fn-ref
"src.api_hook_client.set_value" "src\api_hook_client.py" 212 "producer" fn-ref
"src.app_controller.get_mma_status" "src\app_controller.py" 2835 "producer" fn-ref
"src.api_hook_client.post_gui" "src\api_hook_client.py" 149 "producer" fn-ref
"src.api_hook_client.get_gui_diagnostics" "src\api_hook_client.py" 311 "producer" fn-ref
"src.app_controller._api_get_performance" "src\app_controller.py" 195 "producer" fn-ref
"src.app_controller._api_get_api_session" "src\app_controller.py" 170 "producer" fn-ref
"src.api_hook_client.get_mma_status" "src\api_hook_client.py" 539 "producer" fn-ref
"src.models.to_dict" "src\models.py" 1000 "producer" fn-ref
"src.models.to_dict" "src\models.py" 672 "producer" fn-ref
"src.models.to_dict" "src\models.py" 355 "producer" fn-ref
"src.aggregate.build_file_items" "src\aggregate.py" 158 "producer" fn-ref
"src.api_hook_client.get_startup_timeline" "src\api_hook_client.py" 353 "producer" fn-ref
"src.api_hook_client.get_node_status" "src\api_hook_client.py" 532 "producer" fn-ref
"src.api_hook_client.get_performance" "src\api_hook_client.py" 318 "producer" fn-ref
"src.ai_client._load_credentials" "src\ai_client.py" 282 "producer" fn-ref
"src.app_controller._api_get_gui_state" "src\app_controller.py" 123 "producer" fn-ref
"src.project_manager.default_project" "src\project_manager.py" 123 "producer" fn-ref
"src.api_hook_client.post_session" "src\api_hook_client.py" 117 "producer" fn-ref
"src.app_controller.get_performance" "src\app_controller.py" 2856 "producer" fn-ref
"src.project_manager.migrate_from_legacy_config" "src\project_manager.py" 253 "producer" fn-ref
"src.models.to_dict" "src\models.py" 486 "producer" fn-ref
"src.models.to_dict" "src\models.py" 913 "producer" fn-ref
"src.models.to_dict" "src\models.py" 596 "producer" fn-ref
"src.api_hook_client.push_event" "src\api_hook_client.py" 156 "producer" fn-ref
"src.api_hook_client.get_warmup_canaries" "src\api_hook_client.py" 342 "producer" fn-ref
"src.api_hook_client.drag" "src\api_hook_client.py" 230 "producer" fn-ref
"src.app_controller.pending_actions" "src\app_controller.py" 2874 "producer" fn-ref
"src.ai_client.get_token_stats" "src\ai_client.py" 3185 "producer" fn-ref
"src.models.to_dict" "src\models.py" 886 "producer" fn-ref
"src.app_controller.status" "src\app_controller.py" 2865 "producer" fn-ref
"src.models.to_dict" "src\models.py" 558 "producer" fn-ref
"src.api_hook_client.apply_patch" "src\api_hook_client.py" 281 "producer" fn-ref
"src.models._load_config_from_disk" "src\models.py" 186 "producer" fn-ref
"src.api_hook_client.post_project" "src\api_hook_client.py" 470 "producer" fn-ref
"src.app_controller._api_get_mma_status" "src\app_controller.py" 144 "producer" fn-ref
"src.api_hook_client.get_patch_status" "src\api_hook_client.py" 295 "producer" fn-ref
"src.app_controller.generate" "src\app_controller.py" 2868 "producer" fn-ref
"src.models.to_dict" "src\models.py" 441 "producer" fn-ref
"src.app_controller.get_api_project" "src\app_controller.py" 2853 "producer" fn-ref
"src.app_controller._api_status" "src\app_controller.py" 209 "producer" fn-ref
"src.project_manager.flat_config" "src\project_manager.py" 267 "producer" fn-ref
"src.models.to_dict" "src\models.py" 1024 "producer" fn-ref
"src.ai_client.ollama_chat" "src\ai_client.py" 2938 "producer" fn-ref
"src.api_hook_client.wait_for_project_switch" "src\api_hook_client.py" 389 "producer" fn-ref
"src.models.to_dict" "src\models.py" 971 "producer" fn-ref
"src.api_hook_client.click" "src\api_hook_client.py" 223 "producer" fn-ref
"src.ai_client.get_comms_log" "src\ai_client.py" 273 "producer" fn-ref
"src.app_controller._api_generate" "src\app_controller.py" 221 "producer" fn-ref
"src.api_hook_client.select_list_item" "src\api_hook_client.py" 256 "producer" fn-ref
"src.models.to_dict" "src\models.py" 288 "producer" fn-ref
"src.api_hook_client.get_project_switch_status" "src\api_hook_client.py" 374 "producer" fn-ref
"src.models.to_dict" "src\models.py" 737 "producer" fn-ref
"src.project_manager.load_project" "src\project_manager.py" 186 "producer" fn-ref
"src.app_controller.get_session" "src\app_controller.py" 2883 "producer" fn-ref
"src.api_hook_client.get_system_telemetry" "src\api_hook_client.py" 524 "producer" fn-ref
"src.models.to_dict" "src\models.py" 618 "producer" fn-ref
"src.api_hook_client._make_request" "src\api_hook_client.py" 65 "producer" fn-ref
"src.app_controller.get_diagnostics" "src\app_controller.py" 2862 "producer" fn-ref
"src.app_controller.get_session_insights" "src\app_controller.py" 3049 "producer" fn-ref
"src.ai_client._content_block_to_dict" "src\ai_client.py" 1200 "producer" fn-ref
"src.api_hook_client.select_tab" "src\api_hook_client.py" 263 "producer" fn-ref
"src.app_controller._pending_mma_approval" "src\app_controller.py" 2776 "producer" fn-ref
"src.ai_client._add_bleed_derived" "src\ai_client.py" 3332 "producer" fn-ref
"src.models.to_dict" "src\models.py" 701 "producer" fn-ref
"src.api_hook_client.right_click" "src\api_hook_client.py" 237 "producer" fn-ref
"src.app_controller.get_api_session" "src\app_controller.py" 2847 "producer" fn-ref
"src.project_manager.default_discussion" "src\project_manager.py" 117 "producer" fn-ref
"src.ai_client._send_cli_round_result" "src\ai_client.py" 1746 "producer" fn-ref
"src.api_hook_client.get_financial_metrics" "src\api_hook_client.py" 520 "producer" fn-ref
\ === consumers (1 items) ===
\ === consumers (67 items) ===
"src.ai_client._invalidate_token_estimate" "src\ai_client.py" 1240 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 920 "consumer" fn-ref
"src.aggregate.build_markdown_from_items" "src\aggregate.py" 348 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 603 "consumer" fn-ref
"src.ai_client._create_gemini_cache_result" "src\ai_client.py" 1706 "consumer" fn-ref
"src.ai_client._send_grok" "src\ai_client.py" 2530 "consumer" fn-ref
"src.ai_client._strip_private_keys" "src\ai_client.py" 1464 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 506 "consumer" fn-ref
"src.ai_client._send_gemini_cli" "src\ai_client.py" 2019 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 814 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 893 "consumer" fn-ref
"src.ai_client._send_gemini" "src\ai_client.py" 1802 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 378 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 1038 "consumer" fn-ref
"src.ai_client._send_anthropic" "src\ai_client.py" 1405 "consumer" fn-ref
"src.project_manager.save_project" "src\project_manager.py" 229 "consumer" fn-ref
"src.ai_client._trim_anthropic_history" "src\ai_client.py" 1353 "consumer" fn-ref
"src.ai_client._send_llama" "src\ai_client.py" 2858 "consumer" fn-ref
"src.aggregate.build_tier3_context" "src\aggregate.py" 382 "consumer" fn-ref
"src.app_controller._offload_entry_payload" "src\app_controller.py" 4240 "consumer" fn-ref
"src.project_manager.format_discussion" "src\project_manager.py" 69 "consumer" fn-ref
"src.project_manager.entry_to_str" "src\project_manager.py" 49 "consumer" fn-ref
"src.ai_client._repair_minimax_history" "src\ai_client.py" 2462 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 1007 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 747 "consumer" fn-ref
"src.ai_client._strip_stale_file_refreshes" "src\ai_client.py" 1253 "consumer" fn-ref
"src.ai_client._send_deepseek" "src\ai_client.py" 2165 "consumer" fn-ref
"src.ai_client._add_bleed_derived" "src\ai_client.py" 3332 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 683 "consumer" fn-ref
"src.aggregate.build_markdown_no_history" "src\aggregate.py" 366 "consumer" fn-ref
"src.project_manager.flat_config" "src\project_manager.py" 267 "consumer" fn-ref
"src.ai_client._send_llama_native" "src\ai_client.py" 2958 "consumer" fn-ref
"src.ai_client.ollama_chat" "src\ai_client.py" 2938 "consumer" fn-ref
"src.ai_client._send_qwen" "src\ai_client.py" 2773 "consumer" fn-ref
"src.app_controller._on_comms_entry" "src\app_controller.py" 4282 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 712 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 866 "consumer" fn-ref
"src.ai_client._repair_deepseek_history" "src\ai_client.py" 2138 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 454 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 575 "consumer" fn-ref
"src.ai_client._execute_single_tool_call_async" "src\ai_client.py" 945 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 630 "consumer" fn-ref
"src.openai_compatible._to_dict_tool_call" "src\openai_compatible.py" 54 "consumer" fn-ref
"src.ai_client._repair_anthropic_history" "src\ai_client.py" 1381 "consumer" fn-ref
"src.ai_client._strip_cache_controls" "src\ai_client.py" 1291 "consumer" fn-ref
"src.aggregate.run" "src\aggregate.py" 479 "consumer" fn-ref
"src.models._save_config_to_disk" "src\models.py" 199 "consumer" fn-ref
"src.ai_client._dashscope_call" "src\ai_client.py" 2716 "consumer" fn-ref
"src.app_controller._start_track_logic_result" "src\app_controller.py" 4728 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 949 "consumer" fn-ref
"src.ai_client._estimate_prompt_tokens" "src\ai_client.py" 1243 "consumer" fn-ref
"src.ai_client._append_comms" "src\ai_client.py" 257 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 982 "consumer" fn-ref
"src.ai_client._estimate_message_tokens" "src\ai_client.py" 1218 "consumer" fn-ref
"src.ai_client._add_history_cache_breakpoint" "src\ai_client.py" 1299 "consumer" fn-ref
"src.ai_client._pre_dispatch" "src\ai_client.py" 2089 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 295 "consumer" fn-ref
"src.aggregate._build_files_section_from_items" "src\aggregate.py" 300 "consumer" fn-ref
"src.ai_client._trim_minimax_history" "src\ai_client.py" 2482 "consumer" fn-ref
"src.app_controller._refresh_api_metrics" "src\app_controller.py" 3074 "consumer" fn-ref
"src.app_controller._start_track_logic" "src\app_controller.py" 4721 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 416 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 656 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 1072 "consumer" fn-ref
"src.project_manager.migrate_from_legacy_config" "src\project_manager.py" 253 "consumer" fn-ref
"src.ai_client._send_minimax" "src\ai_client.py" 2616 "consumer" fn-ref
"src.ai_client.send" "src\ai_client.py" 3208 "consumer" fn-ref
\ === access_pattern ===
"whole_struct" access-pattern
\ === access_pattern_evidence (1 items) ===
\ === access_pattern_evidence (50 items) ===
"src.ai_client._invalidate_token_estimate" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.aggregate.build_markdown_from_items" "whole_struct" 0 "low" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._create_gemini_cache_result" "whole_struct" 0 "low" ap-evidence
"src.ai_client._send_grok" "whole_struct" 0 "low" ap-evidence
"src.ai_client._strip_private_keys" "whole_struct" 0 "low" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._send_gemini_cli" "whole_struct" 0 "low" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._send_gemini" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._send_anthropic" "whole_struct" 0 "low" ap-evidence
"src.project_manager.save_project" "mixed" 2 "high" ap-evidence
"src.ai_client._trim_anthropic_history" "whole_struct" 1 "high" ap-evidence
"src.ai_client._send_llama" "whole_struct" 0 "low" ap-evidence
"src.aggregate.build_tier3_context" "whole_struct" 0 "low" ap-evidence
"src.app_controller._offload_entry_payload" "whole_struct" 0 "low" ap-evidence
"src.project_manager.format_discussion" "whole_struct" 0 "low" ap-evidence
"src.project_manager.entry_to_str" "whole_struct" 1 "high" ap-evidence
"src.ai_client._repair_minimax_history" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._strip_stale_file_refreshes" "whole_struct" 0 "low" ap-evidence
"src.ai_client._send_deepseek" "whole_struct" 0 "low" ap-evidence
"src.ai_client._add_bleed_derived" "field_by_field" 9 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.aggregate.build_markdown_no_history" "whole_struct" 0 "low" ap-evidence
"src.project_manager.flat_config" "whole_struct" 1 "high" ap-evidence
"src.ai_client._send_llama_native" "whole_struct" 0 "low" ap-evidence
"src.ai_client.ollama_chat" "whole_struct" 0 "low" ap-evidence
"src.ai_client._send_qwen" "whole_struct" 0 "low" ap-evidence
"src.app_controller._on_comms_entry" "field_by_field" 10 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._repair_deepseek_history" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._execute_single_tool_call_async" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.openai_compatible._to_dict_tool_call" "whole_struct" 1 "high" ap-evidence
"src.ai_client._repair_anthropic_history" "whole_struct" 1 "high" ap-evidence
"src.ai_client._strip_cache_controls" "whole_struct" 0 "low" ap-evidence
"src.aggregate.run" "field_by_field" 3 "high" ap-evidence
"src.models._save_config_to_disk" "whole_struct" 0 "low" ap-evidence
"src.ai_client._dashscope_call" "whole_struct" 0 "low" ap-evidence
"src.app_controller._start_track_logic_result" "field_by_field" 17 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
\ === frequency ===
"per_turn" frequency
\ === frequency_evidence (1 items) ===
"src.openai_compatible._to_typed_tool_call" "per_turn" "static_analysis" "producer from src\openai_compatible.py" freq-evidence
\ === frequency_evidence (5 items) ===
"src.ai_client._extract_dashscope_tool_calls" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.api_hook_client.get_warmup_wait" "per_turn" "static_analysis" "producer from src\api_hook_client.py" freq-evidence
"src.app_controller.wait" "per_turn" "static_analysis" "producer from src\app_controller.py" freq-evidence
"src.ai_client._dashscope_call" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.app_controller._pending_mma_spawn" "per_turn" "static_analysis" "producer from src\app_controller.py" freq-evidence
\ === result_coverage ===
1 1 1 0 result-coverage
97 97 47 0 result-coverage
\ === type_alias_coverage ===
1 0 1 type-alias-coverage
136 0 136 type-alias-coverage
\ === cross_audit_findings ===
5 cross-audit-findings
@@ -6,89 +6,428 @@
## Pipeline summary
- Producers: 1
- Consumers: 1
- Distinct producer fqnames: 1
- Distinct consumer fqnames: 1
- Producers: 118
- Consumers: 67
- Distinct producer fqnames: 97
- Distinct consumer fqnames: 47
- Access pattern (aggregate): whole_struct
- Frequency (aggregate): per_turn
- Decomposition direction: hold
- Struct field count (estimated): 5
## Producers (1)
## Producers (118)
### `src\aggregate.py` (1 producer)
- `src.aggregate.build_file_items` (line 158)
### `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._add_bleed_derived` (line 3332)
- `src.ai_client._send_cli_round_result` (line 1746)
### `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_gui_health` (line 434)
- `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.right_click` (line 237)
- `src.api_hook_client.get_financial_metrics` (line 520)
### `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\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 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 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 618)
- `src.models.to_dict` (line 701)
### `src\openai_compatible.py` (1 producer)
- `src.openai_compatible._to_typed_tool_call` (line 43)
## Consumers (1)
### `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.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)
## 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\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._pre_dispatch` (line 2089)
- `src.ai_client._trim_minimax_history` (line 2482)
- `src.ai_client._send_minimax` (line 2616)
- `src.ai_client.send` (line 3208)
### `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._refresh_api_metrics` (line 3074)
- `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._save_config_to_disk` (line 199)
- `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\openai_compatible.py` (1 consumer)
- `src.openai_compatible._to_dict_tool_call` (line 54)
### `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.migrate_from_legacy_config` (line 253)
## Field access matrix
| consumer | to_dict |
|---|---|
| `_to_dict_tool_call` | 1 |
| 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| `_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 | . | . | . | . | . | . |
| `_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 | . | . | . | . |
_... 24 more fields_
## Access pattern
**Dominant pattern:** whole_struct
**Evidence count:** 1
**Evidence count:** 50
**Per-function pattern distribution:**
- `whole_struct`: 1 functions (100%)
- `whole_struct`: 28 functions (56%)
- `mixed`: 18 functions (36%)
- `field_by_field`: 4 functions (8%)
## SSDL Sketch for `ToolCall`
```
[Q:ToolCall entry-point] -> [Q:PCG lookup]
-> [1: _to_dict_tool_call] [B:check] (branches=0)
-> [1: _invalidate_token_estimate] [B:check] (branches=0)
-> [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]
-> [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)
-> [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)
-> [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)
-> [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)
-> [T:done]
```
**Effective codepaths:** 1 (sum of 2^branches across 1 consumers)
**Total branch points:** 0
**Nil-check functions:** 0
**Effective codepaths:** 40140116231395706750391 (sum of 2^branches across 67 consumers)
**Total branch points:** 541
**Nil-check functions:** 9
**Defusing opportunities:**
- **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 1 field-check branches to 1 cache lookup.
- Effective codepaths: 1 -> 1
- **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
- **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
## Frequency
**Dominant frequency:** per_turn
**Evidence count:** 1
**Evidence count:** 5
**Per-function frequency distribution:**
- `per_turn`: 1 functions
- `per_turn`: 5 functions
## Result coverage
**Summary:** 1 producers, 1 consumers
**Summary:** 97 producers, 47 consumers
| metric | value |
|---|---|
| total producers | 1 |
| result producers | 1 |
| total consumers | 1 |
| total producers | 97 |
| result producers | 97 |
| total consumers | 47 |
| result consumers | 0 |
## Type alias coverage
**Summary:** 1 sites; 0 typed (0%); 1 untyped (100%)
**Summary:** 136 sites; 0 typed (0%); 136 untyped (100%)
| metric | value |
|---|---|
| total field-access sites | 1 |
| total field-access sites | 136 |
| typed sites (canonical field) | 0 |
| untyped sites (wildcard) | 1 |
| untyped sites (wildcard) | 136 |
## Cross-audit findings
@@ -108,7 +447,50 @@ _(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 |
| `estimated_prompt_tokens` | 1 | used |
| `max_prompt_tokens` | 1 | used |
| `utilization_pct` | 1 | used |
| `headroom` | 1 | used |
| `would_trim` | 1 | used |
| `sys_tokens` | 1 | used |
| `tool_tokens` | 1 | used |
| `history_tokens` | 1 | used |
| `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 |
| `_topological_sort_tickets_result` | 1 | used |
| `active_project_root` | 1 | used |
| `event_queue` | 1 | used |
| `engines` | 1 | used |
| `project` | 1 | used |
| `active_discussion` | 1 | used |
| `submit_io` | 1 | used |
| `tracks` | 1 | used |
| `config` | 1 | used |
| `mma_tier_usage` | 1 | used |
| `_pending_gui_tasks` | 1 | used |
| `mma_step_mode` | 1 | used |
| `active_project_path` | 1 | used |
## Optimization candidates
@@ -124,10 +506,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.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.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.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.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 |
### Frequency evidence
| function | frequency | source | note |
|---|---|---|---|
| `src.openai_compatible._to_typed_tool_call` | `per_turn` | `static_analysis` | producer from src\openai_compatible.py |
| `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 |
@@ -1,14 +1,197 @@
Metadata: ToolCall
|- kind: typealias
|- memory_dim: control
|- producers: [1]
|- producers: [118]
| |- src.ai_client._extract_dashscope_tool_calls (producer)
| |- src.api_hook_client.get_warmup_wait (producer)
| |- src.app_controller.wait (producer)
| |- src.ai_client._dashscope_call (producer)
| |- src.app_controller._pending_mma_spawn (producer)
| |- src.api_hook_client.wait_for_event (producer)
| |- src.api_hook_client.clear_events (producer)
| |- src.project_manager.get_all_tracks (producer)
| |- src.app_controller._offload_entry_payload (producer)
| |- src.ai_client._strip_private_keys (producer)
| |- src.app_controller._api_get_diagnostics (producer)
| |- src.app_controller.get_gui_state (producer)
| |- src.app_controller.load_config (producer)
| |- src.api_hook_client.get_warmup_status (producer)
| |- src.api_hook_client.get_project (producer)
| |- src.api_hook_client.get_mma_workers (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.reject_patch (producer)
| |- src.models.to_dict (producer)
| |- src.app_controller._api_get_session (producer)
| |- src.ai_client._parse_tool_args_result (producer)
| |- src.app_controller._api_pending_actions (producer)
| |- src.models.to_dict (producer)
| |- src.project_manager.load_history (producer)
| |- src.openai_compatible._to_typed_tool_call (producer)
|- consumers: [1]
| |- src.app_controller.get_context (producer)
| |- src.ai_client._build_chunked_context_blocks (producer)
| |- src.ai_client._get_anthropic_tools (producer)
| |- src.api_hook_client.get_gui_state (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.ai_client._get_deepseek_tools (producer)
| |- src.models.parse_history_entries (producer)
| |- src.api_hook_client.get_events (producer)
| |- src.ai_client._pre_dispatch (producer)
| |- src.project_manager.str_to_entry (producer)
| |- src.api_hook_client.post_project (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.get_session (producer)
| |- src.app_controller.token_stats (producer)
| |- src.api_hook_client.get_io_pool_status (producer)
| |- src.api_hook_client.trigger_patch (producer)
| |- src.api_hook_client.get_gui_health (producer)
| |- src.ai_client.get_gemini_cache_stats (producer)
| |- src.app_controller._api_get_api_project (producer)
| |- src.api_hook_client.get_status (producer)
| |- src.app_controller._api_get_context (producer)
| |- src.app_controller._api_token_stats (producer)
| |- src.api_hook_client.get_context_state (producer)
| |- src.api_hook_client.set_value (producer)
| |- src.app_controller.get_mma_status (producer)
| |- src.api_hook_client.post_gui (producer)
| |- src.api_hook_client.get_gui_diagnostics (producer)
| |- src.app_controller._api_get_performance (producer)
| |- src.app_controller._api_get_api_session (producer)
| |- src.api_hook_client.get_mma_status (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.aggregate.build_file_items (producer)
| |- src.api_hook_client.get_startup_timeline (producer)
| |- src.api_hook_client.get_node_status (producer)
| |- src.api_hook_client.get_performance (producer)
| |- src.ai_client._load_credentials (producer)
| |- src.app_controller._api_get_gui_state (producer)
| |- src.project_manager.default_project (producer)
| |- src.api_hook_client.post_session (producer)
| |- src.app_controller.get_performance (producer)
| |- src.project_manager.migrate_from_legacy_config (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.push_event (producer)
| |- src.api_hook_client.get_warmup_canaries (producer)
| |- src.api_hook_client.drag (producer)
| |- src.app_controller.pending_actions (producer)
| |- src.ai_client.get_token_stats (producer)
| |- src.models.to_dict (producer)
| |- src.app_controller.status (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.apply_patch (producer)
| |- src.models._load_config_from_disk (producer)
| |- src.api_hook_client.post_project (producer)
| |- src.app_controller._api_get_mma_status (producer)
| |- src.api_hook_client.get_patch_status (producer)
| |- src.app_controller.generate (producer)
| |- src.models.to_dict (producer)
| |- src.app_controller.get_api_project (producer)
| |- src.app_controller._api_status (producer)
| |- src.project_manager.flat_config (producer)
| |- src.models.to_dict (producer)
| |- src.ai_client.ollama_chat (producer)
| |- src.api_hook_client.wait_for_project_switch (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.click (producer)
| |- src.ai_client.get_comms_log (producer)
| |- src.app_controller._api_generate (producer)
| |- src.api_hook_client.select_list_item (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.get_project_switch_status (producer)
| |- src.models.to_dict (producer)
| |- src.project_manager.load_project (producer)
| |- src.app_controller.get_session (producer)
| |- src.api_hook_client.get_system_telemetry (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client._make_request (producer)
| |- src.app_controller.get_diagnostics (producer)
| |- src.app_controller.get_session_insights (producer)
| |- src.ai_client._content_block_to_dict (producer)
| |- src.api_hook_client.select_tab (producer)
| |- src.app_controller._pending_mma_approval (producer)
| |- src.ai_client._add_bleed_derived (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.right_click (producer)
| |- src.app_controller.get_api_session (producer)
| |- src.project_manager.default_discussion (producer)
| |- src.ai_client._send_cli_round_result (producer)
| |- src.api_hook_client.get_financial_metrics (producer)
|- consumers: [67]
| |- src.ai_client._invalidate_token_estimate (consumer)
| |- src.models.from_dict (consumer)
| |- src.aggregate.build_markdown_from_items (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._create_gemini_cache_result (consumer)
| |- src.ai_client._send_grok (consumer)
| |- src.ai_client._strip_private_keys (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._send_gemini_cli (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._send_gemini (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._send_anthropic (consumer)
| |- src.project_manager.save_project (consumer)
| |- src.ai_client._trim_anthropic_history (consumer)
| |- src.ai_client._send_llama (consumer)
| |- src.aggregate.build_tier3_context (consumer)
| |- src.app_controller._offload_entry_payload (consumer)
| |- src.project_manager.format_discussion (consumer)
| |- src.project_manager.entry_to_str (consumer)
| |- src.ai_client._repair_minimax_history (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._strip_stale_file_refreshes (consumer)
| |- src.ai_client._send_deepseek (consumer)
| |- src.ai_client._add_bleed_derived (consumer)
| |- src.models.from_dict (consumer)
| |- src.aggregate.build_markdown_no_history (consumer)
| |- src.project_manager.flat_config (consumer)
| |- src.ai_client._send_llama_native (consumer)
| |- src.ai_client.ollama_chat (consumer)
| |- src.ai_client._send_qwen (consumer)
| |- src.app_controller._on_comms_entry (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._repair_deepseek_history (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._execute_single_tool_call_async (consumer)
| |- src.models.from_dict (consumer)
| |- src.openai_compatible._to_dict_tool_call (consumer)
| |- src.ai_client._repair_anthropic_history (consumer)
| |- src.ai_client._strip_cache_controls (consumer)
| |- src.aggregate.run (consumer)
| |- src.models._save_config_to_disk (consumer)
| |- src.ai_client._dashscope_call (consumer)
| |- src.app_controller._start_track_logic_result (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._estimate_prompt_tokens (consumer)
| |- src.ai_client._append_comms (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._estimate_message_tokens (consumer)
| |- src.ai_client._add_history_cache_breakpoint (consumer)
| |- src.ai_client._pre_dispatch (consumer)
| |- src.models.from_dict (consumer)
| |- src.aggregate._build_files_section_from_items (consumer)
| |- src.ai_client._trim_minimax_history (consumer)
| |- src.app_controller._refresh_api_metrics (consumer)
| |- src.app_controller._start_track_logic (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.project_manager.migrate_from_legacy_config (consumer)
| |- src.ai_client._send_minimax (consumer)
| |- src.ai_client.send (consumer)
|- access_pattern: whole_struct
|- frequency: per_turn
|- result_coverage: 1 producers, 1 consumers
|- type_alias_coverage: 1 sites; 0 typed (0%); 1 untyped (100%)
|- result_coverage: 97 producers, 47 consumers
|- type_alias_coverage: 136 sites; 0 typed (0%); 136 untyped (100%)
|- cross_audit_findings: 0 findings
|- decomposition_cost: hold (470 us)
|- optimization_candidates: [0]
@@ -7,36 +7,272 @@
\ === memory_dim ===
"control" mem-dim
\ === producers (2 items) ===
"src.ai_client._build_anthropic_tools" "src\ai_client.py" 623 "producer" fn-ref
\ === producers (119 items) ===
"src.ai_client._extract_dashscope_tool_calls" "src\ai_client.py" 2754 "producer" fn-ref
"src.api_hook_client.get_warmup_wait" "src\api_hook_client.py" 332 "producer" fn-ref
"src.app_controller.wait" "src\app_controller.py" 5205 "producer" fn-ref
"src.ai_client._dashscope_call" "src\ai_client.py" 2716 "producer" fn-ref
"src.app_controller._pending_mma_spawn" "src\app_controller.py" 2772 "producer" fn-ref
"src.api_hook_client.wait_for_event" "src\api_hook_client.py" 136 "producer" fn-ref
"src.api_hook_client.clear_events" "src\api_hook_client.py" 129 "producer" fn-ref
"src.project_manager.get_all_tracks" "src\project_manager.py" 342 "producer" fn-ref
"src.app_controller._offload_entry_payload" "src\app_controller.py" 4240 "producer" fn-ref
"src.ai_client._strip_private_keys" "src\ai_client.py" 1464 "producer" fn-ref
"src.app_controller._api_get_diagnostics" "src\app_controller.py" 202 "producer" fn-ref
"src.app_controller.get_gui_state" "src\app_controller.py" 2829 "producer" fn-ref
"src.app_controller.load_config" "src\app_controller.py" 5142 "producer" fn-ref
"src.api_hook_client.get_warmup_status" "src\api_hook_client.py" 325 "producer" fn-ref
"src.api_hook_client.get_project" "src\api_hook_client.py" 367 "producer" fn-ref
"src.ai_client._build_deepseek_tools" "src\ai_client.py" 1148 "producer" fn-ref
"src.api_hook_client.get_mma_workers" "src\api_hook_client.py" 546 "producer" fn-ref
"src.models.to_dict" "src\models.py" 646 "producer" fn-ref
"src.api_hook_client.reject_patch" "src\api_hook_client.py" 288 "producer" fn-ref
"src.models.to_dict" "src\models.py" 406 "producer" fn-ref
"src.app_controller._api_get_session" "src\app_controller.py" 374 "producer" fn-ref
"src.ai_client._parse_tool_args_result" "src\ai_client.py" 741 "producer" fn-ref
"src.app_controller._api_pending_actions" "src\app_controller.py" 335 "producer" fn-ref
"src.models.to_dict" "src\models.py" 855 "producer" fn-ref
"src.project_manager.load_history" "src\project_manager.py" 209 "producer" fn-ref
"src.app_controller.get_context" "src\app_controller.py" 2892 "producer" fn-ref
"src.ai_client._build_chunked_context_blocks" "src\ai_client.py" 1281 "producer" fn-ref
"src.ai_client._get_anthropic_tools" "src\ai_client.py" 664 "producer" fn-ref
"src.api_hook_client.get_gui_state" "src\api_hook_client.py" 165 "producer" fn-ref
"src.models.to_dict" "src\models.py" 938 "producer" fn-ref
"src.models.to_dict" "src\models.py" 1059 "producer" fn-ref
"src.ai_client._get_deepseek_tools" "src\ai_client.py" 1194 "producer" fn-ref
"src.models.parse_history_entries" "src\models.py" 214 "producer" fn-ref
"src.api_hook_client.get_events" "src\api_hook_client.py" 124 "producer" fn-ref
"src.ai_client._pre_dispatch" "src\ai_client.py" 2089 "producer" fn-ref
"src.project_manager.str_to_entry" "src\project_manager.py" 75 "producer" fn-ref
"src.api_hook_client.post_project" "src\api_hook_client.py" 473 "producer" fn-ref
"src.models.to_dict" "src\models.py" 794 "producer" fn-ref
"src.api_hook_client.get_session" "src\api_hook_client.py" 502 "producer" fn-ref
"src.app_controller.token_stats" "src\app_controller.py" 2898 "producer" fn-ref
"src.api_hook_client.get_io_pool_status" "src\api_hook_client.py" 420 "producer" fn-ref
"src.api_hook_client.trigger_patch" "src\api_hook_client.py" 274 "producer" fn-ref
"src.api_hook_client.get_gui_health" "src\api_hook_client.py" 434 "producer" fn-ref
"src.ai_client.get_gemini_cache_stats" "src\ai_client.py" 1604 "producer" fn-ref
"src.app_controller._api_get_api_project" "src\app_controller.py" 188 "producer" fn-ref
"src.api_hook_client.get_status" "src\api_hook_client.py" 105 "producer" fn-ref
"src.app_controller._api_get_context" "src\app_controller.py" 398 "producer" fn-ref
"src.app_controller._api_token_stats" "src\app_controller.py" 417 "producer" fn-ref
"src.api_hook_client.get_context_state" "src\api_hook_client.py" 491 "producer" fn-ref
"src.api_hook_client.set_value" "src\api_hook_client.py" 212 "producer" fn-ref
"src.app_controller.get_mma_status" "src\app_controller.py" 2835 "producer" fn-ref
"src.api_hook_client.post_gui" "src\api_hook_client.py" 149 "producer" fn-ref
"src.api_hook_client.get_gui_diagnostics" "src\api_hook_client.py" 311 "producer" fn-ref
"src.app_controller._api_get_performance" "src\app_controller.py" 195 "producer" fn-ref
"src.app_controller._api_get_api_session" "src\app_controller.py" 170 "producer" fn-ref
"src.api_hook_client.get_mma_status" "src\api_hook_client.py" 539 "producer" fn-ref
"src.models.to_dict" "src\models.py" 1000 "producer" fn-ref
"src.models.to_dict" "src\models.py" 672 "producer" fn-ref
"src.models.to_dict" "src\models.py" 355 "producer" fn-ref
"src.aggregate.build_file_items" "src\aggregate.py" 158 "producer" fn-ref
"src.api_hook_client.get_startup_timeline" "src\api_hook_client.py" 353 "producer" fn-ref
"src.api_hook_client.get_node_status" "src\api_hook_client.py" 532 "producer" fn-ref
"src.api_hook_client.get_performance" "src\api_hook_client.py" 318 "producer" fn-ref
"src.ai_client._load_credentials" "src\ai_client.py" 282 "producer" fn-ref
"src.app_controller._api_get_gui_state" "src\app_controller.py" 123 "producer" fn-ref
"src.project_manager.default_project" "src\project_manager.py" 123 "producer" fn-ref
"src.api_hook_client.post_session" "src\api_hook_client.py" 117 "producer" fn-ref
"src.app_controller.get_performance" "src\app_controller.py" 2856 "producer" fn-ref
"src.project_manager.migrate_from_legacy_config" "src\project_manager.py" 253 "producer" fn-ref
"src.models.to_dict" "src\models.py" 486 "producer" fn-ref
"src.models.to_dict" "src\models.py" 913 "producer" fn-ref
"src.models.to_dict" "src\models.py" 596 "producer" fn-ref
"src.api_hook_client.push_event" "src\api_hook_client.py" 156 "producer" fn-ref
"src.api_hook_client.get_warmup_canaries" "src\api_hook_client.py" 342 "producer" fn-ref
"src.api_hook_client.drag" "src\api_hook_client.py" 230 "producer" fn-ref
"src.app_controller.pending_actions" "src\app_controller.py" 2874 "producer" fn-ref
"src.ai_client.get_token_stats" "src\ai_client.py" 3185 "producer" fn-ref
"src.models.to_dict" "src\models.py" 886 "producer" fn-ref
"src.app_controller.status" "src\app_controller.py" 2865 "producer" fn-ref
"src.models.to_dict" "src\models.py" 558 "producer" fn-ref
"src.api_hook_client.apply_patch" "src\api_hook_client.py" 281 "producer" fn-ref
"src.models._load_config_from_disk" "src\models.py" 186 "producer" fn-ref
"src.api_hook_client.post_project" "src\api_hook_client.py" 470 "producer" fn-ref
"src.app_controller._api_get_mma_status" "src\app_controller.py" 144 "producer" fn-ref
"src.api_hook_client.get_patch_status" "src\api_hook_client.py" 295 "producer" fn-ref
"src.app_controller.generate" "src\app_controller.py" 2868 "producer" fn-ref
"src.models.to_dict" "src\models.py" 441 "producer" fn-ref
"src.app_controller.get_api_project" "src\app_controller.py" 2853 "producer" fn-ref
"src.app_controller._api_status" "src\app_controller.py" 209 "producer" fn-ref
"src.project_manager.flat_config" "src\project_manager.py" 267 "producer" fn-ref
"src.models.to_dict" "src\models.py" 1024 "producer" fn-ref
"src.ai_client.ollama_chat" "src\ai_client.py" 2938 "producer" fn-ref
"src.api_hook_client.wait_for_project_switch" "src\api_hook_client.py" 389 "producer" fn-ref
"src.ai_client._build_anthropic_tools" "src\ai_client.py" 623 "producer" fn-ref
"src.models.to_dict" "src\models.py" 971 "producer" fn-ref
"src.api_hook_client.click" "src\api_hook_client.py" 223 "producer" fn-ref
"src.ai_client.get_comms_log" "src\ai_client.py" 273 "producer" fn-ref
"src.app_controller._api_generate" "src\app_controller.py" 221 "producer" fn-ref
"src.api_hook_client.select_list_item" "src\api_hook_client.py" 256 "producer" fn-ref
"src.models.to_dict" "src\models.py" 288 "producer" fn-ref
"src.api_hook_client.get_project_switch_status" "src\api_hook_client.py" 374 "producer" fn-ref
"src.models.to_dict" "src\models.py" 737 "producer" fn-ref
"src.project_manager.load_project" "src\project_manager.py" 186 "producer" fn-ref
"src.app_controller.get_session" "src\app_controller.py" 2883 "producer" fn-ref
"src.api_hook_client.get_system_telemetry" "src\api_hook_client.py" 524 "producer" fn-ref
"src.models.to_dict" "src\models.py" 618 "producer" fn-ref
"src.api_hook_client._make_request" "src\api_hook_client.py" 65 "producer" fn-ref
"src.app_controller.get_diagnostics" "src\app_controller.py" 2862 "producer" fn-ref
"src.app_controller.get_session_insights" "src\app_controller.py" 3049 "producer" fn-ref
"src.ai_client._content_block_to_dict" "src\ai_client.py" 1200 "producer" fn-ref
"src.api_hook_client.select_tab" "src\api_hook_client.py" 263 "producer" fn-ref
"src.app_controller._pending_mma_approval" "src\app_controller.py" 2776 "producer" fn-ref
"src.ai_client._add_bleed_derived" "src\ai_client.py" 3332 "producer" fn-ref
"src.models.to_dict" "src\models.py" 701 "producer" fn-ref
"src.api_hook_client.right_click" "src\api_hook_client.py" 237 "producer" fn-ref
"src.app_controller.get_api_session" "src\app_controller.py" 2847 "producer" fn-ref
"src.project_manager.default_discussion" "src\project_manager.py" 117 "producer" fn-ref
"src.ai_client._send_cli_round_result" "src\ai_client.py" 1746 "producer" fn-ref
"src.api_hook_client.get_financial_metrics" "src\api_hook_client.py" 520 "producer" fn-ref
\ === consumers (0 items) ===
\ === consumers (66 items) ===
"src.ai_client._invalidate_token_estimate" "src\ai_client.py" 1240 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 920 "consumer" fn-ref
"src.aggregate.build_markdown_from_items" "src\aggregate.py" 348 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 603 "consumer" fn-ref
"src.ai_client._create_gemini_cache_result" "src\ai_client.py" 1706 "consumer" fn-ref
"src.ai_client._send_grok" "src\ai_client.py" 2530 "consumer" fn-ref
"src.ai_client._strip_private_keys" "src\ai_client.py" 1464 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 506 "consumer" fn-ref
"src.ai_client._send_gemini_cli" "src\ai_client.py" 2019 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 814 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 893 "consumer" fn-ref
"src.ai_client._send_gemini" "src\ai_client.py" 1802 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 378 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 1038 "consumer" fn-ref
"src.ai_client._send_anthropic" "src\ai_client.py" 1405 "consumer" fn-ref
"src.project_manager.save_project" "src\project_manager.py" 229 "consumer" fn-ref
"src.ai_client._trim_anthropic_history" "src\ai_client.py" 1353 "consumer" fn-ref
"src.ai_client._send_llama" "src\ai_client.py" 2858 "consumer" fn-ref
"src.aggregate.build_tier3_context" "src\aggregate.py" 382 "consumer" fn-ref
"src.app_controller._offload_entry_payload" "src\app_controller.py" 4240 "consumer" fn-ref
"src.project_manager.format_discussion" "src\project_manager.py" 69 "consumer" fn-ref
"src.project_manager.entry_to_str" "src\project_manager.py" 49 "consumer" fn-ref
"src.ai_client._repair_minimax_history" "src\ai_client.py" 2462 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 1007 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 747 "consumer" fn-ref
"src.ai_client._strip_stale_file_refreshes" "src\ai_client.py" 1253 "consumer" fn-ref
"src.ai_client._send_deepseek" "src\ai_client.py" 2165 "consumer" fn-ref
"src.ai_client._add_bleed_derived" "src\ai_client.py" 3332 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 683 "consumer" fn-ref
"src.aggregate.build_markdown_no_history" "src\aggregate.py" 366 "consumer" fn-ref
"src.project_manager.flat_config" "src\project_manager.py" 267 "consumer" fn-ref
"src.ai_client._send_llama_native" "src\ai_client.py" 2958 "consumer" fn-ref
"src.ai_client.ollama_chat" "src\ai_client.py" 2938 "consumer" fn-ref
"src.ai_client._send_qwen" "src\ai_client.py" 2773 "consumer" fn-ref
"src.app_controller._on_comms_entry" "src\app_controller.py" 4282 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 712 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 866 "consumer" fn-ref
"src.ai_client._repair_deepseek_history" "src\ai_client.py" 2138 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 454 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 575 "consumer" fn-ref
"src.ai_client._execute_single_tool_call_async" "src\ai_client.py" 945 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 630 "consumer" fn-ref
"src.ai_client._repair_anthropic_history" "src\ai_client.py" 1381 "consumer" fn-ref
"src.ai_client._strip_cache_controls" "src\ai_client.py" 1291 "consumer" fn-ref
"src.aggregate.run" "src\aggregate.py" 479 "consumer" fn-ref
"src.models._save_config_to_disk" "src\models.py" 199 "consumer" fn-ref
"src.ai_client._dashscope_call" "src\ai_client.py" 2716 "consumer" fn-ref
"src.app_controller._start_track_logic_result" "src\app_controller.py" 4728 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 949 "consumer" fn-ref
"src.ai_client._estimate_prompt_tokens" "src\ai_client.py" 1243 "consumer" fn-ref
"src.ai_client._append_comms" "src\ai_client.py" 257 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 982 "consumer" fn-ref
"src.ai_client._estimate_message_tokens" "src\ai_client.py" 1218 "consumer" fn-ref
"src.ai_client._add_history_cache_breakpoint" "src\ai_client.py" 1299 "consumer" fn-ref
"src.ai_client._pre_dispatch" "src\ai_client.py" 2089 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 295 "consumer" fn-ref
"src.aggregate._build_files_section_from_items" "src\aggregate.py" 300 "consumer" fn-ref
"src.ai_client._trim_minimax_history" "src\ai_client.py" 2482 "consumer" fn-ref
"src.app_controller._refresh_api_metrics" "src\app_controller.py" 3074 "consumer" fn-ref
"src.app_controller._start_track_logic" "src\app_controller.py" 4721 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 416 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 656 "consumer" fn-ref
"src.models.from_dict" "src\models.py" 1072 "consumer" fn-ref
"src.project_manager.migrate_from_legacy_config" "src\project_manager.py" 253 "consumer" fn-ref
"src.ai_client._send_minimax" "src\ai_client.py" 2616 "consumer" fn-ref
"src.ai_client.send" "src\ai_client.py" 3208 "consumer" fn-ref
\ === access_pattern ===
"mixed" access-pattern
"whole_struct" access-pattern
\ === access_pattern_evidence (0 items) ===
\ === access_pattern_evidence (50 items) ===
"src.ai_client._invalidate_token_estimate" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.aggregate.build_markdown_from_items" "whole_struct" 0 "low" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._create_gemini_cache_result" "whole_struct" 0 "low" ap-evidence
"src.ai_client._send_grok" "whole_struct" 0 "low" ap-evidence
"src.ai_client._strip_private_keys" "whole_struct" 0 "low" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._send_gemini_cli" "whole_struct" 0 "low" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._send_gemini" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._send_anthropic" "whole_struct" 0 "low" ap-evidence
"src.project_manager.save_project" "mixed" 2 "high" ap-evidence
"src.ai_client._trim_anthropic_history" "whole_struct" 1 "high" ap-evidence
"src.ai_client._send_llama" "whole_struct" 0 "low" ap-evidence
"src.aggregate.build_tier3_context" "whole_struct" 0 "low" ap-evidence
"src.app_controller._offload_entry_payload" "whole_struct" 0 "low" ap-evidence
"src.project_manager.format_discussion" "whole_struct" 0 "low" ap-evidence
"src.project_manager.entry_to_str" "whole_struct" 1 "high" ap-evidence
"src.ai_client._repair_minimax_history" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._strip_stale_file_refreshes" "whole_struct" 0 "low" ap-evidence
"src.ai_client._send_deepseek" "whole_struct" 0 "low" ap-evidence
"src.ai_client._add_bleed_derived" "field_by_field" 9 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.aggregate.build_markdown_no_history" "whole_struct" 0 "low" ap-evidence
"src.project_manager.flat_config" "whole_struct" 1 "high" ap-evidence
"src.ai_client._send_llama_native" "whole_struct" 0 "low" ap-evidence
"src.ai_client.ollama_chat" "whole_struct" 0 "low" ap-evidence
"src.ai_client._send_qwen" "whole_struct" 0 "low" ap-evidence
"src.app_controller._on_comms_entry" "field_by_field" 10 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._repair_deepseek_history" "whole_struct" 1 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._execute_single_tool_call_async" "mixed" 2 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._repair_anthropic_history" "whole_struct" 1 "high" ap-evidence
"src.ai_client._strip_cache_controls" "whole_struct" 0 "low" ap-evidence
"src.aggregate.run" "field_by_field" 3 "high" ap-evidence
"src.models._save_config_to_disk" "whole_struct" 0 "low" ap-evidence
"src.ai_client._dashscope_call" "whole_struct" 0 "low" ap-evidence
"src.app_controller._start_track_logic_result" "field_by_field" 17 "high" ap-evidence
"src.models.from_dict" "mixed" 2 "high" ap-evidence
"src.ai_client._estimate_prompt_tokens" "whole_struct" 0 "low" ap-evidence
\ === frequency ===
"per_turn" frequency
\ === frequency_evidence (2 items) ===
"src.ai_client._build_anthropic_tools" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.ai_client._build_deepseek_tools" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
\ === frequency_evidence (5 items) ===
"src.ai_client._extract_dashscope_tool_calls" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.api_hook_client.get_warmup_wait" "per_turn" "static_analysis" "producer from src\api_hook_client.py" freq-evidence
"src.app_controller.wait" "per_turn" "static_analysis" "producer from src\app_controller.py" freq-evidence
"src.ai_client._dashscope_call" "per_turn" "static_analysis" "producer from src\ai_client.py" freq-evidence
"src.app_controller._pending_mma_spawn" "per_turn" "static_analysis" "producer from src\app_controller.py" freq-evidence
\ === result_coverage ===
2 2 0 0 result-coverage
98 98 46 0 result-coverage
\ === type_alias_coverage ===
0 0 0 type-alias-coverage
135 0 135 type-alias-coverage
\ === cross_audit_findings ===
"audit_optional_in_3_files" 76 "src\ai_client.py" 159 "76 sites" cross-audit-finding
5 cross-audit-findings
\ === decomposition_cost ===
470 0 0 "insufficient_data" "ToolDefinition: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern." nil 5 true decomp-cost
470 0 70 "hold" "ToolDefinition: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern." nil 5 true decomp-cost
\ === optimization_candidates (0 items) ===
@@ -6,81 +6,421 @@
## Pipeline summary
- Producers: 2
- Consumers: 0
- Distinct producer fqnames: 2
- Distinct consumer fqnames: 0
- Access pattern (aggregate): mixed
- Producers: 119
- Consumers: 66
- Distinct producer fqnames: 98
- Distinct consumer fqnames: 46
- Access pattern (aggregate): whole_struct
- Frequency (aggregate): per_turn
- Decomposition direction: insufficient_data
- Decomposition direction: hold
- Struct field count (estimated): 5
## Producers (2)
## Producers (119)
### `src\ai_client.py` (2 producers)
### `src\aggregate.py` (1 producer)
- `src.ai_client._build_anthropic_tools` (line 623)
- `src.aggregate.build_file_items` (line 158)
### `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._add_bleed_derived` (line 3332)
- `src.ai_client._send_cli_round_result` (line 1746)
## Consumers (0)
### `src\api_hook_client.py` (39 producers)
_(none)_
- `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_gui_health` (line 434)
- `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.right_click` (line 237)
- `src.api_hook_client.get_financial_metrics` (line 520)
### `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\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 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 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 618)
- `src.models.to_dict` (line 701)
### `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.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)
## 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\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._pre_dispatch` (line 2089)
- `src.ai_client._trim_minimax_history` (line 2482)
- `src.ai_client._send_minimax` (line 2616)
- `src.ai_client.send` (line 3208)
### `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._refresh_api_metrics` (line 3074)
- `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._save_config_to_disk` (line 199)
- `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\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.migrate_from_legacy_config` (line 253)
## Field access matrix
_(no field accesses detected)_
| 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| `_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 | . | . | . | . | . | . |
| `_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` | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
_... 23 more fields_
## Access pattern
**Dominant pattern:** mixed
**Evidence count:** 0
**Dominant pattern:** whole_struct
**Evidence count:** 50
**Per-function pattern distribution:**
- `whole_struct`: 28 functions (56%)
- `mixed`: 18 functions (36%)
- `field_by_field`: 4 functions (8%)
## SSDL Sketch for `ToolDefinition`
```
[Q:ToolDefinition entry-point] -> [Q:PCG lookup]
-> [1: _invalidate_token_estimate] [B:check] (branches=0)
-> [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]
-> [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)
-> [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)
-> [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: _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)
-> [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)
-> [T:done]
```
**Effective codepaths:** 0 (sum of 2^branches across 0 consumers)
**Total branch points:** 0
**Nil-check functions:** 0
**Effective codepaths:** 40140116231395706750390 (sum of 2^branches across 66 consumers)
**Total branch points:** 541
**Nil-check functions:** 9
**Defusing opportunities:**
- **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 0 field-check branches to 1 cache lookup.
- Effective codepaths: 0 -> 1
- **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
- **Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`**: Wrap the aggregate in a generational handle (index + generation). Validation is one comparison; mismatch returns the nil sentinel. Reduces N lifetime branches to 1 handle validation + sentinel return.
- Effective codepaths: 40140116231395706750390 -> 66
## Frequency
**Dominant frequency:** per_turn
**Evidence count:** 2
**Evidence count:** 5
**Per-function frequency distribution:**
- `per_turn`: 2 functions
- `per_turn`: 5 functions
## Result coverage
**Summary:** 2 producers, 0 consumers
**Summary:** 98 producers, 46 consumers
| metric | value |
|---|---|
| total producers | 2 |
| result producers | 2 |
| total consumers | 0 |
| total producers | 98 |
| result producers | 98 |
| total consumers | 46 |
| result consumers | 0 |
## Type alias coverage
**Summary:** 0 sites
**Summary:** 135 sites; 0 typed (0%); 135 untyped (100%)
| metric | value |
|---|---|
| total field-access sites | 0 |
| total field-access sites | 135 |
| typed sites (canonical field) | 0 |
| untyped sites (wildcard) | 0 |
| untyped sites (wildcard) | 135 |
## Cross-audit findings
@@ -92,15 +432,59 @@ _(no field accesses detected)_
**Current cost estimate:** 470 us/turn
**Componentize savings:** 0 us/turn
**Unify savings:** 0 us/turn
**Recommended direction:** insufficient_data
**Rationale:** ToolDefinition: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern.
**Unify savings:** 70 us/turn
**Recommended direction:** hold
**Rationale:** ToolDefinition: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern.
**Struct field count (estimated):** 5
**Struct frozen:** True
## Struct shape (inferred from producer returns)
_(no field access data; cannot infer shape)_
| 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 |
| `estimated_prompt_tokens` | 1 | used |
| `max_prompt_tokens` | 1 | used |
| `utilization_pct` | 1 | used |
| `headroom` | 1 | used |
| `would_trim` | 1 | used |
| `sys_tokens` | 1 | used |
| `tool_tokens` | 1 | used |
| `history_tokens` | 1 | used |
| `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 |
| `_topological_sort_tickets_result` | 1 | used |
| `active_project_root` | 1 | used |
| `event_queue` | 1 | used |
| `engines` | 1 | used |
| `project` | 1 | used |
| `active_discussion` | 1 | used |
| `submit_io` | 1 | used |
| `tracks` | 1 | used |
| `config` | 1 | used |
| `mma_tier_usage` | 1 | used |
| `_pending_gui_tasks` | 1 | used |
| `mma_step_mode` | 1 | used |
| `active_project_path` | 1 | used |
## Optimization candidates
@@ -108,13 +492,71 @@ _(no optimization candidates generated)_
## Verdict
ToolDefinition: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern.
ToolDefinition: access_pattern=whole_struct, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: hold because the current shape matches the access pattern.
## Evidence appendix
### Access pattern evidence
| function | pattern | field_accesses | confidence |
|---|---|---|---|
| `src.ai_client._invalidate_token_estimate` | `whole_struct` | `pop`=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.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.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.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 |
### Frequency evidence
| function | frequency | source | note |
|---|---|---|---|
| `src.ai_client._build_anthropic_tools` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `src.ai_client._build_deepseek_tools` | `per_turn` | `static_analysis` | producer from src\ai_client.py |
| `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 |
@@ -1,14 +1,197 @@
Metadata: ToolDefinition
|- kind: typealias
|- memory_dim: control
|- producers: [2]
| |- src.ai_client._build_anthropic_tools (producer)
|- producers: [119]
| |- src.ai_client._extract_dashscope_tool_calls (producer)
| |- src.api_hook_client.get_warmup_wait (producer)
| |- src.app_controller.wait (producer)
| |- src.ai_client._dashscope_call (producer)
| |- src.app_controller._pending_mma_spawn (producer)
| |- src.api_hook_client.wait_for_event (producer)
| |- src.api_hook_client.clear_events (producer)
| |- src.project_manager.get_all_tracks (producer)
| |- src.app_controller._offload_entry_payload (producer)
| |- src.ai_client._strip_private_keys (producer)
| |- src.app_controller._api_get_diagnostics (producer)
| |- src.app_controller.get_gui_state (producer)
| |- src.app_controller.load_config (producer)
| |- src.api_hook_client.get_warmup_status (producer)
| |- src.api_hook_client.get_project (producer)
| |- src.ai_client._build_deepseek_tools (producer)
|- consumers: [0]
|- access_pattern: mixed
| |- src.api_hook_client.get_mma_workers (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.reject_patch (producer)
| |- src.models.to_dict (producer)
| |- src.app_controller._api_get_session (producer)
| |- src.ai_client._parse_tool_args_result (producer)
| |- src.app_controller._api_pending_actions (producer)
| |- src.models.to_dict (producer)
| |- src.project_manager.load_history (producer)
| |- src.app_controller.get_context (producer)
| |- src.ai_client._build_chunked_context_blocks (producer)
| |- src.ai_client._get_anthropic_tools (producer)
| |- src.api_hook_client.get_gui_state (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.ai_client._get_deepseek_tools (producer)
| |- src.models.parse_history_entries (producer)
| |- src.api_hook_client.get_events (producer)
| |- src.ai_client._pre_dispatch (producer)
| |- src.project_manager.str_to_entry (producer)
| |- src.api_hook_client.post_project (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.get_session (producer)
| |- src.app_controller.token_stats (producer)
| |- src.api_hook_client.get_io_pool_status (producer)
| |- src.api_hook_client.trigger_patch (producer)
| |- src.api_hook_client.get_gui_health (producer)
| |- src.ai_client.get_gemini_cache_stats (producer)
| |- src.app_controller._api_get_api_project (producer)
| |- src.api_hook_client.get_status (producer)
| |- src.app_controller._api_get_context (producer)
| |- src.app_controller._api_token_stats (producer)
| |- src.api_hook_client.get_context_state (producer)
| |- src.api_hook_client.set_value (producer)
| |- src.app_controller.get_mma_status (producer)
| |- src.api_hook_client.post_gui (producer)
| |- src.api_hook_client.get_gui_diagnostics (producer)
| |- src.app_controller._api_get_performance (producer)
| |- src.app_controller._api_get_api_session (producer)
| |- src.api_hook_client.get_mma_status (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.aggregate.build_file_items (producer)
| |- src.api_hook_client.get_startup_timeline (producer)
| |- src.api_hook_client.get_node_status (producer)
| |- src.api_hook_client.get_performance (producer)
| |- src.ai_client._load_credentials (producer)
| |- src.app_controller._api_get_gui_state (producer)
| |- src.project_manager.default_project (producer)
| |- src.api_hook_client.post_session (producer)
| |- src.app_controller.get_performance (producer)
| |- src.project_manager.migrate_from_legacy_config (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.push_event (producer)
| |- src.api_hook_client.get_warmup_canaries (producer)
| |- src.api_hook_client.drag (producer)
| |- src.app_controller.pending_actions (producer)
| |- src.ai_client.get_token_stats (producer)
| |- src.models.to_dict (producer)
| |- src.app_controller.status (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.apply_patch (producer)
| |- src.models._load_config_from_disk (producer)
| |- src.api_hook_client.post_project (producer)
| |- src.app_controller._api_get_mma_status (producer)
| |- src.api_hook_client.get_patch_status (producer)
| |- src.app_controller.generate (producer)
| |- src.models.to_dict (producer)
| |- src.app_controller.get_api_project (producer)
| |- src.app_controller._api_status (producer)
| |- src.project_manager.flat_config (producer)
| |- src.models.to_dict (producer)
| |- src.ai_client.ollama_chat (producer)
| |- src.api_hook_client.wait_for_project_switch (producer)
| |- src.ai_client._build_anthropic_tools (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.click (producer)
| |- src.ai_client.get_comms_log (producer)
| |- src.app_controller._api_generate (producer)
| |- src.api_hook_client.select_list_item (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.get_project_switch_status (producer)
| |- src.models.to_dict (producer)
| |- src.project_manager.load_project (producer)
| |- src.app_controller.get_session (producer)
| |- src.api_hook_client.get_system_telemetry (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client._make_request (producer)
| |- src.app_controller.get_diagnostics (producer)
| |- src.app_controller.get_session_insights (producer)
| |- src.ai_client._content_block_to_dict (producer)
| |- src.api_hook_client.select_tab (producer)
| |- src.app_controller._pending_mma_approval (producer)
| |- src.ai_client._add_bleed_derived (producer)
| |- src.models.to_dict (producer)
| |- src.api_hook_client.right_click (producer)
| |- src.app_controller.get_api_session (producer)
| |- src.project_manager.default_discussion (producer)
| |- src.ai_client._send_cli_round_result (producer)
| |- src.api_hook_client.get_financial_metrics (producer)
|- consumers: [66]
| |- src.ai_client._invalidate_token_estimate (consumer)
| |- src.models.from_dict (consumer)
| |- src.aggregate.build_markdown_from_items (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._create_gemini_cache_result (consumer)
| |- src.ai_client._send_grok (consumer)
| |- src.ai_client._strip_private_keys (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._send_gemini_cli (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._send_gemini (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._send_anthropic (consumer)
| |- src.project_manager.save_project (consumer)
| |- src.ai_client._trim_anthropic_history (consumer)
| |- src.ai_client._send_llama (consumer)
| |- src.aggregate.build_tier3_context (consumer)
| |- src.app_controller._offload_entry_payload (consumer)
| |- src.project_manager.format_discussion (consumer)
| |- src.project_manager.entry_to_str (consumer)
| |- src.ai_client._repair_minimax_history (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._strip_stale_file_refreshes (consumer)
| |- src.ai_client._send_deepseek (consumer)
| |- src.ai_client._add_bleed_derived (consumer)
| |- src.models.from_dict (consumer)
| |- src.aggregate.build_markdown_no_history (consumer)
| |- src.project_manager.flat_config (consumer)
| |- src.ai_client._send_llama_native (consumer)
| |- src.ai_client.ollama_chat (consumer)
| |- src.ai_client._send_qwen (consumer)
| |- src.app_controller._on_comms_entry (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._repair_deepseek_history (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._execute_single_tool_call_async (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._repair_anthropic_history (consumer)
| |- src.ai_client._strip_cache_controls (consumer)
| |- src.aggregate.run (consumer)
| |- src.models._save_config_to_disk (consumer)
| |- src.ai_client._dashscope_call (consumer)
| |- src.app_controller._start_track_logic_result (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._estimate_prompt_tokens (consumer)
| |- src.ai_client._append_comms (consumer)
| |- src.models.from_dict (consumer)
| |- src.ai_client._estimate_message_tokens (consumer)
| |- src.ai_client._add_history_cache_breakpoint (consumer)
| |- src.ai_client._pre_dispatch (consumer)
| |- src.models.from_dict (consumer)
| |- src.aggregate._build_files_section_from_items (consumer)
| |- src.ai_client._trim_minimax_history (consumer)
| |- src.app_controller._refresh_api_metrics (consumer)
| |- src.app_controller._start_track_logic (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.models.from_dict (consumer)
| |- src.project_manager.migrate_from_legacy_config (consumer)
| |- src.ai_client._send_minimax (consumer)
| |- src.ai_client.send (consumer)
|- access_pattern: whole_struct
|- frequency: per_turn
|- result_coverage: 2 producers, 0 consumers
|- type_alias_coverage: 0 sites
|- result_coverage: 98 producers, 46 consumers
|- type_alias_coverage: 135 sites; 0 typed (0%); 135 untyped (100%)
|- cross_audit_findings: 1 findings
|- decomposition_cost: insufficient_data (470 us)
|- decomposition_cost: hold (470 us)
|- optimization_candidates: [0]
File diff suppressed because it is too large Load Diff
@@ -6,7 +6,7 @@
| FileItem | 0 | 0 | 0 | 0 | 0 | 0 |
| FileItems | 0 | 0 | 0 | 0 | 0 | 0 |
| CommsLogEntry | 0 | 0 | 0 | 0 | 0 | 0 |
| CommsLog | 0 | 0 | 0 | 0 | 0 | 0 |
| CommsLog | 0 | 0 | 1 | 0 | 0 | 1 |
| HistoryMessage | 0 | 0 | 0 | 0 | 0 | 0 |
| History | 0 | 0 | 0 | 0 | 0 | 0 |
| ToolDefinition | 0 | 0 | 1 | 0 | 0 | 1 |
@@ -4,30 +4,66 @@ Fields that appear in producer return shapes but are never read by any consumer.
### `Metadata`
Fields read by at least one consumer: 55
Fields read by at least one consumer: 53
### `FileItem`
Fields read by at least one consumer: 43
### `FileItems`
Fields read by at least one consumer: 1
Fields read by at least one consumer: 5
| field | read count |
|---|---|
| `_attr_name` | 1 |
| `_cached` | 1 |
| `_module_name` | 1 |
| `_report_worker_error` | 1 |
| `append` | 2 |
### `CommsLogEntry`
Fields read by at least one consumer: 43
### `CommsLog`
Fields read by at least one consumer: 4
| field | read count |
|---|---|
| `_attr_name` | 1 |
| `_cached` | 1 |
| `_module_name` | 1 |
| `_report_worker_error` | 1 |
### `HistoryMessage`
Fields read by at least one consumer: 2
Fields read by at least one consumer: 45
### `History`
Fields read by at least one consumer: 6
| field | read count |
|---|---|
| `_attr_name` | 1 |
| `_cached` | 1 |
| `_module_name` | 1 |
| `_report_worker_error` | 1 |
| `lock` | 2 |
| `messages` | 2 |
### `ToolDefinition`
Fields read by at least one consumer: 43
### `ToolCall`
Fields read by at least one consumer: 1
Fields read by at least one consumer: 44
| field | read count |
|---|---|
| `to_dict` | 1 |
@@ -4,15 +4,15 @@
| Aggregate | Producers | Consumers | Struct fields | Current cost (us/turn) | Direction | Actionable savings (us/turn) |
|---|---|---|---|---|---|---|
| `Metadata` | 117 | 66 | 10 | 720 | `hold` | 0 |
| `FileItem` | 0 | 0 | 5 | 470 | `insufficient_data` | 0 |
| `FileItems` | 0 | 4 | 5 | 470 | `hold` | 70 |
| `CommsLogEntry` | 0 | 0 | 5 | 470 | `insufficient_data` | 0 |
| `CommsLog` | 0 | 0 | 5 | 470 | `insufficient_data` | 0 |
| `HistoryMessage` | 1 | 2 | 5 | 470 | `insufficient_data` | 0 |
| `History` | 0 | 0 | 5 | 470 | `insufficient_data` | 0 |
| `ToolDefinition` | 2 | 0 | 5 | 470 | `insufficient_data` | 0 |
| `ToolCall` | 1 | 1 | 5 | 470 | `hold` | 70 |
| `Metadata` | 483 | 752 | 6 | 520 | `hold` | 0 |
| `FileItem` | 117 | 66 | 5 | 470 | `hold` | 70 |
| `FileItems` | 6 | 9 | 5 | 470 | `hold` | 70 |
| `CommsLogEntry` | 117 | 66 | 5 | 470 | `hold` | 70 |
| `CommsLog` | 6 | 5 | 5 | 470 | `hold` | 70 |
| `HistoryMessage` | 118 | 68 | 5 | 470 | `hold` | 70 |
| `History` | 7 | 7 | 5 | 470 | `hold` | 70 |
| `ToolDefinition` | 119 | 66 | 5 | 470 | `hold` | 70 |
| `ToolCall` | 118 | 67 | 5 | 470 | `hold` | 70 |
| `Result` | 0 | 0 | 5 | 470 | `insufficient_data` | 0 |
## Aggregates flagged for refactoring
@@ -23,10 +23,4 @@ _(no aggregates currently flagged for refactoring; most have 'hold' status)_
| Aggregate | Reason |
|---|---|
| `FileItem` | FileItem: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern. |
| `CommsLogEntry` | CommsLogEntry: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern. |
| `CommsLog` | CommsLog: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern. |
| `HistoryMessage` | HistoryMessage: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern. |
| `History` | History: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern. |
| `ToolDefinition` | ToolDefinition: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern. |
| `Result` | Result: access_pattern=mixed, frequency=per_turn, struct_field_count=5, struct_frozen=True. Recommended: insufficient_data because runtime profiling is needed to determine the dominant pattern. |
@@ -4,17 +4,78 @@ Cross-aggregate analysis of which fields are accessed how often across the codeb
| aggregate | field | total accesses |
|---|---|---|
| `CommsLog` | `_report_worker_error` | 1 |
| `CommsLog` | `_module_name` | 1 |
| `CommsLog` | `_attr_name` | 1 |
| `CommsLog` | `_cached` | 1 |
| `CommsLogEntry` | `get` | 33 |
| `CommsLogEntry` | `content` | 16 |
| `CommsLogEntry` | `marker` | 16 |
| `CommsLogEntry` | `pop` | 6 |
| `CommsLogEntry` | `files` | 5 |
| `CommsLogEntry` | `session_usage` | 5 |
| `CommsLogEntry` | `_pending_history_adds_lock` | 4 |
| `CommsLogEntry` | `_pending_history_adds` | 4 |
| `CommsLogEntry` | `ai_status` | 4 |
| `CommsLogEntry` | `append` | 3 |
| `FileItem` | `get` | 33 |
| `FileItem` | `content` | 16 |
| `FileItem` | `marker` | 16 |
| `FileItem` | `pop` | 6 |
| `FileItem` | `files` | 5 |
| `FileItem` | `session_usage` | 5 |
| `FileItem` | `_pending_history_adds_lock` | 4 |
| `FileItem` | `_pending_history_adds` | 4 |
| `FileItem` | `ai_status` | 4 |
| `FileItem` | `append` | 3 |
| `FileItems` | `append` | 2 |
| `HistoryMessage` | `lock` | 2 |
| `HistoryMessage` | `messages` | 2 |
| `Metadata` | `get` | 39 |
| `Metadata` | `content` | 21 |
| `Metadata` | `marker` | 21 |
| `Metadata` | `pop` | 10 |
| `Metadata` | `session_usage` | 7 |
| `Metadata` | `files` | 5 |
| `Metadata` | `ai_status` | 5 |
| `FileItems` | `_report_worker_error` | 1 |
| `FileItems` | `_module_name` | 1 |
| `FileItems` | `_attr_name` | 1 |
| `FileItems` | `_cached` | 1 |
| `History` | `lock` | 2 |
| `History` | `messages` | 2 |
| `History` | `_report_worker_error` | 1 |
| `History` | `_module_name` | 1 |
| `History` | `_attr_name` | 1 |
| `History` | `_cached` | 1 |
| `HistoryMessage` | `get` | 33 |
| `HistoryMessage` | `content` | 15 |
| `HistoryMessage` | `marker` | 15 |
| `HistoryMessage` | `pop` | 6 |
| `HistoryMessage` | `files` | 5 |
| `HistoryMessage` | `session_usage` | 5 |
| `HistoryMessage` | `_pending_history_adds_lock` | 4 |
| `HistoryMessage` | `_pending_history_adds` | 4 |
| `HistoryMessage` | `ai_status` | 4 |
| `HistoryMessage` | `append` | 3 |
| `Metadata` | `get` | 13 |
| `Metadata` | `active_tier` | 6 |
| `Metadata` | `mma_tier_usage` | 6 |
| `Metadata` | `active_track` | 5 |
| `Metadata` | `session_usage` | 5 |
| `Metadata` | `files` | 4 |
| `Metadata` | `_size` | 4 |
| `Metadata` | `_pending_history_adds_lock` | 4 |
| `Metadata` | `_pending_history_adds` | 4 |
| `Metadata` | `append` | 3 |
| `ToolCall` | `to_dict` | 1 |
| `Metadata` | `parent` | 4 |
| `ToolCall` | `get` | 33 |
| `ToolCall` | `content` | 16 |
| `ToolCall` | `marker` | 16 |
| `ToolCall` | `pop` | 6 |
| `ToolCall` | `files` | 5 |
| `ToolCall` | `session_usage` | 5 |
| `ToolCall` | `_pending_history_adds_lock` | 4 |
| `ToolCall` | `_pending_history_adds` | 4 |
| `ToolCall` | `ai_status` | 4 |
| `ToolCall` | `append` | 3 |
| `ToolDefinition` | `get` | 33 |
| `ToolDefinition` | `content` | 16 |
| `ToolDefinition` | `marker` | 16 |
| `ToolDefinition` | `pop` | 6 |
| `ToolDefinition` | `files` | 5 |
| `ToolDefinition` | `session_usage` | 5 |
| `ToolDefinition` | `_pending_history_adds_lock` | 4 |
| `ToolDefinition` | `_pending_history_adds` | 4 |
| `ToolDefinition` | `ai_status` | 4 |
| `ToolDefinition` | `append` | 3 |
@@ -6,32 +6,90 @@ Functions on the per-LLM-turn path (high-frequency consumers).
### `Metadata`
| function | pattern | total field accesses |
|---|---|---|
| `src.app_controller._on_comms_entry` | `field_by_field` | 28 |
| `src.app_controller._handle_mma_state_update` | `field_by_field` | 23 |
| `src.file_cache.walk` | `field_by_field` | 6 |
| `src.project_manager.save_project` | `mixed` | 5 |
| `src.code_path_audit.synthesize_aggregate_profile` | `whole_struct` | 5 |
### `FileItem`
| function | pattern | total field accesses |
|---|---|---|
| `src.app_controller._on_comms_entry` | `field_by_field` | 28 |
| `src.app_controller._start_track_logic_result` | `field_by_field` | 25 |
| `src.app_controller._refresh_api_metrics` | `field_by_field` | 15 |
| `src.ai_client._add_bleed_derived` | `field_by_field` | 11 |
| `src.aggregate.run` | `field_by_field` | 10 |
| `src.project_manager.flat_config` | `whole_struct` | 7 |
### `FileItems`
| function | pattern | total field accesses |
|---|---|---|
| `src.gui_2.__init__` | `field_by_field` | 3 |
| `src.ai_client.run_with_tool_loop` | `whole_struct` | 2 |
| `src.ai_client._build_file_diff_text` | `whole_struct` | 0 |
| `src.app_controller._topological_sort_tickets_result` | `whole_struct` | 1 |
| `src.app_controller._symbol_resolution_result` | `whole_struct` | 0 |
| `src.ai_client._build_file_context_text` | `whole_struct` | 0 |
| `src.ai_client._reread_file_items_result` | `whole_struct` | 0 |
### `CommsLogEntry`
| function | pattern | total field accesses |
|---|---|---|
| `src.app_controller._on_comms_entry` | `field_by_field` | 28 |
| `src.app_controller._start_track_logic_result` | `field_by_field` | 25 |
| `src.ai_client._add_bleed_derived` | `field_by_field` | 11 |
| `src.aggregate.run` | `field_by_field` | 10 |
| `src.project_manager.flat_config` | `whole_struct` | 7 |
### `CommsLog`
| function | pattern | total field accesses |
|---|---|---|
| `src.gui_2.__init__` | `field_by_field` | 3 |
| `src.app_controller._topological_sort_tickets_result` | `whole_struct` | 1 |
| `src.app_controller._symbol_resolution_result` | `whole_struct` | 0 |
| `src.app_controller._serialize_tool_calls_result` | `whole_struct` | 0 |
| `src.project_manager.calculate_track_progress` | `whole_struct` | 0 |
### `HistoryMessage`
| function | pattern | total field accesses |
|---|---|---|
| `src.app_controller._on_comms_entry` | `field_by_field` | 28 |
| `src.app_controller._start_track_logic_result` | `field_by_field` | 25 |
| `src.ai_client._add_bleed_derived` | `field_by_field` | 11 |
| `src.aggregate.run` | `field_by_field` | 10 |
| `src.project_manager.flat_config` | `whole_struct` | 7 |
### `History`
| function | pattern | total field accesses |
|---|---|---|
| `src.gui_2.__init__` | `field_by_field` | 3 |
| `src.provider_state.append` | `mixed` | 2 |
| `src.provider_state.replace_all` | `mixed` | 2 |
| `src.app_controller._topological_sort_tickets_result` | `whole_struct` | 1 |
| `src.app_controller._symbol_resolution_result` | `whole_struct` | 0 |
### `ToolDefinition`
| function | pattern | total field accesses |
|---|---|---|
| `src.app_controller._on_comms_entry` | `field_by_field` | 28 |
| `src.app_controller._start_track_logic_result` | `field_by_field` | 25 |
| `src.ai_client._add_bleed_derived` | `field_by_field` | 11 |
| `src.aggregate.run` | `field_by_field` | 10 |
| `src.project_manager.flat_config` | `whole_struct` | 7 |
### `ToolCall`
| function | pattern | total field accesses |
|---|---|---|
| `src.openai_compatible._to_dict_tool_call` | `whole_struct` | 1 |
| `src.app_controller._on_comms_entry` | `field_by_field` | 28 |
| `src.app_controller._start_track_logic_result` | `field_by_field` | 25 |
| `src.ai_client._add_bleed_derived` | `field_by_field` | 11 |
| `src.aggregate.run` | `field_by_field` | 10 |
| `src.project_manager.flat_config` | `whole_struct` | 7 |
@@ -11,14 +11,21 @@ Cross-aggregate view of codebase organization. Verdicts derived from SSDL analys
| file | aggregates produced | aggregates consumed |
|---|---|---|
| `src\ai_client.py` | 2 | 2 |
| `src\aggregate.py` | 1 | 1 |
| `src\app_controller.py` | 1 | 1 |
| `src\models.py` | 1 | 1 |
| `src\openai_compatible.py` | 1 | 1 |
| `src\project_manager.py` | 1 | 1 |
| `src\provider_state.py` | 1 | 1 |
| `src\api_hook_client.py` | 1 | 0 |
| `src\ai_client.py` | 9 | 7 |
| `src\app_controller.py` | 6 | 9 |
| `src\project_manager.py` | 6 | 9 |
| `src\aggregate.py` | 6 | 6 |
| `src\models.py` | 6 | 6 |
| `src\gui_2.py` | 4 | 4 |
| `src\api_hook_client.py` | 6 | 1 |
| `src\provider_state.py` | 3 | 3 |
| `src\openai_compatible.py` | 2 | 2 |
| `src\api_hooks.py` | 1 | 1 |
| `src\api_hooks_helpers.py` | 1 | 1 |
| `src\beads_client.py` | 1 | 1 |
| `src\code_path_audit.py` | 1 | 1 |
| `src\code_path_audit_analysis.py` | 1 | 1 |
| `src\code_path_audit_cross_audit.py` | 1 | 1 |
### Files with high coupling (producers + consumers >= 8)
@@ -26,20 +33,26 @@ These files are the central nervous system of the codebase. Changes ripple acros
| file | coupling score (producers + consumers) |
|---|---|
| `src\ai_client.py` | 16 (high) |
| `src\app_controller.py` | 15 (high) |
| `src\project_manager.py` | 15 (high) |
| `src\aggregate.py` | 12 (high) |
| `src\models.py` | 12 (high) |
| `src\gui_2.py` | 8 (high) |
## Per-aggregate organization verdict
| Aggregate | Verdict | Notes |
|---|---|---|
| `Metadata` | needs restructuring | 9 nil checks; 0% field efficiency; 40140116231395706750390 effective codepaths |
| `FileItem` | needs restructuring | 0% field efficiency |
| `FileItems` | needs restructuring | 2 nil checks; 0% field efficiency; 8388712 effective codepaths |
| `CommsLogEntry` | needs restructuring | 0% field efficiency |
| `Metadata` | needs restructuring | 74 nil checks; 0% field efficiency; 40142494212284116997693 effective codepaths |
| `FileItem` | needs restructuring | 9 nil checks; 0% field efficiency; 40140116231395706750390 effective codepaths |
| `FileItems` | needs restructuring | 2 nil checks; 0% field efficiency; 8388739 effective codepaths |
| `CommsLogEntry` | needs restructuring | 9 nil checks; 0% field efficiency; 40140116231395706750390 effective codepaths |
| `CommsLog` | needs restructuring | 0% field efficiency |
| `HistoryMessage` | needs restructuring | 0% field efficiency |
| `HistoryMessage` | needs restructuring | 9 nil checks; 0% field efficiency; 40140116231395706750394 effective codepaths |
| `History` | needs restructuring | 0% field efficiency |
| `ToolDefinition` | needs restructuring | 0% field efficiency |
| `ToolCall` | needs restructuring | 0% field efficiency |
| `ToolDefinition` | needs restructuring | 9 nil checks; 0% field efficiency; 40140116231395706750390 effective codepaths |
| `ToolCall` | needs restructuring | 9 nil checks; 0% field efficiency; 40140116231395706750391 effective codepaths |
| `Result` | needs restructuring | 0% field efficiency |
**Tally:** 0 well-organized, 0 moderate, 10 needs restructuring
@@ -48,18 +61,18 @@ These files are the central nervous system of the codebase. Changes ripple acros
Top restructuring routes (by effective codepath count):
1. **`Metadata`**: 40140116231395706750390 effective codepaths (0% field efficiency)
1. **`Metadata`**: 40142494212284116997693 effective codepaths (0% field efficiency)
- Apply nil sentinel to 74 nil-check functions
- Migrate to immediate-mode cache for 123 field-access sites
2. **`HistoryMessage`**: 40140116231395706750394 effective codepaths (0% field efficiency)
- Apply nil sentinel to 9 nil-check functions
- Migrate to immediate-mode cache for 173 field-access sites
2. **`FileItems`**: 8388712 effective codepaths (0% field efficiency)
- Apply nil sentinel to 2 nil-check functions
- Migrate to immediate-mode cache for 2 field-access sites
3. **`HistoryMessage`**: 4 effective codepaths (0% field efficiency)
- Apply nil sentinel to 0 nil-check functions
- Migrate to immediate-mode cache for 4 field-access sites
4. **`ToolCall`**: 1 effective codepaths (0% field efficiency)
- Apply nil sentinel to 0 nil-check functions
- Migrate to immediate-mode cache for 1 field-access sites
5. **`FileItem`**: 0 effective codepaths (0% field efficiency)
- Apply nil sentinel to 0 nil-check functions
- Migrate to immediate-mode cache for 0 field-access sites
- Migrate to immediate-mode cache for 137 field-access sites
3. **`ToolCall`**: 40140116231395706750391 effective codepaths (0% field efficiency)
- Apply nil sentinel to 9 nil-check functions
- Migrate to immediate-mode cache for 136 field-access sites
4. **`FileItem`**: 40140116231395706750390 effective codepaths (0% field efficiency)
- Apply nil sentinel to 9 nil-check functions
- Migrate to immediate-mode cache for 135 field-access sites
5. **`CommsLogEntry`**: 40140116231395706750390 effective codepaths (0% field efficiency)
- Apply nil sentinel to 9 nil-check functions
- Migrate to immediate-mode cache for 135 field-access sites
@@ -6,85 +6,85 @@ Per-aggregate analysis: effective codepaths, branch points, defusing opportuniti
| Aggregate | Consumers | Total branches | Effective codepaths | Field efficiency |
|---|---|---|---|---|
| `Metadata` | 66 | 541 | 40140116231395706750390 | 0% |
| `FileItems` | 4 | 37 | 8388712 | 0% |
| `HistoryMessage` | 2 | 2 | 4 | 0% |
| `ToolCall` | 1 | 0 | 1 | 0% |
| `FileItem` | 0 | 0 | 0 | 0% |
| `CommsLogEntry` | 0 | 0 | 0 | 0% |
| `CommsLog` | 0 | 0 | 0 | 0% |
| `History` | 0 | 0 | 0 | 0% |
| `ToolDefinition` | 0 | 0 | 0 | 0% |
| `Metadata` | 752 | 3466 | 40142494212284116997693 | 0% |
| `HistoryMessage` | 68 | 543 | 40140116231395706750394 | 0% |
| `ToolCall` | 67 | 541 | 40140116231395706750391 | 0% |
| `FileItem` | 66 | 541 | 40140116231395706750390 | 0% |
| `CommsLogEntry` | 66 | 541 | 40140116231395706750390 | 0% |
| `ToolDefinition` | 66 | 541 | 40140116231395706750390 | 0% |
| `FileItems` | 9 | 46 | 8388739 | 0% |
| `History` | 7 | 11 | 31 | 0% |
| `CommsLog` | 5 | 9 | 27 | 0% |
| `Result` | 0 | 0 | 0 | 0% |
## Defusing recommendations (top 10)
### `Metadata` - Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`
- **Location:** Metadata consumers access 123 sites, only 0 typed (0%)
- **Current state:** Many consumers use wildcard or defensive access patterns
- **Recommended change:** Introduce a `metadata_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 123 field-check branches to 1 cache lookup.
- **Effective codepaths:** 40142494212284116997693 -> 123
### `Metadata` - Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`
- **Location:** Metadata consumers have 541 explicit branch points total
- **Location:** Metadata consumers have 3466 explicit branch points total
- **Current state:** Branch explosion: 3466 branches = 40142494212284116997693 effective codepaths
- **Recommended change:** 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:** 40142494212284116997693 -> 752
### `HistoryMessage` - Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`
- **Location:** HistoryMessage consumers have 543 explicit branch points total
- **Current state:** Branch explosion: 543 branches = 40140116231395706750394 effective codepaths
- **Recommended change:** 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
### `FileItem` - Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`
- **Location:** FileItem consumers have 541 explicit branch points total
- **Current state:** Branch explosion: 541 branches = 40140116231395706750390 effective codepaths
- **Recommended change:** 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
### `Metadata` - Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`
### `CommsLogEntry` - Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`
- **Location:** Metadata consumers access 173 sites, only 0 typed (0%)
- **Current state:** Many consumers use wildcard or defensive access patterns
- **Recommended change:** Introduce a `metadata_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 173 field-check branches to 1 cache lookup.
- **Effective codepaths:** 40140116231395706750390 -> 173
### `FileItems` - Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`
- **Location:** FileItems consumers access 2 sites, only 0 typed (0%)
- **Current state:** Many consumers use wildcard or defensive access patterns
- **Recommended change:** Introduce a `fileitems_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 2 field-check branches to 1 cache lookup.
- **Effective codepaths:** 8388712 -> 2
### `FileItems` - Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`
- **Location:** FileItems consumers have 37 explicit branch points total
- **Current state:** Branch explosion: 37 branches = 8388712 effective codepaths
- **Location:** CommsLogEntry consumers have 541 explicit branch points total
- **Current state:** Branch explosion: 541 branches = 40140116231395706750390 effective codepaths
- **Recommended change:** 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:** 8388712 -> 4
- **Effective codepaths:** 40140116231395706750390 -> 66
### `Metadata` - Nil Sentinel `[N]`
### `ToolDefinition` - Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`
- **Location:** 9 consumer functions have `is None` / `== None` checks
- **Current state:** 9 nil-check branches contribute to branch explosion
- **Recommended change:** 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
- **Location:** ToolDefinition consumers have 541 explicit branch points total
- **Current state:** Branch explosion: 541 branches = 40140116231395706750390 effective codepaths
- **Recommended change:** 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
### `FileItems` - Nil Sentinel `[N]`
### `ToolCall` - Generational Handles `[I:ResolveHandle] -> [B:Gen matches?] -> [N|safe]`
- **Location:** 2 consumer functions have `is None` / `== None` checks
- **Current state:** 2 nil-check branches contribute to branch explosion
- **Recommended change:** 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:** 8388712 -> 8388708
- **Location:** ToolCall consumers have 541 explicit branch points total
- **Current state:** Branch explosion: 541 branches = 40140116231395706750391 effective codepaths
- **Recommended change:** 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
### `HistoryMessage` - Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`
- **Location:** HistoryMessage consumers access 4 sites, only 0 typed (0%)
- **Location:** HistoryMessage consumers access 137 sites, only 0 typed (0%)
- **Current state:** Many consumers use wildcard or defensive access patterns
- **Recommended change:** Introduce a `historymessage_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 4 field-check branches to 1 cache lookup.
- **Effective codepaths:** 4 -> 4
### `ToolCall` - Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`
- **Location:** ToolCall consumers access 1 sites, only 0 typed (0%)
- **Current state:** Many consumers use wildcard or defensive access patterns
- **Recommended change:** Introduce a `toolcall_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 1 field-check branches to 1 cache lookup.
- **Effective codepaths:** 1 -> 1
- **Recommended change:** 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
### `FileItem` - Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`
- **Location:** FileItem consumers access 0 sites, only 0 typed (0%)
- **Location:** FileItem consumers access 135 sites, only 0 typed (0%)
- **Current state:** Many consumers use wildcard or defensive access patterns
- **Recommended change:** Introduce a `fileitem_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 0 field-check branches to 1 cache lookup.
- **Effective codepaths:** 0 -> 1
- **Recommended change:** 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
### `CommsLogEntry` - Immediate-Mode Cache `[Q:key] -> [I:FetchCached] -> [T]`
- **Location:** CommsLogEntry consumers access 0 sites, only 0 typed (0%)
- **Location:** CommsLogEntry consumers access 135 sites, only 0 typed (0%)
- **Current state:** Many consumers use wildcard or defensive access patterns
- **Recommended change:** Introduce a `commslogentry_cache` keyed lookup. Consumers request by key, get cached value, no field-existence checks. Reduces 0 field-check branches to 1 cache lookup.
- **Effective codepaths:** 0 -> 1
- **Recommended change:** 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
@@ -4,10 +4,10 @@ Generated for 13 aggregates on 2026-06-22
- **Real aggregates (in scope):** 10
- **Candidate aggregates (placeholders):** 3
- **Total producers:** 121
- **Total consumers:** 73
- **Total current cost (us/turn):** 4950
- **Total actionable savings (us/turn):** 140
- **Total producers:** 1091
- **Total consumers:** 1106
- **Total current cost (us/turn):** 4750
- **Total actionable savings (us/turn):** 560
## 4-mem-dim rollup
@@ -20,16 +20,16 @@ Generated for 13 aggregates on 2026-06-22
| Aggregate | Kind | Memory dim | Access pattern | Producers | Consumers |
|---|---|---|---|---|---|
| `CommsLog` | `typealias` | `discussion` | `mixed` | 0 | 0 |
| `CommsLogEntry` | `typealias` | `discussion` | `mixed` | 0 | 0 |
| `FileItem` | `typealias` | `curation` | `mixed` | 0 | 0 |
| `FileItems` | `typealias` | `curation` | `whole_struct` | 0 | 4 |
| `History` | `typealias` | `discussion` | `mixed` | 0 | 0 |
| `HistoryMessage` | `typealias` | `discussion` | `mixed` | 1 | 2 |
| `Metadata` | `typealias` | `discussion` | `whole_struct` | 117 | 66 |
| `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` | 1 | 1 |
| `ToolDefinition` | `typealias` | `control` | `mixed` | 2 | 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 |
@@ -38,44 +38,44 @@ Generated for 13 aggregates on 2026-06-22
### `CommsLog`
- **Result coverage:** 0 producers, 0 consumers
- **Type alias coverage:** 0 sites
- **Cross-audit findings (total sites):** 0
- **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:** 0 producers, 0 consumers
- **Type alias coverage:** 0 sites
- **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:** 0 producers, 0 consumers
- **Type alias coverage:** 0 sites
- **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:** 0 producers, 4 consumers
- **Type alias coverage:** 2 sites; 0 typed (0%); 2 untyped (100%)
- **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:** 0 producers, 0 consumers
- **Type alias coverage:** 0 sites
- **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:** 1 producers, 2 consumers
- **Type alias coverage:** 4 sites; 0 typed (0%); 4 untyped (100%)
- **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:** 96 producers, 46 consumers
- **Type alias coverage:** 173 sites; 0 typed (0%); 173 untyped (100%)
- **Result coverage:** 457 producers, 697 consumers
- **Type alias coverage:** 123 sites; 0 typed (0%); 123 untyped (100%)
- **Cross-audit findings (total sites):** 1
### `Result`
@@ -86,12 +86,12 @@ Generated for 13 aggregates on 2026-06-22
### `ToolCall`
- **Result coverage:** 1 producers, 1 consumers
- **Type alias coverage:** 1 sites; 0 typed (0%); 1 untyped (100%)
- **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:** 2 producers, 0 consumers
- **Type alias coverage:** 0 sites
- **Result coverage:** 98 producers, 46 consumers
- **Type alias coverage:** 135 sites; 0 typed (0%); 135 untyped (100%)
- **Cross-audit findings (total sites):** 1
+47 -7
View File
@@ -208,6 +208,44 @@ def _extract_type_name(ann: ast.expr) -> str | None:
return None
ALIAS_TO_BASE: dict[str, str] = {
"Metadata": "dict[str, Any]",
"CommsLogEntry": "Metadata",
"CommsLog": "list[CommsLogEntry]",
"HistoryMessage": "Metadata",
"History": "list[HistoryMessage]",
"FileItem": "Metadata",
"FileItems": "list[FileItem]",
"ToolDefinition": "Metadata",
"ToolCall": "Metadata",
}
def _resolve_aliases(aggregate_name: str | None) -> list[str]:
"""Given a detected aggregate name, resolve to ALL aliases it represents.
For example, if a function returns dict[str, Any], resolve to
[Metadata, CommsLogEntry, HistoryMessage, FileItem, ToolDefinition, ToolCall]
because all of those TypeAliases point to dict[str, Any].
Also resolves transitive: list[CommsLogEntry] -> CommsLog,
because CommsLog: TypeAlias = list[CommsLogEntry].
"""
if aggregate_name is None:
return []
result: list[str] = []
for alias, base in ALIAS_TO_BASE.items():
if aggregate_name in base:
result.append(alias)
elif f"[{aggregate_name}]" in base:
result.append(alias)
elif aggregate_name == alias:
result.append(alias)
if not result and aggregate_name:
result = [aggregate_name]
return result
def P1_pass(tree: ast.Module, file: str) -> list[tuple[str, str, str, str, int]]:
"""AST pass 1: detect producers of T and Result[T] via return annotations."""
out: list[tuple[str, str, str, str, int]] = []
@@ -217,8 +255,9 @@ def P1_pass(tree: ast.Module, file: str) -> list[tuple[str, str, str, str, int]]
if node.returns is None:
continue
aggregate = _extract_type_name(node.returns)
if aggregate and aggregate not in ("None", "NoneType"):
out.append((node.name, aggregate, "producer", "high", node.lineno))
for resolved in _resolve_aliases(aggregate):
if resolved not in ("None", "NoneType"):
out.append((node.name, resolved, "producer", "high", node.lineno))
return out
@@ -232,8 +271,9 @@ def P2_pass(tree: ast.Module, file: str) -> list[tuple[str, str, str, str, int]]
if arg.annotation is None:
continue
aggregate = _extract_type_name(arg.annotation)
if aggregate and aggregate not in ("None", "NoneType"):
out.append((node.name, aggregate, "consumer", "high", node.lineno))
for resolved in _resolve_aliases(aggregate):
if resolved not in ("None", "NoneType"):
out.append((node.name, resolved, "consumer", "high", node.lineno))
return out
@@ -1118,9 +1158,9 @@ def synthesize_aggregate_profile(
)
type_registry = audit_inputs.get("type_registry", {}).get("types", {}) if isinstance(audit_inputs.get("type_registry"), dict) else {}
pattern, _per_pattern_counts, evidence = aggregate_pattern_from_consumers(
consumers, aggregate, type_registry, "src"
consumers[:50], aggregate, type_registry, "src"
)
tac = compute_real_type_alias_coverage(aggregate, producers, consumers, type_registry, "src")
tac = compute_real_type_alias_coverage(aggregate, producers[:50], consumers[:50], type_registry, "src")
from src.code_path_audit_cross_audit import (
aggregate_findings,
build_cross_audit_findings_for_aggregate,
@@ -1145,7 +1185,7 @@ def synthesize_aggregate_profile(
result_consumers=0,
summary=f"{producer_count} producers, {consumer_count} consumers",
)
dc = compute_real_decomposition_cost(aggregate, producers, consumers, pattern, "per_turn", type_registry, "src")
dc = compute_real_decomposition_cost(aggregate, producers[:50], consumers[:50], pattern, "per_turn", type_registry, "src")
candidates = extract_real_optimization_candidates(aggregate, producers, consumers, dc, type_registry, "src")
freq_evidence = tuple(
FrequencyEvidence(function=f, frequency="per_turn", source="static_analysis", note=f"producer from {f.file}")