Repository navigation
feat: cora commit — review + auto commit message + quality gate #262
Copy link
Copy link
Closed
Labels
featuremode:hitlHuman-in-the-Loop interactive modeHuman-in-the-Loop interactive modepriority:highscope:commitCommit workflow integrationCommit workflow integrationv0.5Polish + stabilityPolish + stability
Description
Feature: cora commit
Problem
Cora only lives at one point in the developer workflow — cora review. Most developers commit dozens of times per day but never run review. Cora needs to be part of the daily git workflow, not an occasional CI tool.
Proposal
cora commit — a single command that reviews staged changes, generates a conventional commit message, and commits (or blocks).
$ git add src/auth.rs
$ cora commitTwo Modes
HITL (default) — Human-in-the-Loop
Interactive confirmation before committing:
🔍 Reviewing staged changes (3 files, 247 lines)...
✅ No issues found (quality score: 9.2/10)
📝 Generated commit message:
feat(auth): add session expiry validation
- Add configurable session TTL (default 24h)
- Validate expiry on each request
- Return 401 on expired sessions
Accept commit message? [Y]es / [E]dit / [N]o ›
- Y — commit with generated message
- E — open
$EDITORto edit message, then commit - N — abort, no commit
Gate fail example:
🔍 Reviewing staged changes (2 files, 89 lines)...
❌ Quality gate FAILED — 1 critical
🔴 CRITICAL src/db.rs:42 — SQL injection in user query
Commit blocked. Fix issues or: cora commit --force
YOLO — --yolo flag
Auto-accept everything. No prompts. Designed for trusted workflows:
cora commit --yoloBehavior:
- Review staged diff
- If quality gate FAIL → abort (exit 2), no commit
- If quality gate PASS → generate commit message → commit immediately
- No prompts, no interaction
Use cases: CI pipelines, trusted automation, developers who want zero friction.
CLI Flags
cora commit # HITL mode (default)
cora commit --yolo # YOLO mode — auto-commit, no prompts
cora commit --force # Commit even if quality gate fails
cora commit --no-review # Skip review, only generate commit message
cora commit --edit # Always open editor (skip Y/N prompt)
Implementation
New file: src/commands/commit_cmd.rs
src/commands/
├── commit_cmd.rs # NEW: cora commit subcommand
├── review.rs # existing
└── ...
Flow:
cora commit
│
├─ 1. git diff --cached (get staged diff)
│ └─ empty? → "Nothing staged. Use git add first."
│
├─ 2. Review staged diff (reuse existing review pipeline)
│ ├─ Call LLM with commit-message-specific prompt
│ ├─ Returns: ReviewResponse + suggested commit message
│ └─ Quality gate evaluation (if enabled)
│
├─ 3. Quality gate check
│ ├─ PASS → continue
│ └─ FAIL → block (unless --force)
│
├─ 4. Present commit message
│ ├─ HITL: show message, prompt [Y]es/[E]dit/[N]o
│ └─ YOLO: skip prompt, proceed
│
├─ 5. Execute git commit with message
│
└─ 6. Save debt snapshot (if debt tracking enabled)
LLM Prompt (commit message specific):
Different from review prompt. Focus on:
- Generating conventional commit message (feat/fix/refactor/etc)
- Concise body with bullet points
- NOT finding issues (that is the review prompt)
Two LLM calls or one combined call:
- Option A (preferred): One call with combined prompt — "review this diff AND generate a commit message"
- Option B: Two separate calls — review first, then commit message
Config
# .cora.yaml
commit:
mode: hitl # hitl (default) or yolo
convention: conventional # conventional (default), plain, emoji
max_message_lines: 10 # max lines in commit bodyExit Codes
| Code | Meaning |
|---|---|
| 0 | Committed successfully |
| 1 | Error (no staged changes, LLM fail, etc.) |
| 2 | Quality gate failed |
| 3 | Auth error |
Acceptance Criteria
-
cora commitreviews staged diff and generates commit message - HITL mode: interactive [Y]es/[E]dit/[N]o prompt
-
--yoloflag: auto-commit without prompts -
--forceflag: commit even if quality gate fails -
--no-reviewflag: skip review, only generate message - Quality gate integration (block on FAIL unless --force)
- Debt snapshot saved after commit
- Conventional commit format (feat/fix/refactor/chore/docs/test)
- Works with pre-existing pre-commit hooks
-
cora commit --helpdocumented - Unit tests for commit message generation
- Integration test: staged diff → commit created
- docs/cli-reference.md updated
- docs/usage.md updated
Dependencies
- Reuses existing: review pipeline, quality gate, LLM engine
- New: commit message generation prompt, interactive prompt handler
Effort
Medium (1-2 weeks)
- Week 1: commit_cmd.rs + LLM prompt + HITL/YOLO modes
- Week 2: flags, config, tests, docs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featuremode:hitlHuman-in-the-Loop interactive modeHuman-in-the-Loop interactive modepriority:highscope:commitCommit workflow integrationCommit workflow integrationv0.5Polish + stabilityPolish + stability
Activity
feat: `cora commit` — review + auto commit message + quality gate (#262…
docs: pre-release sync — cora commit across all docs (#274)
release: v0.5.1 (#277)
ajianaz commentedon Jun 14, 2026
Shipped in v0.5.1 (#263).
cora commitwith HITL + YOLO modes ✅--force,--no-review,--edit,--stream,--quiet✅