Commit Task ID Enforcement Specification
Version: 1.0.0 Status: ACTIVE Created: 2026-01-28 Author: Protocol Specification Agent (T2689)RFC 2119 Conformance
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.Part 1: Preamble
1.1 Purpose
This specification defines the commit-msg hook implementation for enforcing task ID inclusion in commit messages, implementing provenance requirements IMPL-003 and CONT-002 from implementation and contribution protocols.1.2 Evidence Base
- T2686: Consensus decision (commit-msg hook with session scope, confidence 0.88)
- T2684: Wave 0 audit (provenance tagging 0% enforcement)
- Git log analysis: 100% voluntary adoption of
(T####)pattern
Part 2: Commit-msg Hook Requirements (CMSG-*)
2.1 Core Hook Behavior
| ID | Requirement | Rationale |
|---|---|---|
| CMSG-001 | Hook MUST validate task ID presence | Enforces IMPL-003, CONT-002 |
| CMSG-002 | Hook MUST accept (T####) pattern | Preserves existing convention |
| CMSG-003 | Hook MUST verify task ID exists via cleo exists | Prevents invalid references |
| CMSG-005 | Hook MUST be bypassable via git commit --no-verify | Emergency escape hatch |
| CMSG-007 | Hook MUST provide auto-suggestion from focus context | Developer UX |
2.2 Hook Lifecycle
Part 3: Pattern Validation (PATTERN-*)
3.1 Task ID Format
| ID | Requirement | Example |
|---|---|---|
| PATTERN-001 | Hook MUST recognize (T####) format | (T2688) |
| PATTERN-002 | Hook SHOULD accept task ID anywhere in message | Prefix, suffix, middle |
| PATTERN-004 | Hook MUST NOT accept lowercase (t####) | Enforce consistency |
| PATTERN-005 | Hook MUST NOT accept without parentheses | Distinguish from noise |
3.2 Pattern Extraction
Regex:\(T[0-9]+\)
Part 4: Session Scope Integration (SCOPE-*)
4.1 Session Context
| ID | Requirement |
|---|---|
| SCOPE-001 | Hook SHOULD validate task ID belongs to session scope (Phase 2) |
| SCOPE-002 | Hook MUST read CLEO_SESSION environment variable |
| SCOPE-004 | Hook SHOULD use cleo focus show for current focused task |
| SCOPE-006 | Hook MUST NOT fail if no session is active |
4.2 Auto-suggestion Logic
Priority:- Current focused task (
cleo focus show) - Session scope tasks (if only one task)
- Branch name task ID (
feature/T####-*) - No suggestion (generic error)
Part 5: Bypass Policy (BYPASS-*)
5.1 Bypass Conditions
| ID | Requirement | Use Case |
|---|---|---|
| BYPASS-001 | Hook MUST allow bypass via --no-verify | Emergency escape |
| BYPASS-002 | Hook MUST log all bypasses | Audit trail |
| BYPASS-004 | Hook SHOULD auto-bypass merge/revert commits | Reduced friction |
5.2 Bypass Log Format
Part 6: Installation
6.1 Via cleo init
6.2 Configuration
Part 7: Example Hook
References
- PROTOCOL-ENFORCEMENT: Overall enforcement architecture
- PROJECT-LIFECYCLE: RCSD pipeline
- MULTI-SESSION: Session scope context
