Description
The label-governance.sh hook currently only blocks agent:start (prevents infinite re-invocation). But the agent can add any other label — including ones that don't exist or aren't meaningful (e.g. agent:pr, agent:foo).
Observed
The agent added agent:pr which is not a recognized pipeline label. It should only be allowed to set labels from a defined allowlist.
Proposed
Add an allowlist to label-governance.sh. Only labels matching the allowed set pass; anything else with the {LABEL_PREFIX}: prefix is blocked.
Suggested allowlist:
agent:explore
agent:implement
agent:critique
agent:done
agent:blocked
agent:clarification
Any label not in this list that starts with agent: should be blocked with exit 2.
Files
coding-assistants/claude-code/plugin/hooks/label-governance.sh — add allowlist logic
test/hooks/test_hooks.sh — add test cases for allowed/blocked labels
sdlc-config.template.yaml — optionally make the allowlist configurable
Constraints
- Keep
agent:start as the hard-block (current behavior)
- The allowlist should be configurable via env var or config (so different projects can customize)
- Labels without the
agent: prefix are always allowed (team labels, GitHub defaults, etc.)
Description
The
label-governance.shhook currently only blocksagent:start(prevents infinite re-invocation). But the agent can add any other label — including ones that don't exist or aren't meaningful (e.g.agent:pr,agent:foo).Observed
The agent added
agent:prwhich is not a recognized pipeline label. It should only be allowed to set labels from a defined allowlist.Proposed
Add an allowlist to
label-governance.sh. Only labels matching the allowed set pass; anything else with the{LABEL_PREFIX}:prefix is blocked.Suggested allowlist:
agent:exploreagent:implementagent:critiqueagent:doneagent:blockedagent:clarificationAny label not in this list that starts with
agent:should be blocked with exit 2.Files
coding-assistants/claude-code/plugin/hooks/label-governance.sh— add allowlist logictest/hooks/test_hooks.sh— add test cases for allowed/blocked labelssdlc-config.template.yaml— optionally make the allowlist configurableConstraints
agent:startas the hard-block (current behavior)agent:prefix are always allowed (team labels, GitHub defaults, etc.)