| 1 | # process.py DOX |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | - Own the `process.py` helper module. |
| 6 | - This module manages process reload, restart, exit, and server references. |
| 7 | - Keep this file-level DOX profile synchronized with `process.py` because this directory is intentionally flat. |
| 8 | |
| 9 | ## Ownership |
| 10 | |
| 11 | - `process.py` owns the runtime implementation. |
| 12 | - `process.py.dox.md` owns durable notes about responsibilities, contracts, side effects, and verification for that implementation. |
| 13 | - Top-level functions: |
| 14 | - `set_server(server)` |
| 15 | - `get_server(server)` |
| 16 | - `stop_server()` |
| 17 | - `reload()` |
| 18 | - `restart_process()` |
| 19 | - `exit_process()` |
| 20 | |
| 21 | ## Runtime Contracts |
| 22 | |
| 23 | - Helper modules own reusable framework APIs and must preserve public callers unless all callers, tests, and docs are updated together. |
| 24 | - Update this file whenever public functions, classes, persistence behavior, path/security assumptions, side effects, or cross-module contracts change. |
| 25 | - Observed side-effect areas: subprocess/runtime control. |
| 26 | - Imported dependency areas include: `helpers`, `helpers.print_style`, `os`, `sys`. |
| 27 | |
| 28 | ## Key Concepts |
| 29 | |
| 30 | - Important called helpers/classes observed in the source: `stop_server`, `runtime.is_dockerized`, `PrintStyle.standard`, `os.execv`, `sys.exit`, `_server.shutdown`, `exit_process`, `restart_process`. |
| 31 | - Keep request/response, tool, or helper semantics documented here at the same time as source changes. |
| 32 | |
| 33 | ## Work Guidance |
| 34 | |
| 35 | - Preserve public helper APIs used by core code and plugins unless every caller is updated. |
| 36 | - Keep path, auth, secret, persistence, network, and subprocess behavior explicit and bounded. |
| 37 | - Prefer adding cohesive helper functions here only when behavior is reused across modules. |
| 38 | |
| 39 | ## Verification |
| 40 | |
| 41 | - Run targeted tests for changed helper behavior; run security regressions for auth, filesystem, WebSocket, tunnel, upload, or secret-handling helpers. |
| 42 | - Related tests observed by source search: |
| 43 | - `tests/test_api_chat_lifetime.py` |
| 44 | - `tests/test_browser_agent_regressions.py` |
| 45 | - `tests/test_docker_release_plan.py` |
| 46 | - `tests/test_document_query_plugin.py` |
| 47 | - `tests/test_download_toast_regressions.py` |
| 48 | - `tests/test_git_version_label.py` |
| 49 | - `tests/test_image_get_security.py` |
| 50 | - `tests/test_model_config_project_presets.py` |
| 51 | |
| 52 | ## Child DOX Index |
| 53 | |
| 54 | No child DOX files. |