oct
Loading...
Searching...
No Matches
oct.complexity.probe Namespace Reference

Classes

class  ProbeProject

Functions

argparse.ArgumentParser _parser ()
int main (Sequence[str]|None argv=None)
dict[str, object] _run_project (ProbeProject project, *, Path repo_root, Path data_dir, Path python_executable)
dict[str, object] _suite_record (CoverageRun suite)
dict[str, object] _relativize_row (dict[str, object] row, Path repo_root)
dict[str, object] _relativize_error (dict[str, object] row, Path repo_root)
str _relative_path (str filename, Path repo_root)
str _render_markdown (dict[str, object] payload, *, Path data_dir)
str _probe_command (dict[str, object] payload, Path data_dir)
list[str] _render_project (dict[str, object] project)
str _escape_cell (object value)
Path _instrument_root ()
str _command_text (Sequence[str] command)
str _joined_output (*str parts)

Variables

str BASE_SHA = "e4d56a63"
str REPORT_BASENAME = "crap-probe-2026-08"
tuple PROJECTS

Detailed Description

Purpose
-------
Run the Plan 214 worst-first CRAP probe over the Option C monorepo.

Responsibilities
----------------
- Execute each required MAIN-tree subproject suite under coverage.py.
- Invoke ``python -m oct.complexity`` against MAIN sources through worktree PYTHONPATH.
- Preserve failed suites as UNMEASURED with their captured output.
- Generate the full JSON artifact and top-25-per-project Markdown report.

Diagnostics
-----------
Domain: OCT-COMPLEXITY
Levels:
    L2 - probe lifecycle
    L3 - subproject measurement details
    L4 - deep tracing

Contracts
---------
- The probe measures and never gates.
- Failed suites, parse failures, and never-imported functions are never omitted.
- Analyzer commands run against MAIN sources with this worktree's instrument.

Dependencies
------------
- oct.complexity.coverage (coverage suite runner)
- oct.complexity (not imported; run as python -m oct.complexity for the JSON analysis subprocess)

Function Documentation

◆ _command_text()

str oct.complexity.probe._command_text ( Sequence[str] command)
protected
Return a Windows-rerunnable rendering of an argument sequence.

Definition at line 433 of file probe.py.

Here is the caller graph for this function:

◆ _escape_cell()

str oct.complexity.probe._escape_cell ( object value)
protected
Escape Markdown table separators in one cell value.

Definition at line 423 of file probe.py.

◆ _instrument_root()

Path oct.complexity.probe._instrument_root ( )
protected
Return the worktree oct project directory used for PYTHONPATH.

Definition at line 428 of file probe.py.

Here is the caller graph for this function:

◆ _joined_output()

str oct.complexity.probe._joined_output ( *str parts)
protected
Join captured output fragments without silently dropping any.

Definition at line 438 of file probe.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _parser()

argparse.ArgumentParser oct.complexity.probe._parser ( )
protected
Build the probe driver's argument parser.

Definition at line 111 of file probe.py.

Here is the caller graph for this function:

◆ _probe_command()

str oct.complexity.probe._probe_command ( dict[str, object] payload,
Path data_dir )
protected
Return the exact top-level probe command for the report.

Definition at line 347 of file probe.py.

Here is the caller graph for this function:

◆ _relative_path()

str oct.complexity.probe._relative_path ( str filename,
Path repo_root )
protected
Return a forward-slash repository-relative path when possible.

Definition at line 306 of file probe.py.

Here is the caller graph for this function:

◆ _relativize_error()

dict[str, object] oct.complexity.probe._relativize_error ( dict[str, object] row,
Path repo_root )
protected
Replace an absolute parse-error filename with a relative path.

Definition at line 296 of file probe.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _relativize_row()

dict[str, object] oct.complexity.probe._relativize_row ( dict[str, object] row,
Path repo_root )
protected
Replace an absolute source filename with a repository-relative path.

Definition at line 289 of file probe.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _render_markdown()

str oct.complexity.probe._render_markdown ( dict[str, object] payload,
* ,
Path data_dir )
protected
Render the human probe report from the same payload as JSON.

Definition at line 314 of file probe.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _render_project()

list[str] oct.complexity.probe._render_project ( dict[str, object] project)
protected
Render one measured or honestly unmeasured project section.

Definition at line 366 of file probe.py.

Here is the caller graph for this function:

◆ _run_project()

dict[str, object] oct.complexity.probe._run_project ( ProbeProject project,
* ,
Path repo_root,
Path data_dir,
Path python_executable )
protected
Run one suite, then map its data through the module command.

Definition at line 169 of file probe.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _suite_record()

dict[str, object] oct.complexity.probe._suite_record ( CoverageRun suite)
protected
Convert a coverage suite result to stable probe JSON.

Definition at line 279 of file probe.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int oct.complexity.probe.main ( Sequence[str] | None argv = None)
Run every probe project and write both committed artifacts.

Definition at line 127 of file probe.py.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ BASE_SHA

str oct.complexity.probe.BASE_SHA = "e4d56a63"

Definition at line 55 of file probe.py.

◆ PROJECTS

tuple oct.complexity.probe.PROJECTS

Definition at line 69 of file probe.py.

◆ REPORT_BASENAME

str oct.complexity.probe.REPORT_BASENAME = "crap-probe-2026-08"

Definition at line 56 of file probe.py.