# Integration Test API Coverage & Todo List

This document tracks which core system backend endpoints are covered natively by the E2E Integration Test Suite (`run_integration_tests.sh`).

## Todo Works
- [ ] Parse mapping of remaining APIs from all markdown files in `docs/api_reference/` to complete the checklist.
- [x] Build a generic `test_audio.py` integration spec (Targeting STT and TTS routing).
- [ ] Build a `test_agent_nodes_sandbox.py` spec for deep sandbox edge cases to ensure `workspace` restrictions work.
- [x] Fully map coverage for the `/models` endpoints to `test_provider_config.py`.
- [ ] Write missing tests for `/users/me/profile` endpoints.
- [ ] Review `/skills` and `/knowledge` mapping against `test_browser_llm.py` which only touches standard capability mapping.
- [x] Fully map coverage for the Agents logic into `test_agents.py`


## Covered APIs

### Agent Nodes (`/nodes` & `/fs`)
Covered by: 
- `integration_tests/test_node_registration.py` (Node Lifecycle)
- `integration_tests/test_file_sync.py` (Cross-Nodes File System Integrity Validation)
- [x] `POST /nodes/admin` (Register Node)
- [x] `GET /nodes/admin` (List All Nodes)
- [x] `GET /nodes/admin/{node_id}` (Get Node Detail)
- [x] `PATCH /nodes/admin/{node_id}` (Update Node Config)
- [x] `POST /nodes/admin/{node_id}/access` (Grant Group Access)
- [x] `DELETE /nodes/admin/{node_id}/access/{group_id}` (Revoke Group Access)
- [x] `GET /nodes/admin/{node_id}/config.yaml` (Download config)
- [x] `GET /nodes/provision/{node_id}` (Fetch provision script)
- [x] `GET /nodes/admin/{node_id}/download` (Download ZIP)
- [x] `DELETE /nodes/admin/{node_id}` (Deregister Node)
- [x] `POST /nodes/admin/mesh/reset` (Emergency Reset)
- [x] `GET /nodes/` (List Accessible Nodes)
- [x] `GET /nodes/{node_id}/status` (Online Check)
- [x] `GET /nodes/{node_id}/terminal` (Terminal History)
- [x] `POST /nodes/{node_id}/dispatch` (Dispatch Command)
- [x] `POST /nodes/{node_id}/cancel` (Cancel Task)
- [x] `PATCH /nodes/preferences` (Update User DB Prefs)
- [x] `GET /nodes/preferences` (Get User DB Prefs)
- [x] `POST /nodes/validate-token` (Internal Validator)
- [x] `GET /nodes/{node_id}/fs/ls` (List Dir)
- [x] `GET /nodes/{node_id}/fs/cat` (Read File)
- [x] `POST /nodes/{node_id}/fs/touch` (Create File/Dir)
- [x] `GET /nodes/{node_id}/fs/download` (Download File stream)
- [x] `POST /nodes/{node_id}/fs/upload` (Upload File stream)
- [x] `POST /nodes/{node_id}/fs/rm` (Delete File/Dir)

### Users / Auth (`/users`)
Covered by `integration_tests/test_login.py` and `test_user_profile.py`
- [x] `POST /users/login/local` (Perform Day 1 Local Login)
- [x] `GET /users/me/profile` (Get Current User Profile)
- [x] `PUT /users/me/profile` (Update User Profile)
- [x] `GET /users/me` (Get Current User Status)
- [x] `GET /users/config` (Public Auth Configuration)
- [ ] Check full coverage against `api_reference/users.md` for remaining methods

### Sessions (`/sessions`)
Covered roughly by `integration_tests/test_llm_chat.py` and `test_browser_llm.py`
- [x] `POST /sessions` (Create Inference Session)
- [x] `POST /sessions/{id}/chat` (Inference Streaming Chat via Server-Sent Events)
- [x] `DELETE /sessions/{id}` (Archive Session and Wipe Linked Storage)
- [ ] Check full coverage against `api_reference/sessions.md`

### LLM / Provider Config (`/users/me/config` & `/models`)
Covered roughly by `integration_tests/test_provider_config.py`
- [x] `POST /users/me/config/verify_llm` (Config validation proxy ping before save)
- [x] `PUT /users/me/config` (Apply Provider Key Update)
- [x] `GET /users/me/config` (Get Personal Setting Mapping)
- [x] `GET /users/me/config/models` (Get Models for Provider)

### Audio Pipeline (STT & TTS)
Covered by `integration_tests/test_audio.py`
- [x] `GET /speech/voices` (List available TTS voices)
- [x] `POST /speech` (Generate speech from text)
- [x] `POST /stt/transcribe` (Transcribe audio to text)

### Agents (`/agents`)
Covered by `integration_tests/test_agents.py`
- [x] `POST /agents/templates` (Create Template)
- [x] `POST /agents/instances` (Create Instance)
- [x] `PATCH /agents/{id}/status` (Update Status)
- [x] `PATCH /agents/{id}/config` (Update Config)
- [x] `GET /agents` (Get Agents)
- [x] `POST /agents/{id}/triggers` (Create Agent Trigger)
- [x] `GET /agents/{id}/triggers` (Get Agent Triggers)
- [x] `DELETE /agents/triggers/{trigger_id}` (Delete trigger)
- [x] `DELETE /agents/{id}` (Delete agent)
- [ ] `POST /agents/{id}/webhook` (Webhook Receiver)
- [ ] `POST /agents/deploy` (Deploy Agent)
