Option C Tools
Loading...
Searching...
No Matches
oct.audit.oct_audit Namespace Reference

Classes

class  AuditResult

Functions

AuditResult run_audit (Path project_root)
 audit (ctx, bool as_json)

Variables

dict _STAGE_EXIT_CODES

Detailed Description

Purpose
-------
FS-539 / FS-501 (stub) — ``oct audit`` reads ``oc_status.json`` and
reports the project's Option C compliance stage.

This is the minimal landing surface that ``CLAUDE.md``'s compliance
probe and CI scripts consume. The full audit suite (schema drift,
scaffold age, doc/version mismatch, MCP readiness) lands in Phase 6.

Exit codes
----------
    0  — compliant
    1  — migrating
    2  — bootstrap
    3  — no oc_status.json found (unmigrated project)

Diagnostics
-----------
Domain: AUDIT
Levels:
    L2 — lifecycle

Contracts
---------
- Read-only against the project tree; never writes.
- Exit code is derived from ``oc_status.json`` ``stage`` (or 3 when absent).

Dependencies
------------
- oct.core.diagnostics (_dbg structured logger)
- oct.core.option_c_dir (load_oc_status, option_c_dir)
- oct.core.project_root (project root detection)
- click (CLI framework)

Function Documentation

◆ audit()

oct.audit.oct_audit.audit ( ctx,
bool as_json )
Report Option C compliance stage (stub for FS-501).

Definition at line 110 of file oct_audit.py.

Here is the call graph for this function:

◆ run_audit()

AuditResult oct.audit.oct_audit.run_audit ( Path project_root)
Read ``oc_status.json`` and return structured audit information.

Definition at line 72 of file oct_audit.py.

Here is the caller graph for this function:

Variable Documentation

◆ _STAGE_EXIT_CODES

dict oct.audit.oct_audit._STAGE_EXIT_CODES
protected
Initial value:
1= {
2 "compliant": 0,
3 "migrating": 1,
4 "bootstrap": 2,
5}

Definition at line 54 of file oct_audit.py.