main
md 44 lines 1.73 KB
Rendered Raw
1 # nudge.py DOX
2
3 ## Purpose
4
5 - Own the `nudge.py` API endpoint.
6 - This module handles nudge API requests.
7 - Keep this file-level DOX profile synchronized with `nudge.py` because this directory is intentionally flat.
8
9 ## Ownership
10
11 - `nudge.py` owns the runtime implementation.
12 - `nudge.py.dox.md` owns durable notes about responsibilities, contracts, side effects, and verification for that implementation.
13 - Classes:
14 - `Nudge` (`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 - `Nudge` is an `ApiHandler`.
22 - `Nudge` defines `process(...)`.
23 - Imported dependency areas include: `helpers.api`.
24
25 ## Key Concepts
26
27 - Important called helpers/classes observed in the source: `self.use_context`, `context.nudge`, `context.log.log`, `Exception`.
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
42 ## Child DOX Index
43
44 No child DOX files.