Fix the /notebooks endpoint which is returning HTTP 500 errors due to a database column name mismatch.
The notebooks endpoint exists in api.py but queries a non-existent column name. The error from logs:
sqlite3.OperationalError: no such column: n.associated_analysis_idAnalysis:
analysis_idassociated_analysis_idid, title, path, analysis_id, created_at, description, associated_entities, rendered_html_pathUpdate the JOIN clause in both notebooks_page() functions to use the correct column name:
LEFT JOIN analyses a ON n.associated_analysis_id = a.idLEFT JOIN analyses a ON n.analysis_id = a.id/notebooks returns HTTP 200/api/notebooks returns valid JSONInvestigation:
sqlite3.OperationalError: no such column: n.associated_analysis_idanalysis_id (not associated_analysis_id)associated_analysis_id → analysis_id:/api/notebooks JOIN clause/api/notebooks/{id} detail function/notebooks HTML page JOIN clause/notebooks analysis link generation/notebook/{id} detail page
curl http://localhost:8000/notebooks → returns 200 OKcurl http://localhost:8000/api/notebooks → returns valid JSON arrayEvidence:
curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/notebooks → 200notebooks table has associated_analysis_id column (confirmed via information_schema.columns)api.py notebooks_page() at line 51856 uses LEFT JOIN analyses a ON n.associated_analysis_id = a.id — matches DB schemagit diff origin/main -- api.py shows no pending changes; fix is on mainSummary: The column mismatch has been resolved — notebooks table has associated_analysis_id matching the query, and /notebooks returns 200 with valid HTML.