feat(plugins): pre_commit_gate injection stage; rebind TEA gates to it#45
Conversation
TEA's trace/nfr/review quality gates were bound to post_review_result, which fires only inside the orchestrator review loop. Under the default review.trigger="recommended" flow, a dev session that recommends no follow-up skips that loop entirely, so the gate sessions never ran and on_pre_commit fail-opened on the missing artifacts — trace/nfr/review *_blocking flags were completely inert on most stories (hit live by hey-dad, whose blocking gates never enforced). Framework: a new pre_commit_gate workflow-injection stage that fires unconditionally at the top of _commit — on the review-converged path, the skip path, and the review-budget rescue alike — before advance(COMMITTING), so the task is still DEV_VERIFY/REVIEW_VERIFY and a blocking gate whose session fails can defer legally (COMMITTING cannot defer). Gate sessions therefore evaluate the exact tree about to commit, and the pre_commit hook that enforces on their artifacts fires right after them on every path. TEA: the three gate workflows rebind stage = "pre_commit_gate" (role stays "review"); generation steps stay at post_dev_phase. Docs + comments updated; enforcement logic in on_pre_commit is unchanged (it is stage-agnostic). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 Augment PR SummarySummary: This PR fixes TEA quality gates not running under the default Changes:
Technical Notes: The new stage is stage-agnostic with respect to enforcement: workflows write artifacts first, then existing 🤖 Was this summary useful? React with 👍 or 👎 |
Problem
TEA's
trace/nfr/reviewquality gates bind topost_review_result— a stage emitted only inside the orchestrator review loop. Under the defaultreview.trigger="recommended"flow, a dev session that setsfollowup_review_recommended: falsetakes_skip_review_and_commit, the loop never runs,post_review_resultnever fires, the three gate sessions never run, andon_pre_commitfail-opens on the missing artifacts (by design). Net effect:trace_blocking/nfr_blocking/review_blocking = truewere completely inert on most stories. Hit live by hey-dad, whose all-blocking gate config never enforced once.Fix
Framework — new
pre_commit_gateinjection stage. Fires unconditionally at the top of_commit, i.e. on every path into a commit: review-converged, skip, and the review-budget rescue (that third path already passes through thepre_commitveto today, so gating it too is consistent). Placement is beforeadvance(COMMITTING): the task is stillDEV_VERIFY/REVIEW_VERIFY, both of which legally transition toDEFERRED, so a blocking gate workflow whose session doesn't complete defers cleanly —COMMITTINGitself has no legal move toDEFERRED. Ordering is inherent: gate sessions write their artifacts, then the existingpre_commitbus hook reads them and enforces. Gate sessions evaluate the exact tree about to commit.WORKFLOW_STAGES+=pre_commit_gate(plugins/model.py); manifest load-time validation andregistry.workflow_stages()pick it up with no registry change.engine._commit:if self._run_workflows("pre_commit_gate", task, task.review_cycle): return(note: on the skip pathreview_cycleis still0, so gate task_ids there end-0).TEA — rebind the gates.
[workflows.trace|nfr|review]→stage = "pre_commit_gate"(role staysreview);td/atdd/automatestay atpost_dev_phase.on_pre_commitenforcement is unchanged — it's stage-agnostic; comments/docs updated (plugin-authoring-guidestage reference + injection-stage list,tea-plugin-guidesix-step table + blocking section).Tests
dev_effect(followup_review=False)+ NO review session → the three gate workflows still run, atpre_commit_gate, beforestory-done(review-skippedpresent in the journal).nfr_blocking=true→summary.escalated == 1,done == 0, run paused, nostory-done.pre_commit_gateworkflow injects before commit on the skip path; a blocking one whose session errors defers legally (deferred == 1).test_runs_inject_six_tea_workflows_in_order, sweep-bundle variant) pass unchanged — on the review path the gates' temporal position is identical.Companion to #44 (livelock fix); the two are independent.
🤖 Generated with Claude Code