Skip to content

feat(hook): pre-commit hook v2 accepts a validated diff and upgrades in place - #688

Merged
ajianaz merged 1 commit into
developfrom
feat/674-hook-v2
Oct 16, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/674-hook-v2

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

What

Part 2 of 3 for #674 (part 1 is #676).

  • Hook template v2: cora hook verify --quiet first (0 pass, 10 deny), then the fallback cora review --staged --ci --severity major; a tooling error is reported as not a pass.
  • cora hook install recognises legacy v1 hooks and upgrades them in place instead of wrapping them a second time.
  • 12 end-to-end tests with real temporary git repos (agent verdict through MCP, hook, guard, upgrade).

Why

The hook is the fallback when the agent judge was not used, and must not re-review a diff that was already validated. Part of #674.

Testing

  • Unit tests for the template and legacy detection.
  • tests/commit_gate.rs: 12 e2e tests, all passing; fmt, clippy -D warnings and the full suite pass.

…in place (#674)

Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
@ajianaz
ajianaz merged commit e8f3595 into develop Oct 16, 2026
14 checks passed
ajianaz added a commit that referenced this pull request Oct 16, 2026
## What

Part 3 of 3 for #674 (parts 1 and 2: #676, #688).

- `/cora-review` skill: review the staged diff before every commit.
- `docs/usage.md`: the three-layer commit gate and the Claude Code guard
snippet.
- `docs/cli-reference.md`: `cora hook verify` and `cora hook
claude-guard`.
- CHANGELOG entry.

## Why

Agents need to know to review before committing, and users need the
setup steps. Closes #674.

## Testing

- Docs and skill text only; the skill is embedded in the binary, so the
build and full test suite were run (pass).

Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
Co-authored-by: ajianaz <ajianaz@users.noreply.github.com>
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