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.
Responsibilities
----------------
- Locate the project root and read ``oc_status.json`` from the
``.option_c/`` directory when one exists.
- Map the recorded ``stage`` onto the process exit code below, so a CI
script or the ``CLAUDE.md`` compliance probe can branch on it without
parsing text.
- Report the stage in human-readable form, or as JSON under
``--json-output`` for machine consumers.
- Treat an absent ``oc_status.json`` as a distinct outcome (exit 3)
rather than an error: an unmigrated project is a legitimate state.
Exit codes
----------
0 - compliant
1 - migrating
2 - bootstrap
3 - no oc_status.json found (unmigrated project)
Diagnostics
-----------
Domain: AUDIT
Levels:
L1 - errors: none; an unreadable or absent status file is exit 3
L2 - lifecycle: audit entry and the resolved stage
L3 - semantic: the status path probed and the stage read from it
L4 - deep tracing: the raw status payload
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)