main
md 44 lines 2.19 KB
Rendered Raw
1 # system_packages.py DOX
2
3 ## Purpose
4
5 - Own the `system_packages.py` helper module.
6 - This module runs apt operations with retry behavior.
7 - Keep this file-level DOX profile synchronized with `system_packages.py` because this directory is intentionally flat.
8
9 ## Ownership
10
11 - `system_packages.py` owns the runtime implementation.
12 - `system_packages.py.dox.md` owns durable notes about responsibilities, contracts, side effects, and verification for that implementation.
13 - Top-level functions:
14 - `run_apt_with_retries(runner: Callable[[], subprocess.CompletedProcess[str]], lock_timeout_seconds: int=..., retry_seconds: int=...) -> subprocess.CompletedProcess[str]`: Run an apt/dpkg command, serializing in-process callers and waiting out apt locks.
15 - `is_apt_lock_error(result: subprocess.CompletedProcess[str]) -> bool`
16 - Notable constants/configuration names: `APT_LOCK_TIMEOUT_SECONDS`, `APT_LOCK_RETRY_SECONDS`.
17
18 ## Runtime Contracts
19
20 - Helper modules own reusable framework APIs and must preserve public callers unless all callers, tests, and docs are updated together.
21 - Update this file whenever public functions, classes, persistence behavior, path/security assumptions, side effects, or cross-module contracts change.
22 - Observed side-effect areas: subprocess/runtime control.
23 - Imported dependency areas include: `__future__`, `subprocess`, `threading`, `time`, `typing`.
24
25 ## Key Concepts
26
27 - Important called helpers/classes observed in the source: `threading.RLock`, `lower`, `time.monotonic`, `runner`, `time.sleep`, `is_apt_lock_error`.
28 - Keep request/response, tool, or helper semantics documented here at the same time as source changes.
29
30 ## Work Guidance
31
32 - Preserve public helper APIs used by core code and plugins unless every caller is updated.
33 - Keep path, auth, secret, persistence, network, and subprocess behavior explicit and bounded.
34 - Prefer adding cohesive helper functions here only when behavior is reused across modules.
35
36 ## Verification
37
38 - Run targeted tests for changed helper behavior; run security regressions for auth, filesystem, WebSocket, tunnel, upload, or secret-handling helpers.
39 - Related tests observed by source search:
40 - `tests/test_office_document_store.py`
41
42 ## Child DOX Index
43
44 No child DOX files.