feat(#1137): migrate review verification hooks to capabilities (#1147)

* feat(#1137): migrate review verification hooks to capabilities

* chore(#1147): add changeset
This commit is contained in:
Tom Boucher
2026-06-12 21:24:09 -04:00
committed by GitHub
parent 44024aa535
commit 1b880fefd7
25 changed files with 951 additions and 109 deletions

View File

@@ -74,21 +74,23 @@ FIX_REPORT_PATH="${PHASE_DIR}/${PADDED_PHASE}-REVIEW-FIX.md"
</step>
<step name="check_config_gate">
Check if code review is enabled via config:
Check if code review is active via the capability registry:
```bash
CODE_REVIEW_ENABLED=$(gsd_run query config-get workflow.code_review 2>/dev/null || echo "true")
EXECUTE_POST_HOOKS_JSON=$(gsd_run loop render-hooks execute:post --raw)
```
If CODE_REVIEW_ENABLED is "false":
Resolve active step hooks from `EXECUTE_POST_HOOKS_JSON` where `kind == "step"` and `ref.skill == "code-review"`.
If no active code-review step hook exists:
```
Code review fix skipped (workflow.code_review=false in config)
Code review fix skipped (code-review capability inactive)
```
Exit workflow.
Default is true — only skip on explicit false. This check runs AFTER phase validation so invalid phase errors are shown first.
Default is active through the Capability Registry schema — only skip when the registry resolves no active code-review step hook. This check runs AFTER phase validation so invalid phase errors are shown first.
Note: This reuses the `workflow.code_review` config key rather than introducing a separate `workflow.code_review_fix` key. Rationale: fixes are meaningless without review, so a single toggle makes sense. If independent control is needed later, a separate key can be added in v2.
Note: This reuses the code-review capability activation rather than introducing a separate code-review-fix capability. Rationale: fixes are meaningless without review, so a single activation boundary makes sense. If independent control is needed later, a separate key can be added in v2.
</step>
<step name="check_review_exists">
@@ -491,7 +493,7 @@ echo "════════════════════════
<success_criteria>
- [ ] Phase validated before config gate check
- [ ] Config gate checked (workflow.code_review)
- [ ] Capability gate checked (execute:post code-review hook)
- [ ] REVIEW.md existence verified (error if missing)
- [ ] REVIEW.md status checked (skip if clean/skipped)
- [ ] Agent spawned with correct config (review_path, fix_scope, fix_report_path)