main
md 46 lines 1.85 KB
Rendered Raw
1 # banners.py DOX
2
3 ## Purpose
4
5 - Own the `banners.py` API endpoint.
6 - This module collects alert banners and discovery cards from backend extensions.
7 - Keep this file-level DOX profile synchronized with `banners.py` because this directory is intentionally flat.
8
9 ## Ownership
10
11 - `banners.py` owns the runtime implementation.
12 - `banners.py.dox.md` owns durable notes about responsibilities, contracts, side effects, and verification for that implementation.
13 - Classes:
14 - `GetBanners` (`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 - `GetBanners` is an `ApiHandler`.
22 - `GetBanners` defines `process(...)`.
23 - Imported dependency areas include: `helpers.api`, `helpers.extension`.
24
25 ## Key Concepts
26
27 - Important called helpers/classes observed in the source: `call_extensions_async`.
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_model_config_api_keys.py`
41 - `tests/test_oauth_static.py`
42 - `tests/test_webui_extension_surfaces.py`
43
44 ## Child DOX Index
45
46 No child DOX files.