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