Refactor spawn gate to capability-based gating for Explore agents #90
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/claude-custom!90
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "89-refactor-spawn-gate-to-capability-based"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Removes the issue-reference requirement from Explore agents, which are read-only by architecture and cannot cause failures. The spawn gate now uses capability-based gating: agents with empty
required_patternspass through without any prompt validation.Changes
schemas/agent-spawn-requirements.json-- Clearedrequired_patternsfor Explore type (was requiring issue ref), updated description to reflect capability rationalehooks/check-agent-spawn.sh-- Added explicit early-exit whenrequired_patternsarray is empty, preventing reliance on fragile empty-string loop behaviorTest Plan
Review Checklist
Related
plan-pal-e-agencyPhase 8aCloses #89
PR #90 Review
BLOCKERS
None.
NITS
Line 43 uses
-runnecessarily withlength--jq -r(raw output) is not needed when the output is a numeric value fromlength. It works fine, butjq --arg t "$SUBAGENT_TYPE" '.types[$t].required_patterns | length'without-rwould be more precise. Non-blocking.Comment on line 2 still says "no issue, no agent" axiom -- The hook header comment (
# PreToolUse hook: enforce "no issue, no agent" axiom via schema) is now slightly misleading since the hook explicitly allows agents with no issue reference (Explore). The axiom has shifted to "no issue, no agent -- unless capability-based pass-through." This is a minor doc drift. Non-blocking.SOP COMPLIANCE
89-refactor-spawn-gate-to-capability-basedreferences #89)plan-pal-e-agencyPhase 8a)Closes #89present in PR bodyCODE CORRECTNESS
Traced all six agent-type scenarios through the modified hook:
The early-exit approach is correct and preferable to relying on the fragile behavior where
jq ... '.required_patterns[]'on an empty array produces empty output andgrep -qE ""happens to match any non-empty string. Making the empty-patterns case explicit is the right defensive choice.Schema change is minimal and correct: only Explore's
required_patternschanged from["#[0-9]+|[Ii]ssue|Forgejo issue"]to[], and description updated to reflect the rationale. All other agent types (dev, qa, general-purpose) retain their gates unchanged.VERDICT: APPROVED