2.8 KiB
2.8 KiB
description
| description |
|---|
| Audit CI project health — reconstruct state from git log, verify .ci/ files match codebase, check for stale references |
CI Audit
Audit the CI project for health issues. Verifies that git log state matches .ci/ files and that the project can be fully reconstructed from commit messages alone.
Usage: ci-audit
Step 0: Confirm Active Project
Check ci listProjects() or read .ci/config.json to determine if multi-project mode is active.
If .ci/config.json has projects[] with length > 0:
- Confirm
active_projectis correct for this audit - If not, set it with
ci setActiveProject(<slug>) - Scope audit queries to the active project
- All commit messages must include
project: <slug>in---ci---block
If single-project mode: proceed with existing conventions.
Step 1: Reconstruction Test
Attempt to reconstruct the full project state from commit messages only:
- Parse all
---ci---blocks from git log - Reconstruct: current phase, milestone, stage, decisions, escalations, requirements, lessons, compounds
- Compare reconstructed state with
.ci/file contents
Step 2: Check .ci/ File Discipline
For each .ci/ file:
.ci/config.json: valid JSON, required fields present.ci/PROJECT.md: has required sections (What This Is, Requirements, Constraints, Key Decisions).ci/ROADMAP.md: phases match git branches (merged = complete, active = in progress).ci/REQUIREMENTS.md: traceability matrix is complete.ci/ARCHITECTURE.md: components match actual code structure
Step 3: Check Branch Hygiene
- Every
phase/NN-*branch should be either merged or active - Active phase branches should have recent commits
- No orphan branches (branches with no
---ci---commits)
Step 4: Check Commit Discipline
- Every CI-generated commit should have a
---ci---block - No stale decisions (decisions from >50 commits ago that are still in
.ci/but not reflected in code) - No unresolved escalations older than the escalation timeout
Step 5: Display Report
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CI ► AUDIT REPORT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Reconstruction: [PASS/FAIL] — [details]
.ci/ Files: [N] checked, [issues]
Branches: [N] phase, [N] milestone, [issues]
Commits: [N] CI commits, [N] without ---ci--- blocks
[If issues found:]
Issues:
- [issue description]
- [issue description]
[If clean:]
All checks passed. Project state is fully reconstructable from git log.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━