oct.git.oct_git module

oct.git.oct_git module#

Purpose#

Click command definitions for the oct git command group (Phase 4B). Contains only CLI glue — argument parsing, JSON rendering, exit-code translation. All computational work is delegated to oct.git.quality_gate, oct.git.policy, and oct.core.git.

Responsibilities#

  • Define the git Click group mounted under the top-level cli.

  • Implement oct git status with --json and --no-check flags.

  • Implement oct git check with --staged-only, --all, --include-tests, --fix, --profile, --json flags.

  • Render human-readable terminal output and machine-readable JSON.

  • Populate ctx.obj["_audit_record"] for the @audited decorator.

Diagnostics#

Domain: GIT Levels:

L2 — lifecycle: command start/end L3 — details: scope/profile resolution L4 — deep trace: per-file rendering decisions

Contracts#

  • Each command is wrapped with @audited from oct.git.audit.

  • Exit codes for oct git check follow blueprint §5.3: 0=pass, 1=lint, 2=format, 3=lint+format, 4=tests, 5=secrets.

  • oct git status always exits 0 (informational only).

Dependencies#

  • oct.core.diagnostics (_dbg structured logger)

  • oct.core.paths (project-relative path helper)

  • oct.core.project_root (project root detection)

  • oct.git.audit (AuditRecord, audited decorator)

  • click (CLI framework)