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

Classes

class  StandInConfig

Functions

list[dict] _fatal (str code, str message)
tuple[StandInConfig|None, list[dict]] parse_argv (list[str] argv)

Variables

tuple _PROFILES = ("strict", "smoke", "full")
dict _VALUE_FLAGS
dict _BARE_FLAGS = {"--dry-run", "--json", "--workspace"}

Detailed Description

The §20.1 argv contract for the stand-in (Plan 184).

Purpose
-------
Parse exactly the stand-in grammar: the eight §20.1 flags plus
``--per-test-timeout`` (ADR-T-07) plus accepted-but-ignored
``--output-tests-limit`` (§20.3 no-sink rule). Anything else — unknown
flags, bare positionals, a literal ``--`` (ADR-T-16), or the
v1.0-grammar flags the stand-in does not support (``--workspace``,
``--ndjson``) — produces an exit-4-class configuration error with the
right catalog code.

Responsibilities
----------------
- ``parse_argv`` — pure argv → (config, errors); first error wins.
- ``StandInConfig`` — the parsed invocation.

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

Contracts
---------
- No prefix abbreviation: tokens match the grammar exactly.
- Both ``--flag value`` and ``--flag=value`` forms are accepted.
- ``parse_argv`` performs no filesystem or environment access.

Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- oc_chat.testing.report (error constructors)

Function Documentation

◆ _fatal()

list[dict] oc_chat.testing.cli._fatal ( str code,
str message )
protected

Definition at line 78 of file cli.py.

Here is the caller graph for this function:

◆ parse_argv()

tuple[StandInConfig | None, list[dict]] oc_chat.testing.cli.parse_argv ( list[str] argv)
Parse *argv* against the stand-in grammar.

Returns ``(config, [])`` on success or ``(None, [error])`` with a
single fatal configuration error (first error wins; nothing runs).

Definition at line 82 of file cli.py.

Here is the call graph for this function:

Variable Documentation

◆ _BARE_FLAGS

dict oc_chat.testing.cli._BARE_FLAGS = {"--dry-run", "--json", "--workspace"}
protected

Definition at line 58 of file cli.py.

◆ _PROFILES

tuple oc_chat.testing.cli._PROFILES = ("strict", "smoke", "full")
protected

Definition at line 50 of file cli.py.

◆ _VALUE_FLAGS

dict oc_chat.testing.cli._VALUE_FLAGS
protected
Initial value:
1= {
2 "--package", "--profile", "--seed", "--workers", "--marker",
3 "--nodeid", "--per-test-timeout", "--output-tests-limit", "--ndjson",
4}

Definition at line 53 of file cli.py.