88 """Read ``oc_status.json`` and return structured audit information."""
90 _dbg(
"AUDIT", func, f
"start root={project_root}", 2)
92 status = load_oc_status(project_root)
97 f
"no oc_status.json; .option_c exists={has_dotdir}",
104 oct_version_at_migration=
"",
108 exit_code = _STAGE_EXIT_CODES.get(status.stage, 3)
109 _dbg(
"AUDIT", func, f
"end stage={status.stage} exit={exit_code}", 2)
113 pillars=status.pillars,
114 migrated_from=status.migrated_from,
115 oct_version_at_migration=status.oct_version_at_migration,
123@click.option("--json-output", "as_json", is_flag=True, help="Emit JSON instead of human-readable text.")
125def audit(ctx: click.Context, as_json: bool) ->
None:
126 """Report Option C compliance stage (stub for FS-501)."""
127 project_root = get_project_root(ctx)
132 "stage": result.stage,
133 "pillars": result.pillars,
134 "migrated_from": result.migrated_from,
135 "oct_version_at_migration": result.oct_version_at_migration,
136 "exit_code": result.exit_code,
138 click.echo(json.dumps(payload, indent=2))
140 if result.stage
is None:
141 click.echo(
"Stage: unmigrated (no .option_c/oc_status.json)")
143 click.echo(f
"Stage: {result.stage}")
144 for name, info
in result.pillars.items():
145 enabled = info.get(
"enabled",
False)
146 marker =
"+" if enabled
else "-"
147 click.echo(f
" [{marker}] {name}")
148 if result.migrated_from:
149 click.echo(
"Migrated from:")
150 for label, src
in result.migrated_from.items():
151 click.echo(f
" {label}: {src}")
153 raise SystemExit(result.exit_code)