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