oct.audit.oct_audit module#

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)

class oct.audit.oct_audit.AuditResult(stage: str | None, pillars: dict, migrated_from: dict, oct_version_at_migration: str, exit_code: int)[source]#

Bases: object

Structured output from run_audit().

exit_code: int#
migrated_from: dict#
oct_version_at_migration: str#
pillars: dict#
stage: str | None#
oct.audit.oct_audit.run_audit(project_root: Path) AuditResult[source]#

Read oc_status.json and return structured audit information.