| 1 | # errors.py DOX |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | - Own the `errors.py` helper module. |
| 6 | - This module defines framework exceptions and safe error formatting. |
| 7 | - Keep this file-level DOX profile synchronized with `errors.py` because this directory is intentionally flat. |
| 8 | |
| 9 | ## Ownership |
| 10 | |
| 11 | - `errors.py` owns the runtime implementation. |
| 12 | - `errors.py.dox.md` owns durable notes about responsibilities, contracts, side effects, and verification for that implementation. |
| 13 | - Classes: |
| 14 | - `RepairableException` (`Exception`) |
| 15 | - `InterventionException` (`Exception`) |
| 16 | - `HandledException` (`Exception`) |
| 17 | - Top-level functions: |
| 18 | - `handle_error(e: Exception)` |
| 19 | - `error_text(e: Exception)` |
| 20 | - `format_error(e: Exception, start_entries=..., end_entries=..., error_message_position: Literal['top', 'bottom', 'none']=...)` |
| 21 | |
| 22 | ## Runtime Contracts |
| 23 | |
| 24 | - Helper modules own reusable framework APIs and must preserve public callers unless all callers, tests, and docs are updated together. |
| 25 | - Update this file whenever public functions, classes, persistence behavior, path/security assumptions, side effects, or cross-module contracts change. |
| 26 | - Imported dependency areas include: `asyncio`, `re`, `traceback`, `typing`. |
| 27 | |
| 28 | ## Key Concepts |
| 29 | |
| 30 | - Important called helpers/classes observed in the source: `join`, `traceback_text.split`, `traceback.format_exception`, `re.match`, `type`, `line.strip.startswith`, `trimmed_lines.strip`, `error_message.strip`, `line.strip`. |
| 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_browser_agent_regressions.py` |
| 44 | - `tests/test_fasta2a_client.py` |
| 45 | - `tests/test_host_browser_connector.py` |
| 46 | - `tests/test_office_desktop_state.py` |
| 47 | - `tests/test_office_document_store.py` |
| 48 | - `tests/test_skills_runtime.py` |
| 49 | - `tests/test_speech_plugin_split.py` |
| 50 | - `tests/test_time_travel.py` |
| 51 | |
| 52 | ## Child DOX Index |
| 53 | |
| 54 | No child DOX files. |