Purpose
-------
The spec-10 §12.4 error taxonomy for the ``oct test`` v1.0 seed
(Plan 189) - AS DATA. The library never calls ``sys.exit``; it raises
:class:`OctTestError` carrying the stable §12.4 code, the error kind,
and the severity, plus the kind → exit-code mapping the future v1.0
CLI slice applies at its boundary.
Responsibilities
----------------
- Define the §12.4 stable identifiers the discovery layer emits
(``WORKSPACE_FILE_NOT_FOUND``, ``WORKSPACE_AND_PACKAGE_BOTH_PASSED``,
``PACKAGE_UNKNOWN``, ``CWD_RESOLUTION_FAILED``).
- Define and CATALOG the implementation-specific ``9xxx`` extension
codes this seed uses (§12.4 reserves the range and requires the
implementation to document its codes; ``IMPLEMENTATION_CODE_CATALOG``
is that catalog).
- Provide :class:`OctTestError` and its §11 ``errors[]``-entry
projection, and :func:`exit_code_for_kind` (configuration → 4,
orchestrator → 3, signal → 3 per §12.3/§12.6/§12.7).
Diagnostics
-----------
Domain: OCT-TESTING
Levels:
L2: lifecycle events (none emitted here - pure data module)
L3: semantic details (none emitted here)
L4: deep tracing (none emitted here)
Contracts
---------
- NO ``sys.exit`` and no I/O in this module - exits are data the CLI
maps later (Plan 189 pinned decision).
- Two conditions never share a code (§12.8 house rule): the base
v0.25 loader rejecting an existing manifest is ``9101``; a
test-block/test-config content violation is ``9102``.
- Every §12.4 stable identifier is its own value, so consumers can
compare against these constants or against the spec's literals.
Dependencies
------------
- oct.core.diagnostics (_dbg structured logger)
| int oct.testing.errors.exit_code_for_kind |
( |
str | kind | ) |
|
Return the §12 exit code for an error *kind*.
Parameters
----------
kind
One of :data:`KIND_CONFIGURATION`, :data:`KIND_ORCHESTRATOR`,
:data:`KIND_SIGNAL`.
Returns
-------
int
``4`` for configuration errors, ``3`` for orchestrator and
signal errors.
Raises
------
ValueError
If *kind* is not one of the three taxonomy kinds (a caller
bug, not a runtime condition - VALIDATION_ERROR class).
Definition at line 149 of file errors.py.