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