Skip to content

feat: cora commit — review + auto commit message + quality gate (#262) - #263

Merged
ajianaz merged 4 commits into
developfrom
feat/cora-commit
Jun 13, 2026
Merged

ajianaz merged 4 commits into
developfrom
feat/cora-commit

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

cora commit — Review + Auto Commit Message + Quality Gate (Issue #262)

What's New

cora commit — single command that reviews staged changes, generates a conventional commit message, and commits (or blocks).

cora commit                # HITL mode — review, generate message, ask [Y]es/[E]dit/[N]o
cora commit --yolo         # YOLO mode — auto-commit, zero 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
cora commit --quiet        # Suppress output
cora commit --stream       # Stream LLM response

Two Modes

HITL (default)

🔍 Reviewing staged changes (3 files, 247 lines)...
✅ No issues found (quality score: 9.2/10)

📝 Generated commit message:
  feat(auth): add session expiry validation

Accept commit message? [Y]es / [E]dit / [N]o › 

YOLO (--yolo)

No prompts. Auto-commits on gate pass, blocks on gate fail.

Features

  • Conventional commit format (feat/fix/refactor/perf/docs/test/chore/style/build/ci)
  • Auto-truncates subjects to 72 chars
  • Quality gate integration (block on FAIL unless --force)
  • Debt snapshot saved after commit
  • Multi-line messages via temp file (git commit -F)
  • Multi-word $EDITOR support via sh -c
  • Unique temp files (nanosecond timestamps)

Files Changed

File Change
src/commands/commit_cmd.rs NEW — 22 unit tests
src/commands/mod.rs Add module
src/engine/llm.rs Add chat_completion_raw() + chat_completion_stream_raw()
src/main.rs Add Commit subcommand

Verification

  • cargo test — 517/517 pass (22 new)
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo fmt --all -- --check — clean

ajianaz added 4 commits June 13, 2026 13:19
…#262)

- New src/commands/commit_cmd.rs with full commit workflow
- HITL mode (default): interactive [Y]es/[E]dit/[N]o prompt
- YOLO mode (--yolo): auto-commit, zero prompts
- --force: commit even if quality gate fails
- --no-review: skip review, only generate commit message
- --edit: always open $EDITOR
- Conventional commit format (feat/fix/refactor/perf/docs/test/chore/style/build/ci)
- Auto-truncates long subjects to 72 chars
- Quality gate integration (block on FAIL unless --force)
- Debt snapshot saved after commit
- LLM prompt optimized for commit message generation
- chat_completion_raw() + chat_completion_stream_raw() in engine/llm.rs
- 22 unit tests (parse, prompt, stats, message formatting)
- All 517 tests pass, clippy clean, fmt clean
- Unique temp file per process (avoid collision)
- Handle multi-word $EDITOR (e.g. code --wait)
- Use git commit -F for multi-line messages
- Include deleted lines in diff stats
- All 517 tests pass, clippy clean
- Use nanosecond timestamps for unique temp file names
- Use sh -c for multi-word $EDITOR handling (e.g. code --wait)
- git commit -F for multi-line messages via temp file
- All 517 tests pass, clippy clean
- README: add commit to quick-start + commands table
- docs/cli-reference.md: add commit rows + examples
- docs/usage.md: new Commit Workflow section with HITL/YOLO + flags
- CHANGELOG.md: add commit to [Unreleased]
- AGENT.md/.agent.md: bump test count to 517, add commit_cmd.rs
@ajianaz
ajianaz merged commit 129fd69 into develop Jun 13, 2026
10 checks passed
@ajianaz
ajianaz deleted the feat/cora-commit branch June 13, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant