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


Now update api.php — add `deep_analysis_playbook` to `save_ai_response` endpoint.


Edit

                'deep_analysis_pass' => isset($jsonData['deep_analysis_pass']) ? (int)$jsonData['deep_analysis_pass'] : null,
                'deep_analysis_name' => $jsonData['deep_analysis_name'] ?? null,
                'created_at' => date('Y-m-d H:i:s')
            ];

            // Remove null optional fields to keep documents clean
            if ($responseDoc['agent'] === null) unset($responseDoc['agent']);
            if ($responseDoc['deep_analysis_pass'] === null) unset($responseDoc['deep_analysis_pass']);
            if ($responseDoc['deep_analysis_name'] === null) unset($responseDoc['deep_analysis_name']);

                'deep_analysis_pass' => isset($jsonData['deep_analysis_pass']) ? (int)$jsonData['deep_analysis_pass'] : null,
                'deep_analysis_name' => $jsonData['deep_analysis_name'] ?? null,
                'deep_analysis_playbook' => $jsonData['deep_analysis_playbook'] ?? null,
                'created_at' => date('Y-m-d H:i:s')
            ];

            // Remove null optional fields to keep documents clean
            if ($responseDoc['agent'] === null) unset($responseDoc['agent']);
            if ($responseDoc['deep_analysis_pass'] === null) unset($responseDoc['deep_analysis_pass']);
            if ($responseDoc['deep_analysis_name'] === null) unset($responseDoc['deep_analysis_name']);
            if ($responseDoc['deep_analysis_playbook'] === null) unset($responseDoc['deep_analysis_playbook']);