Repository navigation
Closed
Labels
Description
Problem
The fleet standard says to run cora review before every commit, but nothing makes an agent actually do it, and the agent-as-reviewer flow (cora.review_prepare / cora.review_finalize) leaves no trace a hook or CI can check:
- An agent can
git commitwithout ever reviewing; the pre-commit hook is the only net, and it is per repo, opt-in, and--no-verifybypasses it. - The hook installed by
cora hook installrunscora review --staged --format compactwithout--ci, so it cannot block on findings the way the standard requires (--ci --severity major), and it hides stderr. - The hook template has no
# cora-managed-hooksentinel, so runningcora hook installtwice wraps the old hook into the new one. - Agent review and the hook do not know about each other: a diff the agent already judged is reviewed again by the hook (a second LLM call, or a hang on a stale binary).
Proposal
Three tiers, one verifiable record:
- Agent (tier 0): before committing, the agent judges the staged diff with the cora-review skill.
cora.review_finalize(andcora review --stageditself) records a small validation marker in<git-dir>/cora/validations/keyed by the sha256 of the exact diff, with the verdict (should_block, issue counts, who judged). - Hook (tier 1, fallback):
cora hook installwrites a v2 hook that first runscora hook verify; a validated, non-blocking diff passes immediately, otherwise it runscora review --staged --ci --severity major(LLM when a key exists, deterministic checks otherwise) with the standard exit-code handling. Sentinel added; legacy hooks are recognised and upgraded in place. - CI (tier 2): the
Cora Reviewworkflow on PRs todevelopmust fail when a required secret is empty (a green check must not hide a degraded review).
Plus an enforcement point for agents:cora hook claude-guard, a Claude CodePreToolUsecommand that deniesgit commit(and--no-verify) unless the staged diff is validated. Stable exit codes forcora hook verify: 0 validated, 10 validated but blocking, 11 not validated (clap errors stay 2).
Done when
- Marker write/check with tests (match, mismatch after re-stage, blocking, missing, pruning).
cora hook verify,cora hook claude-guard, v2 hook template + sentinel/legacy upgrade, docs, skill text, help text.- End-to-end: stage a change, run the agent flow, commit passes the guard; stage another change, commit is denied;
--no-verifyis denied. - The repo's own pre-commit script and CI secret guard follow in a second PR.
Activity
fix(hook): harden the commit gate against bypasses found in review (#674
fix(hook): treat a bare pathspec as a commit beyond the index (#674)
fix(hook): make the commit guard fail closed on anything but a plain …
fix(hook): deny repo selection, alias and config tricks in the commit…
ci(review): give the Cora Review job 30 minutes (#677)
feat(hook): add the commit gate core, verify and Claude Code guard (#676
feat(hook): pre-commit hook v2 accepts a validated diff and upgrades …
ci(hook): adopt the commit gate in this repo and fail on empty review…
ci(review): give the Cora Review job 30 minutes (#677)
feat(hook): add the commit gate core, verify and Claude Code guard (#676
feat(hook): pre-commit hook v2 accepts a validated diff and upgrades …
docs(hook): document the commit gate, skill and changelog (#689)
ci(hook): adopt the commit gate in this repo and fail on empty review…