Now update the `load_deep_analysis` endpoint to also return the playbook key.


TodoWrite

Replace DEEP_ANALYSIS_PASSES with DEEP_ANALYSIS_PLAYBOOKS constant (4 playbooks, full prompts)

Replacing DEEP_ANALYSIS_PASSES with DEEP_ANALYSIS_PLAYBOOKS constant

Add playbook dropdown UI + update Deep Analysis button

Update runDeepAnalysis() to use selected playbook

Updating runDeepAnalysis() to use selected playbook

Add initPlaybookDropdown() and call on page load

Update api.php: save_ai_response to persist deep_analysis_playbook field

Update api.php: load_deep_analysis to return playbook info

Updating load_deep_analysis API endpoint

Verify with php -l syntax check


Todos have been modified successfully. Ensure that you continue to use the todo list to track your progress. Please proceed with the current tasks if applicable

Replace DEEP_ANALYSIS_PASSES with DEEP_ANALYSIS_PLAYBOOKS constant (4 playbooks, full prompts)

Replacing DEEP_ANALYSIS_PASSES with DEEP_ANALYSIS_PLAYBOOKS constant

Add playbook dropdown UI + update Deep Analysis button

Update runDeepAnalysis() to use selected playbook

Updating runDeepAnalysis() to use selected playbook

Add initPlaybookDropdown() and call on page load

Update api.php: save_ai_response to persist deep_analysis_playbook field

Update api.php: load_deep_analysis to return playbook info

Updating load_deep_analysis API endpoint

Verify with php -l syntax check

Verify with php -l syntax check


Edit

                $passes[$passNum]['responses'][] = [
                    '_id' => (string)$r['_id'],
                    'provider' => $r['provider'] ?? '',
                    'model' => $r['model'] ?? '',
                    'response' => $r['response']['response'] ?? '',
                    'cost' => $r['response']['cost'] ?? 0,
                    'request_time' => $r['response']['request_time'] ?? 0,
                    'created_at' => $r['created_at'] ?? ''
                ];

                $passes[$passNum]['responses'][] = [
                    '_id' => (string)$r['_id'],
                    'provider' => $r['provider'] ?? '',
                    'model' => $r['model'] ?? '',
                    'response' => $r['response']['response'] ?? '',
                    'cost' => $r['response']['cost'] ?? 0,
                    'request_time' => $r['response']['request_time'] ?? 0,
                    'created_at' => $r['created_at'] ?? ''
                ];
                // Track playbook key if available
                if (!empty($r['deep_analysis_playbook']) && !isset($passes[$passNum]['playbook'])) {
                    $passes[$passNum]['playbook'] = $r['deep_analysis_playbook'];
                }