| @@ -148,13 +148,17 @@ | ||
| 148 | 148 | * - generate-doc / generate-outline / expand-outline (and any future prompt-driven |
| 149 | 149 | * action) → prompt |
| 150 | 150 | * |
| 151 | 151 | * @param array<string,int> $actions |
| 152 | - * @return array{prompt:int,source:int,git:int} | |
| 152 | + * @return array{prompt:int,source:int,git:int,attachment:int,recording:int} | |
| 153 | 153 | */ |
| 154 | 154 | protected static function write_with_ai_modes( $actions ) { |
| 155 | - $modes = [ 'prompt' => 0, 'source' => 0, 'git' => 0 ]; | |
| 155 | + $modes = [ 'prompt' => 0, 'source' => 0, 'git' => 0, 'attachment' => 0, 'recording' => 0 ]; | |
| 156 | 156 | |
| 157 | + // Anything unrecognised lands in `prompt`, which is why `attachment` and | |
| 158 | + // `recording` need explicit arms: without them every file-based | |
| 159 | + // generation was reported as a plain prompt, making the attachment tab | |
| 160 | + // look unused in the insights snapshot. | |
| 157 | 161 | foreach ( (array) $actions as $action => $count ) { |
| 158 | 162 | $count = (int) $count; |
| 159 | 163 | if ( 'from-source' === $action ) { |
| 160 | 164 | $modes['source'] += $count; |
| @@ -159,8 +163,14 @@ | ||
| 159 | 163 | if ( 'from-source' === $action ) { |
| 160 | 164 | $modes['source'] += $count; |
| 161 | 165 | } elseif ( 'from-git' === $action ) { |
| 162 | 166 | $modes['git'] += $count; |
| 167 | + } elseif ( 'from-attachment' === $action ) { | |
| 168 | + $modes['attachment'] += $count; | |
| 169 | + } elseif ( 'from-recording' === $action || 'transcribe-attachment' === $action ) { | |
| 170 | + // `from-recording` is the generation. `transcribe-attachment` is | |
| 171 | + // only kept so counts recorded before that split still land here. | |
| 172 | + $modes['recording'] += $count; | |
| 163 | 173 | } else { |
| 164 | 174 | $modes['prompt'] += $count; |
| 165 | 175 | } |
| 166 | 176 | } |