| 1 | # docker.py DOX |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | - Own the `docker.py` helper module. |
| 6 | - This module manages Docker container operations used by runtime helpers. |
| 7 | - Keep this file-level DOX profile synchronized with `docker.py` because this directory is intentionally flat. |
| 8 | |
| 9 | ## Ownership |
| 10 | |
| 11 | - `docker.py` owns the runtime implementation. |
| 12 | - `docker.py.dox.md` owns durable notes about responsibilities, contracts, side effects, and verification for that implementation. |
| 13 | - Classes: |
| 14 | - `DockerContainerManager` (no explicit base class) |
| 15 | - `init_docker(self)` |
| 16 | - `cleanup_container(self) -> None` |
| 17 | - `get_image_containers(self)` |
| 18 | - `start_container(self) -> None` |
| 19 | |
| 20 | ## Runtime Contracts |
| 21 | |
| 22 | - Helper modules own reusable framework APIs and must preserve public callers unless all callers, tests, and docs are updated together. |
| 23 | - Update this file whenever public functions, classes, persistence behavior, path/security assumptions, side effects, or cross-module contracts change. |
| 24 | - Observed side-effect areas: filesystem reads, filesystem deletion, subprocess/runtime control, WebSocket state. |
| 25 | - Imported dependency areas include: `atexit`, `docker`, `helpers.errors`, `helpers.files`, `helpers.log`, `helpers.print_style`, `time`, `typing`. |
| 26 | |
| 27 | ## Key Concepts |
| 28 | |
| 29 | - Important called helpers/classes observed in the source: `self.init_docker`, `PrintStyle.standard`, `self.client.containers.run`, `time.sleep`, `docker.from_env`, `self.container.stop`, `self.container.remove`, `existing_container.start`, `self.logger.log`, `format_error`, `PrintStyle.error`, `PrintStyle.hint`. |
| 30 | - Keep request/response, tool, or helper semantics documented here at the same time as source changes. |
| 31 | |
| 32 | ## Work Guidance |
| 33 | |
| 34 | - Preserve public helper APIs used by core code and plugins unless every caller is updated. |
| 35 | - Keep path, auth, secret, persistence, network, and subprocess behavior explicit and bounded. |
| 36 | - Prefer adding cohesive helper functions here only when behavior is reused across modules. |
| 37 | |
| 38 | ## Verification |
| 39 | |
| 40 | - Run targeted tests for changed helper behavior; run security regressions for auth, filesystem, WebSocket, tunnel, upload, or secret-handling helpers. |
| 41 | - Related tests observed by source search: |
| 42 | - `tests/test_browser_agent_regressions.py` |
| 43 | - `tests/test_default_prompt_budget.py` |
| 44 | - `tests/test_docker_release_plan.py` |
| 45 | - `tests/test_document_query_plugin.py` |
| 46 | - `tests/test_host_browser_connector.py` |
| 47 | - `tests/test_model_search.py` |
| 48 | - `tests/test_office_canvas_setup.py` |
| 49 | - `tests/test_office_document_store.py` |
| 50 | |
| 51 | ## Child DOX Index |
| 52 | |
| 53 | No child DOX files. |