main
md 48 lines 1.89 KB
Rendered Raw
1 # restart.py DOX
2
3 ## Purpose
4
5 - Own the `restart.py` API endpoint.
6 - This module requests server restart or reload behavior.
7 - Keep this file-level DOX profile synchronized with `restart.py` because this directory is intentionally flat.
8
9 ## Ownership
10
11 - `restart.py` owns the runtime implementation.
12 - `restart.py.dox.md` owns durable notes about responsibilities, contracts, side effects, and verification for that implementation.
13 - Classes:
14 - `Restart` (`ApiHandler`)
15 - `async process(self, input: dict, request: Request) -> dict | Response`
16
17 ## Runtime Contracts
18
19 - HTTP handlers must derive from `helpers.api.ApiHandler`; WebSocket handlers must derive from `helpers.ws.WsHandler`.
20 - Update this file whenever request payloads, authentication or CSRF requirements, response shapes, route side effects, or WebSocket event contracts change.
21 - `Restart` is an `ApiHandler`.
22 - `Restart` defines `process(...)`.
23 - Imported dependency areas include: `helpers`, `helpers.api`.
24
25 ## Key Concepts
26
27 - Important called helpers/classes observed in the source: `process.reload`, `Response`.
28 - Keep request/response, tool, or helper semantics documented here at the same time as source changes.
29
30 ## Work Guidance
31
32 - Preserve authentication, CSRF, loopback, and API-key checks unless the endpoint contract explicitly changes.
33 - Update frontend callers, plugin callers, and tests together when payload shape changes.
34 - Use `helpers.api.Response` for non-JSON responses, files, redirects, or status-specific replies.
35
36 ## Verification
37
38 - Run endpoint-specific or API/WebSocket tests for changed behavior; smoke-test browser callers when no focused test exists.
39 - Related tests observed by source search:
40 - `tests/test_browser_agent_regressions.py`
41 - `tests/test_download_toast_regressions.py`
42 - `tests/test_self_update_tag_filter.py`
43 - `tests/test_timezone_regressions.py`
44 - `tests/test_ws_manager.py`
45
46 ## Child DOX Index
47
48 No child DOX files.