oc_chat
Loading...
Searching...
No Matches
oc_chat.testing.__main__ Namespace Reference

Functions

int main (list[str]|None argv=None)

Variables

tuple _FATAL_ENVELOPE_PREFIX
str _FATAL_ENVELOPE_SUFFIX = ', "source": "orchestrator"}]}'

Detailed Description

CLI entry for the §20 stand-in: ``python -m oc_chat.testing`` (Plan 184).

Purpose
-------
Thin process shell over :func:`oc_chat.testing.runner.run_standin`:
emit the report (JSON to stdout under ``--json``; captured pytest
output plus a compact summary otherwise) and exit with the §4 code.

Responsibilities
----------------
- ``main`` — run, emit, return the exit code.
- The §12.4 minimal fatal envelope: when the report itself cannot be
  serialised, emit the fixed-shape substitute and exit 3.

Diagnostics
-----------
Domain: OC_TESTING
Levels:
    L2 — lifecycle events
    L3 — semantic details
    L4 — deep tracing

Contracts
---------
- Under ``--json`` stdout carries the report document; human notes for
  fatal configuration errors go to stderr (§4).
- The process exit code always equals ``report["exit_code"]``.

Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- oc_chat.testing.runner (the orchestrator)

Function Documentation

◆ main()

int oc_chat.testing.__main__.main ( list[str] | None argv = None)
Run the stand-in CLI; return the §4 exit code.

Definition at line 61 of file __main__.py.

Variable Documentation

◆ _FATAL_ENVELOPE_PREFIX

tuple oc_chat.testing.__main__._FATAL_ENVELOPE_PREFIX
protected
Initial value:
1= (
2 # OCT-LINT: disable=no_hardcoded_secrets reason="The section-12.4 minimal fatal envelope is a spec-mandated fixed JSON literal; machine schema text, not a credential"
3 '{"schema": "oct-test-fatal/v1", "status": "orchestrator_error", '
4 '"exit_code": 3, "errors": [{"kind": "orchestrator", '
5 '"code": "REPORT_SERIALIZATION_FAILED", "severity": "fatal", '
6 '"message": '
7)

Definition at line 51 of file __main__.py.

◆ _FATAL_ENVELOPE_SUFFIX

str oc_chat.testing.__main__._FATAL_ENVELOPE_SUFFIX = ', "source": "orchestrator"}]}'
protected

Definition at line 58 of file __main__.py.