Problem
The baseline eval states: "All 14 HTTP route handlers — the primary user-facing interface — have no direct tests. The export route, PDF generation, workspace listing, workspace detail, composers, and logs endpoints are all unverified." While the project has ~80 test cases across 10 test files covering utility functions and CLI logic, no test exercises the Flask route handlers through the test client. The eval's "test-coverage" cluster finding specifically flags three API endpoints that lack any coverage, leaving the primary user-facing contract completely unverified against regressions.
Acceptance Criteria
Implementation Notes
Use Flask's built-in test client via app.test_client() from the create_app() factory. Create tests/test_api_search.py, tests/test_api_workspaces.py, and tests/test_api_export.py. For database mocking, create a temporary SQLite database with known test data mimicking Cursor's schema (ItemTable with key/value columns, cursorDiskKV patterns). Reference tests/ for existing fixture patterns. The search endpoint is the highest priority given its 450-line complexity and three data sources. For the workspace endpoint, verify that the response includes the expected workspace metadata structure. For export, verify that the correct content-type headers and file format are returned. Note: if item #99 (search decomposition) lands first, the extracted helper functions will be easier to test in isolation — coordinate ordering with Brad.
References
- Eval finding: Test 30, cluster "test-coverage"
- Related files:
api/search.py, api/workspaces.py, api/export_api.py, app.py (create_app factory), tests/, requirements.txt
Problem
The baseline eval states: "All 14 HTTP route handlers — the primary user-facing interface — have no direct tests. The export route, PDF generation, workspace listing, workspace detail, composers, and logs endpoints are all unverified." While the project has ~80 test cases across 10 test files covering utility functions and CLI logic, no test exercises the Flask route handlers through the test client. The eval's "test-coverage" cluster finding specifically flags three API endpoints that lack any coverage, leaving the primary user-facing contract completely unverified against regressions.
Acceptance Criteria
/api/search,/api/workspaces, and/api/export(or the three most complex handlers)Implementation Notes
Use Flask's built-in test client via
app.test_client()from thecreate_app()factory. Createtests/test_api_search.py,tests/test_api_workspaces.py, andtests/test_api_export.py. For database mocking, create a temporary SQLite database with known test data mimicking Cursor's schema (ItemTablewithkey/valuecolumns,cursorDiskKVpatterns). Referencetests/for existing fixture patterns. The search endpoint is the highest priority given its 450-line complexity and three data sources. For the workspace endpoint, verify that the response includes the expected workspace metadata structure. For export, verify that the correct content-type headers and file format are returned. Note: if item #99 (search decomposition) lands first, the extracted helper functions will be easier to test in isolation — coordinate ordering with Brad.References
api/search.py,api/workspaces.py,api/export_api.py,app.py(create_appfactory),tests/,requirements.txt