@windyroad/itil 1.2.0 → 2.0.0-preview.1111

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/.agents/plugins/marketplace.json +12 -0
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +42 -0
  4. package/README.md +34 -25
  5. package/agents/hang-off-check.md +34 -34
  6. package/bin/install.mjs +71 -5
  7. package/bin/wr-itil-catchup-scan +4 -4
  8. package/bin/wr-itil-check-deferred-placeholder-staleness +4 -4
  9. package/bin/wr-itil-check-fail-soft-skip-discipline +4 -4
  10. package/bin/wr-itil-check-fix-rfc-trace +4 -4
  11. package/bin/wr-itil-check-locale-discipline +4 -4
  12. package/bin/wr-itil-check-outbound-responses-staleness +4 -4
  13. package/bin/wr-itil-check-problems-readme-budget +4 -4
  14. package/bin/wr-itil-check-rfc-has-stories +4 -4
  15. package/bin/wr-itil-check-rfc-stories-ratified +4 -4
  16. package/bin/wr-itil-check-ticket-jtbd-ratification +4 -4
  17. package/bin/wr-itil-check-upstream-cache-staleness +4 -4
  18. package/bin/wr-itil-check-upstream-responses +4 -4
  19. package/bin/wr-itil-classify-readme-drift +4 -4
  20. package/bin/wr-itil-derive-release-vehicle +4 -4
  21. package/bin/wr-itil-detect-unratified-stories-maps +4 -4
  22. package/bin/wr-itil-effort-tally +4 -4
  23. package/bin/wr-itil-enumerate-postrelease-kv-candidates +4 -4
  24. package/bin/wr-itil-evaluate-relevance +4 -4
  25. package/bin/wr-itil-mark-create-gate +4 -4
  26. package/bin/wr-itil-mark-story-oversight-confirmed +4 -4
  27. package/bin/wr-itil-migrate-problems-layout +4 -4
  28. package/bin/wr-itil-migrate-story-status-mirror +4 -4
  29. package/bin/wr-itil-next-rfc-id +4 -4
  30. package/bin/wr-itil-plugin-exercise-index +4 -4
  31. package/bin/wr-itil-plugin-maturity-populate +4 -4
  32. package/bin/wr-itil-plugin-maturity-render +4 -4
  33. package/bin/wr-itil-plugin-validate-ci-gate +4 -4
  34. package/bin/wr-itil-reconcile-readme +4 -4
  35. package/bin/wr-itil-reconcile-rfcs +4 -4
  36. package/bin/wr-itil-reconcile-stories +4 -4
  37. package/bin/wr-itil-reconcile-story-maps +4 -4
  38. package/bin/wr-itil-render-story-map +4 -4
  39. package/bin/wr-itil-resolve-governance-plugin-dirs +4 -4
  40. package/bin/wr-itil-skill-invocations +4 -4
  41. package/bin/wr-itil-story-map-edit +4 -4
  42. package/bin/wr-itil-story-map-query +4 -4
  43. package/bin/wr-itil-update-jtbd-references-section +4 -4
  44. package/bin/wr-itil-update-problem-references-section +4 -4
  45. package/bin/wr-itil-update-problem-rfcs-section +4 -4
  46. package/bin/wr-itil-update-rfc-commits-section +4 -4
  47. package/bin/wr-itil-update-rfc-references-section +4 -4
  48. package/bin/wr-itil-verify-iter-summary +4 -4
  49. package/hooks/itil-assistant-output-gate.sh +3 -3
  50. package/hooks/itil-assistant-output-review.sh +5 -5
  51. package/hooks/itil-bash-polling-antipattern-detect.sh +11 -11
  52. package/hooks/itil-changeset-discipline.sh +24 -24
  53. package/hooks/itil-claude-space-protection.sh +21 -14
  54. package/hooks/itil-codex-dispatch.sh +164 -0
  55. package/hooks/itil-commit-trailer-transition-advisory.sh +11 -11
  56. package/hooks/itil-correction-detect.sh +8 -8
  57. package/hooks/itil-deferral-cadence-gate.sh +23 -23
  58. package/hooks/itil-fictional-defer-detect.sh +16 -16
  59. package/hooks/itil-fix-title-lifecycle-advisory.sh +11 -11
  60. package/hooks/itil-mid-loop-ask-detect.sh +14 -14
  61. package/hooks/itil-no-implement-draft-gate.sh +18 -18
  62. package/hooks/itil-pending-questions-surface.sh +11 -11
  63. package/hooks/itil-readme-refresh-discipline.sh +27 -27
  64. package/hooks/itil-rfc-oversight-nudge.sh +7 -7
  65. package/hooks/itil-rfc-trailer-advisory.sh +28 -28
  66. package/hooks/itil-runtime-sid-marker.sh +11 -11
  67. package/hooks/itil-story-mirror-migration-nudge.sh +7 -7
  68. package/hooks/lib/block-list.sh +17 -17
  69. package/hooks/lib/changeset-detect.sh +27 -27
  70. package/hooks/lib/claude-space-gate.sh +23 -15
  71. package/hooks/lib/command-detect.sh +12 -12
  72. package/hooks/lib/create-gate.sh +9 -39
  73. package/hooks/lib/detectors.sh +12 -12
  74. package/hooks/lib/readme-refresh-detect.sh +51 -51
  75. package/hooks/lib/runtime-sid.sh +12 -12
  76. package/hooks/lib/session-id.sh +28 -28
  77. package/hooks/lib/session-marker.sh +1 -1
  78. package/hooks/lib/staging-detect.sh +13 -13
  79. package/hooks/manage-problem-enforce-create.sh +16 -27
  80. package/hooks/p057-staging-trap-detect.sh +18 -18
  81. package/hooks/pre-publish-intake-gate.sh +5 -5
  82. package/hooks/staleness-check.sh +6 -6
  83. package/hooks-codex/hooks.json +57 -0
  84. package/lib/check-deferred-placeholder-staleness.sh +10 -10
  85. package/lib/check-outbound-responses-staleness.sh +2 -2
  86. package/lib/check-upstream-cache-staleness.sh +2 -2
  87. package/lib/derive-first-dispatch.sh +19 -19
  88. package/lib/enumerate-postrelease-kv-candidates.sh +18 -18
  89. package/lib/migrate-problems-layout.sh +12 -12
  90. package/lib/story-oversight.sh +27 -27
  91. package/package.json +16 -3
  92. package/scripts/catchup-scan.sh +25 -25
  93. package/scripts/check-fail-soft-skip-discipline.sh +10 -10
  94. package/scripts/check-fix-rfc-trace.sh +8 -8
  95. package/scripts/check-locale-discipline.sh +13 -13
  96. package/scripts/check-problems-readme-budget.sh +12 -12
  97. package/scripts/check-rfc-has-stories.sh +7 -7
  98. package/scripts/check-rfc-rejected-alternatives.sh +11 -11
  99. package/scripts/check-rfc-stories-ratified.sh +9 -9
  100. package/scripts/check-ticket-jtbd-ratification.sh +10 -10
  101. package/scripts/check-upstream-responses.sh +22 -22
  102. package/scripts/classify-readme-drift.sh +13 -13
  103. package/scripts/codex-agent.mjs +104 -0
  104. package/scripts/derive-release-vehicle.sh +23 -23
  105. package/scripts/detect-unoversighted-rfcs.sh +3 -3
  106. package/scripts/detect-unratified-stories-maps.sh +5 -5
  107. package/scripts/effort-tally.sh +10 -10
  108. package/scripts/evaluate-relevance.sh +16 -16
  109. package/scripts/mark-create-gate.sh +4 -4
  110. package/scripts/mark-story-oversight-confirmed.sh +14 -14
  111. package/scripts/migrate-story-status-mirror.sh +6 -6
  112. package/scripts/next-rfc-id.sh +5 -5
  113. package/scripts/plugin-exercise-index.sh +26 -26
  114. package/scripts/plugin-maturity-populate.sh +38 -38
  115. package/scripts/plugin-maturity-render.sh +26 -26
  116. package/scripts/plugin-validate-ci-gate.sh +14 -14
  117. package/scripts/reconcile-readme.sh +23 -23
  118. package/scripts/reconcile-rfcs.sh +13 -13
  119. package/scripts/reconcile-stories.sh +12 -12
  120. package/scripts/reconcile-story-maps.sh +6 -6
  121. package/scripts/render-story-map.mjs +24 -24
  122. package/scripts/render-story-map.sh +3 -3
  123. package/scripts/resolve-governance-plugin-dirs.sh +10 -10
  124. package/scripts/run-check-deferred-placeholder-staleness.sh +3 -3
  125. package/scripts/run-check-outbound-responses-staleness.sh +3 -3
  126. package/scripts/run-check-upstream-cache-staleness.sh +3 -3
  127. package/scripts/run-enumerate-postrelease-kv-candidates.sh +3 -3
  128. package/scripts/run-migrate-problems-layout.sh +3 -3
  129. package/scripts/skill-invocations.sh +29 -29
  130. package/scripts/story-map-edit.mjs +6 -6
  131. package/scripts/story-map-edit.sh +3 -3
  132. package/scripts/story-map-query.mjs +8 -8
  133. package/scripts/story-map-query.sh +3 -3
  134. package/scripts/update-jtbd-references-section.sh +8 -8
  135. package/scripts/update-problem-references-section.sh +12 -12
  136. package/scripts/update-problem-rfcs-section.sh +9 -9
  137. package/scripts/update-rfc-commits-section.sh +7 -7
  138. package/scripts/update-rfc-references-section.sh +3 -3
  139. package/scripts/update-story-references-section.sh +5 -5
  140. package/scripts/verify-iter-summary.sh +3 -3
  141. package/skills/capture-problem/REFERENCE.md +33 -33
  142. package/skills/capture-problem/SKILL.md +108 -108
  143. package/skills/capture-problem/agents/openai.yaml +3 -0
  144. package/skills/capture-rfc/SKILL.md +21 -323
  145. package/skills/capture-rfc/agents/openai.yaml +3 -0
  146. package/skills/capture-story/SKILL.md +65 -65
  147. package/skills/capture-story/agents/openai.yaml +3 -0
  148. package/skills/capture-story-map/SKILL.md +31 -31
  149. package/skills/capture-story-map/agents/openai.yaml +3 -0
  150. package/skills/check-upstream-responses/SKILL.md +38 -38
  151. package/skills/check-upstream-responses/agents/openai.yaml +3 -0
  152. package/skills/close-incident/SKILL.md +25 -25
  153. package/skills/close-incident/agents/openai.yaml +3 -0
  154. package/skills/link-incident/SKILL.md +22 -22
  155. package/skills/link-incident/agents/openai.yaml +3 -0
  156. package/skills/list-incidents/SKILL.md +9 -9
  157. package/skills/list-incidents/agents/openai.yaml +3 -0
  158. package/skills/list-problems/SKILL.md +17 -17
  159. package/skills/list-problems/agents/openai.yaml +3 -0
  160. package/skills/list-stories/SKILL.md +23 -23
  161. package/skills/list-stories/agents/openai.yaml +3 -0
  162. package/skills/list-story-maps/SKILL.md +9 -9
  163. package/skills/list-story-maps/agents/openai.yaml +3 -0
  164. package/skills/manage-incident/SKILL.md +59 -59
  165. package/skills/manage-incident/agents/openai.yaml +3 -0
  166. package/skills/manage-problem/SKILL.md +222 -222
  167. package/skills/manage-problem/agents/openai.yaml +3 -0
  168. package/skills/manage-rfc/SKILL.md +62 -62
  169. package/skills/manage-rfc/agents/openai.yaml +3 -0
  170. package/skills/manage-story/SKILL.md +49 -49
  171. package/skills/manage-story/agents/openai.yaml +3 -0
  172. package/skills/manage-story-map/SKILL.md +30 -30
  173. package/skills/manage-story-map/agents/openai.yaml +3 -0
  174. package/skills/mitigate-incident/SKILL.md +40 -40
  175. package/skills/mitigate-incident/agents/openai.yaml +3 -0
  176. package/skills/reconcile-readme/SKILL.md +28 -28
  177. package/skills/reconcile-readme/agents/openai.yaml +3 -0
  178. package/skills/reconcile-stories/SKILL.md +17 -17
  179. package/skills/reconcile-stories/agents/openai.yaml +3 -0
  180. package/skills/reconcile-story-maps/SKILL.md +11 -11
  181. package/skills/reconcile-story-maps/agents/openai.yaml +3 -0
  182. package/skills/report-upstream/SKILL.md +73 -73
  183. package/skills/report-upstream/agents/openai.yaml +3 -0
  184. package/skills/restore-incident/SKILL.md +28 -28
  185. package/skills/restore-incident/agents/openai.yaml +3 -0
  186. package/skills/review-problems/SKILL.md +129 -129
  187. package/skills/review-problems/agents/openai.yaml +3 -0
  188. package/skills/scaffold-intake/SKILL.md +26 -26
  189. package/skills/scaffold-intake/agents/openai.yaml +3 -0
  190. package/skills/transition-problem/SKILL.md +85 -85
  191. package/skills/transition-problem/agents/openai.yaml +3 -0
  192. package/skills/transition-problems/SKILL.md +69 -69
  193. package/skills/transition-problems/agents/openai.yaml +3 -0
  194. package/skills/update-upstream/SKILL.md +97 -97
  195. package/skills/update-upstream/agents/openai.yaml +3 -0
  196. package/skills/work-problem/SKILL.md +42 -42
  197. package/skills/work-problem/agents/openai.yaml +3 -0
  198. package/skills/work-problems/SKILL.md +327 -327
  199. package/skills/work-problems/agents/openai.yaml +3 -0
  200. package/skills-codex/capture-problem/REFERENCE.md +139 -0
  201. package/skills-codex/capture-problem/SKILL.md +438 -0
  202. package/skills-codex/capture-problem/agents/openai.yaml +3 -0
  203. package/skills-codex/capture-rfc/SKILL.md +45 -0
  204. package/skills-codex/capture-rfc/agents/openai.yaml +3 -0
  205. package/skills-codex/capture-story/SKILL.md +407 -0
  206. package/skills-codex/capture-story/agents/openai.yaml +3 -0
  207. package/skills-codex/capture-story-map/SKILL.md +286 -0
  208. package/skills-codex/capture-story-map/agents/openai.yaml +3 -0
  209. package/skills-codex/check-upstream-responses/SKILL.md +160 -0
  210. package/skills-codex/check-upstream-responses/agents/openai.yaml +3 -0
  211. package/skills-codex/close-incident/SKILL.md +192 -0
  212. package/skills-codex/close-incident/agents/openai.yaml +3 -0
  213. package/skills-codex/link-incident/SKILL.md +173 -0
  214. package/skills-codex/link-incident/agents/openai.yaml +3 -0
  215. package/skills-codex/list-incidents/SKILL.md +92 -0
  216. package/skills-codex/list-incidents/agents/openai.yaml +3 -0
  217. package/skills-codex/list-problems/SKILL.md +126 -0
  218. package/skills-codex/list-problems/agents/openai.yaml +3 -0
  219. package/skills-codex/list-stories/SKILL.md +170 -0
  220. package/skills-codex/list-stories/agents/openai.yaml +3 -0
  221. package/skills-codex/list-story-maps/SKILL.md +104 -0
  222. package/skills-codex/list-story-maps/agents/openai.yaml +3 -0
  223. package/skills-codex/manage-incident/SKILL.md +378 -0
  224. package/skills-codex/manage-incident/agents/openai.yaml +3 -0
  225. package/skills-codex/manage-problem/SKILL.md +1180 -0
  226. package/skills-codex/manage-problem/agents/openai.yaml +3 -0
  227. package/skills-codex/manage-rfc/SKILL.md +314 -0
  228. package/skills-codex/manage-rfc/agents/openai.yaml +3 -0
  229. package/skills-codex/manage-story/SKILL.md +284 -0
  230. package/skills-codex/manage-story/agents/openai.yaml +3 -0
  231. package/skills-codex/manage-story-map/SKILL.md +198 -0
  232. package/skills-codex/manage-story-map/agents/openai.yaml +3 -0
  233. package/skills-codex/mitigate-incident/SKILL.md +239 -0
  234. package/skills-codex/mitigate-incident/agents/openai.yaml +3 -0
  235. package/skills-codex/reconcile-readme/SKILL.md +175 -0
  236. package/skills-codex/reconcile-readme/agents/openai.yaml +3 -0
  237. package/skills-codex/reconcile-stories/SKILL.md +124 -0
  238. package/skills-codex/reconcile-stories/agents/openai.yaml +3 -0
  239. package/skills-codex/reconcile-story-maps/SKILL.md +81 -0
  240. package/skills-codex/reconcile-story-maps/agents/openai.yaml +3 -0
  241. package/skills-codex/report-upstream/SKILL.md +716 -0
  242. package/skills-codex/report-upstream/agents/openai.yaml +3 -0
  243. package/skills-codex/restore-incident/SKILL.md +216 -0
  244. package/skills-codex/restore-incident/agents/openai.yaml +3 -0
  245. package/skills-codex/review-problems/SKILL.md +524 -0
  246. package/skills-codex/review-problems/agents/openai.yaml +3 -0
  247. package/skills-codex/scaffold-intake/SKILL.md +209 -0
  248. package/skills-codex/scaffold-intake/agents/openai.yaml +3 -0
  249. package/skills-codex/scaffold-intake/templates/CONTRIBUTING.md.tmpl +31 -0
  250. package/skills-codex/scaffold-intake/templates/SECURITY.md.tmpl +39 -0
  251. package/skills-codex/scaffold-intake/templates/SUPPORT.md.tmpl +32 -0
  252. package/skills-codex/scaffold-intake/templates/config.yml.tmpl +8 -0
  253. package/skills-codex/scaffold-intake/templates/problem-report.yml.tmpl +114 -0
  254. package/skills-codex/transition-problem/SKILL.md +371 -0
  255. package/skills-codex/transition-problem/agents/openai.yaml +3 -0
  256. package/skills-codex/transition-problems/SKILL.md +310 -0
  257. package/skills-codex/transition-problems/agents/openai.yaml +3 -0
  258. package/skills-codex/update-upstream/SKILL.md +583 -0
  259. package/skills-codex/update-upstream/agents/openai.yaml +3 -0
  260. package/skills-codex/work-problem/SKILL.md +160 -0
  261. package/skills-codex/work-problem/agents/openai.yaml +3 -0
  262. package/skills-codex/work-problems/SKILL.md +58 -0
  263. package/skills-codex/work-problems/agents/openai.yaml +3 -0
  264. package/templates/story-map.css +1 -1
  265. package/bin/wr-itil-mark-rfc-capture-gate +0 -51
  266. package/scripts/mark-rfc-capture-gate.sh +0 -32
@@ -0,0 +1,164 @@
1
+ #!/usr/bin/env bash
2
+ # Fan out ITIL hooks from one trusted Codex hook per lifecycle event.
3
+
4
+ set -euo pipefail
5
+
6
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
+ EVENT="${1:-}"
8
+ INPUT="$(cat)"
9
+ INPUT="$(printf '%s' "$INPUT" | CODEX_THREAD_ID="${CODEX_THREAD_ID:-}" python3 -c '
10
+ import json, os, sys
11
+ try:
12
+ value = json.load(sys.stdin)
13
+ except (json.JSONDecodeError, TypeError):
14
+ value = {}
15
+ value.setdefault("session_id", os.environ.get("CODEX_THREAD_ID", ""))
16
+ value.setdefault("cwd", os.getcwd())
17
+ value.setdefault("tool_input", {})
18
+ print(json.dumps(value))
19
+ ')"
20
+ OUTPUTS=()
21
+
22
+ run_hook() {
23
+ local output
24
+ output="$(printf '%s' "$INPUT" | "$SCRIPT_DIR/$1" 2>&1 || true)"
25
+ if [ -n "$output" ]; then
26
+ OUTPUTS+=("$(printf '%s\n' "$output" | sed 's/AskUserQuestion/request_user_input/g; s#\.claude/#.codex/#g; s/CLAUDE\.md/AGENTS.md/g')")
27
+ fi
28
+ }
29
+
30
+ emit_outputs() {
31
+ [ "${#OUTPUTS[@]}" -gt 0 ] || return 0
32
+ printf '%s\0' "${OUTPUTS[@]}" | EVENT="$EVENT" python3 -c '
33
+ import json, os, sys
34
+
35
+ messages, reasons, stops = [], [], []
36
+ for raw in sys.stdin.buffer.read().decode().split("\0"):
37
+ if not raw:
38
+ continue
39
+ try:
40
+ value = json.loads(raw)
41
+ except json.JSONDecodeError:
42
+ messages.append(raw)
43
+ continue
44
+ if value.get("systemMessage"):
45
+ messages.append(value["systemMessage"])
46
+ if value.get("stopReason"):
47
+ stops.append(value["stopReason"])
48
+ specific = value.get("hookSpecificOutput") or {}
49
+ if specific.get("permissionDecision") == "deny":
50
+ reasons.append(specific.get("permissionDecisionReason") or "Denied by ITIL policy")
51
+ if specific.get("additionalContext"):
52
+ messages.append(specific["additionalContext"])
53
+
54
+ if reasons:
55
+ names = {"pre-tool": "PreToolUse", "post-tool": "PostToolUse"}
56
+ print(json.dumps({"hookSpecificOutput": {
57
+ "hookEventName": names.get(os.environ.get("EVENT"), "PreToolUse"),
58
+ "permissionDecision": "deny",
59
+ "permissionDecisionReason": "\n".join(reasons + messages),
60
+ }}))
61
+ elif stops:
62
+ print(json.dumps({"stopReason": "\n".join(stops + messages)}))
63
+ elif messages:
64
+ print(json.dumps({"systemMessage": "\n".join(messages)}))
65
+ '
66
+ }
67
+
68
+ tool_name() {
69
+ printf '%s' "$INPUT" | python3 -c 'import json,sys; print(json.load(sys.stdin).get("tool_name") or "")' 2>/dev/null || true
70
+ }
71
+
72
+ input_field() {
73
+ printf '%s' "$INPUT" | python3 -c 'import json,sys; print(json.load(sys.stdin).get(sys.argv[1]) or "")' "$1" 2>/dev/null || true
74
+ }
75
+
76
+ work_problems_marker() {
77
+ local session_id digest
78
+ session_id="$(input_field session_id)"
79
+ [ -n "$session_id" ] || session_id="${CODEX_THREAD_ID:-unknown}"
80
+ digest="$(printf '%s' "$session_id" | shasum -a 256 | awk '{print $1}')"
81
+ printf '%s/wr-itil-codex-work-problems-%s' "${TMPDIR:-/tmp}" "$digest"
82
+ }
83
+
84
+ check_codex_dependencies() {
85
+ local installed
86
+ command -v codex >/dev/null 2>&1 || return 0
87
+ installed="$(codex plugin list 2>/dev/null)" || return 0
88
+ [[ "$installed" == *"wr-risk-scorer@"* ]] || OUTPUTS+=("$(jq -n '{systemMessage:"WR ITIL requires wr-risk-scorer for governed commit, push, and release assessment. Install @windyroad/risk-scorer for Codex."}')")
89
+ }
90
+
91
+ case "$EVENT" in
92
+ session-start)
93
+ AGENT_OUTPUT="$(printf '%s' "$INPUT" | node "$SCRIPT_DIR/../scripts/codex-agent.mjs" --session-start 2>/dev/null || true)"
94
+ [ -z "$AGENT_OUTPUT" ] || OUTPUTS+=("$AGENT_OUTPUT")
95
+ check_codex_dependencies
96
+ run_hook itil-pending-questions-surface.sh
97
+ run_hook itil-rfc-oversight-nudge.sh
98
+ run_hook itil-story-mirror-migration-nudge.sh
99
+ ;;
100
+ user-prompt)
101
+ PROMPT="$(input_field prompt)"
102
+ [[ "$PROMPT" == *"wr-itil:work-problems"* ]] && : > "$(work_problems_marker)"
103
+ run_hook itil-assistant-output-gate.sh
104
+ run_hook itil-correction-detect.sh
105
+ run_hook staleness-check.sh
106
+ ;;
107
+ pre-tool)
108
+ run_hook itil-runtime-sid-marker.sh
109
+ case "$(tool_name)" in
110
+ Write)
111
+ run_hook manage-problem-enforce-create.sh
112
+ run_hook itil-claude-space-protection.sh
113
+ ;;
114
+ Edit)
115
+ run_hook itil-claude-space-protection.sh
116
+ ;;
117
+ Bash)
118
+ run_hook p057-staging-trap-detect.sh
119
+ run_hook itil-no-implement-draft-gate.sh
120
+ run_hook itil-bash-polling-antipattern-detect.sh
121
+ run_hook pre-publish-intake-gate.sh
122
+ run_hook itil-changeset-discipline.sh
123
+ run_hook itil-readme-refresh-discipline.sh
124
+ ;;
125
+ request_user_input|AskUserQuestion)
126
+ if [ -f "$(work_problems_marker)" ]; then
127
+ OUTPUTS+=("$(jq -n '{systemMessage:"MID-LOOP ASK DETECTED: request_user_input fired during wr-itil:work-problems. Use it only at a documented halt point; otherwise queue the question and continue with other actionable work."}')")
128
+ fi
129
+ ;;
130
+ esac
131
+ ;;
132
+ post-tool)
133
+ case "$(tool_name)" in
134
+ Bash)
135
+ run_hook itil-rfc-trailer-advisory.sh
136
+ run_hook itil-commit-trailer-transition-advisory.sh
137
+ run_hook itil-fix-title-lifecycle-advisory.sh
138
+ ;;
139
+ Write|Edit)
140
+ run_hook itil-fictional-defer-detect.sh
141
+ run_hook itil-deferral-cadence-gate.sh
142
+ ;;
143
+ esac
144
+ ;;
145
+ stop)
146
+ ASSISTANT_TEXT="$(printf '%s' "$INPUT" | python3 -c 'import json,sys; print(json.load(sys.stdin).get("last_assistant_message") or "")' 2>/dev/null || true)"
147
+ [ -n "$ASSISTANT_TEXT" ] || exit 0
148
+ # shellcheck source=lib/detectors.sh
149
+ source "$SCRIPT_DIR/lib/detectors.sh"
150
+ MATCH="$(printf '%s' "$ASSISTANT_TEXT" | detect_prose_ask 2>/dev/null || true)"
151
+ [ -z "$MATCH" ] || OUTPUTS+=("$(jq -n --arg match "$MATCH" '{stopReason:("PROSE-ASK DETECTED (pattern: \""+$match+"\"). Act when direction is clear; otherwise use request_user_input in Plan Mode. Never prose-ask.")}')")
152
+ MATCH="$(printf '%s' "$ASSISTANT_TEXT" | detect_mechanical_optional 2>/dev/null || true)"
153
+ [ -z "$MATCH" ] || OUTPUTS+=("$(jq -n --arg match "$MATCH" '{stopReason:("MECHANICAL STEP PRESENTED AS OPTIONAL (closer: \""+$match+"\"). Run the contract-mandated step instead of asking or skipping it.")}')")
154
+ if [[ "$ASSISTANT_TEXT" == *"ALL_DONE"* || "$ASSISTANT_TEXT" == *"## Work Problems Summary"* ]]; then
155
+ rm -f "$(work_problems_marker)"
156
+ fi
157
+ ;;
158
+ *)
159
+ echo "itil-codex-dispatch: unknown event '$EVENT'" >&2
160
+ exit 2
161
+ ;;
162
+ esac
163
+
164
+ emit_outputs
@@ -1,10 +1,10 @@
1
1
  #!/bin/bash
2
- # wr-itil — PostToolUse:Bash hook (P378/RFC-030 Piece 2). The SHARED
3
- # commit-trailer auto-transition trigger that ADR-060 (line 292/307) promised
2
+ # wr-itil — PostToolUse:Bash hook (rfc-lifecycle-is-not-self-maintaining-it-leans-on-human-memory-problem/rfc-lifecycle-self-maintenance-release-design Piece 2). The SHARED
3
+ # commit-trailer auto-transition trigger that problem-rfc-story-framework-with-mandatory-problem-trace-and-unified-problem-ontology-architecture-rule (line 292/307) promised
4
4
  # for BOTH the RFC and story tiers and that manage-rfc + manage-story both
5
5
  # deferred to "a future commit-trailer-trigger hook" — never built. This is it.
6
6
  #
7
- # Per ADR-014, a hook MUST NOT perform the transition itself (git mv + Status
7
+ # Per governance-skills-commit-their-own-completed-work-architecture-rule, a hook MUST NOT perform the transition itself (git mv + Status
8
8
  # edit + commit lands OUTSIDE the triggering commit's grain). So the hook
9
9
  # DETECTS eligibility and ADVISES; the skill (/wr-itil:manage-rfc |
10
10
  # /wr-itil:manage-story) — or an AFK orchestrator acting on the advisory —
@@ -17,16 +17,16 @@
17
17
  # - is NOT the artefact's capture commit (subject does not start with
18
18
  # `docs(rfcs): capture RFC-` / `feat(itil): capture STORY-`), AND
19
19
  # - the referenced artefact is in a pre-in-progress status
20
- # (RFC: .proposed/.accepted ; story: .accepted — per ADR-096 a draft
20
+ # (RFC: .proposed/.accepted ; story: .accepted — per a-story-cannot-be-implemented-while-in-draft-implementation-requires-accepted-architecture-rule a draft
21
21
  # story is blocked from implementation, not advised to advance) on disk.
22
22
  # → emit a stderr advisory naming the transition command. Silent otherwise.
23
23
  #
24
- # Advisory-only (ADR-013 Rule 6 fail-open; ADR-045 ≤300-byte band; exit 0).
24
+ # Advisory-only (structured-user-interaction-for-governance-skill-decisions-architecture-rule Rule 6 fail-open; hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule ≤300-byte band; exit 0).
25
25
  # Bypass: BYPASS_TRANSITION_ADVISORY=1.
26
26
  #
27
- # @adr ADR-060 (line 292/307 auto-transition triggers) ADR-014 (hook detects,
28
- # skill commits) ADR-045 (budget) ADR-013 (Rule 6 fail-open) ADR-052 (bats)
29
- # @problem P378 @rfc RFC-030
27
+ # @adr problem-rfc-story-framework-with-mandatory-problem-trace-and-unified-problem-ontology-architecture-rule (line 292/307 auto-transition triggers) governance-skills-commit-their-own-completed-work-architecture-rule (hook detects,
28
+ # skill commits) hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule (budget) structured-user-interaction-for-governance-skill-decisions-architecture-rule (Rule 6 fail-open) behavioural-tests-default-for-skill-testing-architecture-rule (bats)
29
+ # @problem rfc-lifecycle-is-not-self-maintaining-it-leans-on-human-memory-problem @rfc rfc-lifecycle-self-maintenance-release-design
30
30
 
31
31
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
32
32
  # shellcheck source=lib/command-detect.sh
@@ -57,7 +57,7 @@ TRAILERS=$(printf '%s\n' "$BODY" | git interpret-trailers --parse 2>/dev/null \
57
57
  | grep -oE 'RFC-[0-9]{3}|STORY-[0-9]{3}' | sort -u || true)
58
58
  [ -n "$TRAILERS" ] || exit 0
59
59
 
60
- advise() { echo "P378 ADVISORY: $1" >&2; }
60
+ advise() { echo "rfc-lifecycle-is-not-self-maintaining-it-leans-on-human-memory-problem ADVISORY: $1" >&2; }
61
61
 
62
62
  while IFS= read -r id; do
63
63
  [ -n "$id" ] || continue
@@ -66,11 +66,11 @@ while IFS= read -r id; do
66
66
  [ -d "./docs/rfcs" ] || continue
67
67
  shopt -s nullglob; files=(./docs/rfcs/${id}-*.proposed.md ./docs/rfcs/${id}-*.accepted.md); shopt -u nullglob
68
68
  [ ${#files[@]} -gt 0 ] || continue
69
- advise "${id} carries a non-capture commit but is still $(basename "${files[0]}" | grep -oE 'proposed|accepted'). It should advance to in-progress — run /wr-itil:manage-rfc ${id} in-progress (the skill performs the transition; a hook cannot, per ADR-014). Bypass: BYPASS_TRANSITION_ADVISORY=1."
69
+ advise "${id} carries a non-capture commit but is still $(basename "${files[0]}" | grep -oE 'proposed|accepted'). It should advance to in-progress — run /wr-itil:manage-rfc ${id} in-progress (the skill performs the transition; a hook cannot, per governance-skills-commit-their-own-completed-work-architecture-rule). Bypass: BYPASS_TRANSITION_ADVISORY=1."
70
70
  ;;
71
71
  STORY-*)
72
72
  [ -d "./docs/stories" ] || continue
73
- # ADR-096: a draft story is NEVER implementable — the PreToolUse
73
+ # a-story-cannot-be-implemented-while-in-draft-implementation-requires-accepted-architecture-rule: a draft story is NEVER implementable — the PreToolUse
74
74
  # itil-no-implement-draft-gate blocks a commit referencing a draft story.
75
75
  # So this advisory now fires for an ACCEPTED story carrying its first
76
76
  # implementing commit: advise accepted -> in-progress (draft -> in-progress
@@ -1,5 +1,5 @@
1
1
  #!/bin/bash
2
- # P078 / ADR-013 / ADR-038: itil correction-signal UserPromptSubmit gate.
2
+ # problem-078-assistant-does-not-offer-to-capture-a-problem-ticket-when-the-user-delivers-strong-signal-correction-problem / structured-user-interaction-for-governance-skill-decisions-architecture-rule / progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule: itil correction-signal UserPromptSubmit gate.
3
3
  #
4
4
  # When the incoming user prompt carries a strong-affect correction
5
5
  # signal (FFS / all-caps imperatives like DO NOT / direct contradiction
@@ -10,20 +10,20 @@
10
10
  # and a ticket preserves the signal as durable WSJF-ranked backlog.
11
11
  #
12
12
  # Once-per-session full block; terse reminder on subsequent corrections
13
- # (per ADR-038 progressive disclosure). The full block names the
13
+ # (per progressive-disclosure-once-per-session-budget-for-userpromptsubmit-governance-prose-architecture-rule progressive disclosure). The full block names the
14
14
  # matched pattern so the assistant has the why-this-fired context.
15
15
  #
16
- # Forward-compat: advertises /wr-itil:capture-problem (ADR-032 — not
16
+ # Forward-compat: advertises /wr-itil:capture-problem (governance-skill-invocation-patterns-foreground-background-with-deferred-question-resumption-architecture-rule — not
17
17
  # yet shipped) with /wr-itil:manage-problem as the today-target
18
18
  # fallback. When capture-problem ships the wording stays valid.
19
19
  #
20
- # P430 / STORY-047 — WR_SUPPRESS_CORRECTION_DETECT is a DISTINCT guard
20
+ # itil-correction-detect-userpromptsubmit-hook-false-positives-on-orchestrator-afk-prompt-text-problem / gate-the-correction-nudge-on-prompt-authorship-delivery-story — WR_SUPPRESS_CORRECTION_DETECT is a DISTINCT guard
21
21
  # class, not a split of WR_SUPPRESS_OVERSIGHT_NUDGE. That guard means
22
22
  # "an absent user cannot ratify"; this one means "nobody authored a
23
23
  # correction". A machine-authored iter prompt carrying an ordinary
24
24
  # imperative ("DO NOT skip the gate") is not a correction signal, and
25
25
  # conflating the two would couple this gate's suppression to the
26
- # ADR-068 / ADR-047 oversight-nudge contract. Provenance is a property
26
+ # jtbd-persona-human-oversight-marker-wr-jtbd-confirm-jobs-and-personas-drain-sibling-of-architecture-rule / install-updates-scaffolds-governance-artefacts-when-policy-file-is-present-but-artefact-is-missing-architecture-rule oversight-nudge contract. Provenance is a property
27
27
  # of the spawning process, so the dispatcher asserts it — the hook does
28
28
  # not sniff content for it.
29
29
 
@@ -59,7 +59,7 @@ fi
59
59
 
60
60
  if has_announced "itil-correction-detect" "$SESSION_ID"; then
61
61
  cat <<HOOK_OUTPUT
62
- MANDATORY: correction signal ($MATCHED). OFFER /wr-itil:capture-problem (fallback /wr-itil:manage-problem) BEFORE addressing the request. See P078.
62
+ MANDATORY: correction signal ($MATCHED). OFFER /wr-itil:capture-problem (fallback /wr-itil:manage-problem) BEFORE addressing the request. See problem-078-assistant-does-not-offer-to-capture-a-problem-ticket-when-the-user-delivers-strong-signal-correction-problem.
63
63
  HOOK_OUTPUT
64
64
  else
65
65
  cat <<HOOK_OUTPUT
@@ -71,7 +71,7 @@ NON-OPTIONAL RULES:
71
71
 
72
72
  1. BEFORE addressing the operational request in the prompt, OFFER
73
73
  to capture a problem ticket for the underlying behavioural pattern.
74
- Use /wr-itil:capture-problem when shipped (ADR-032 background
74
+ Use /wr-itil:capture-problem when shipped (governance-skill-invocation-patterns-foreground-background-with-deferred-question-resumption-architecture-rule background
75
75
  capture pattern). Until then, fall back to /wr-itil:manage-problem
76
76
  for synchronous capture.
77
77
 
@@ -84,7 +84,7 @@ NON-OPTIONAL RULES:
84
84
  3. The offer is non-blocking — the user can decline — but the offer
85
85
  MUST appear before the operational response. Do NOT wait for the
86
86
  user to request the ticket themselves; that's exactly the manual-
87
- policing-AI-output friction P078 closes.
87
+ policing-AI-output friction problem-078-assistant-does-not-offer-to-capture-a-problem-ticket-when-the-user-delivers-strong-signal-correction-problem closes.
88
88
 
89
89
  4. Suggested phrasing: "Before I address that — want me to capture a
90
90
  problem ticket for this pattern?" Then proceed with the operational
@@ -1,15 +1,15 @@
1
1
  #!/bin/bash
2
- # P375 — wr-itil PostToolUse:Write|Edit|MultiEdit hook.
2
+ # repo-conflates-a-named-re-entry-point-with-a-self-firing-cadence-deferrals-not-transitively-reachable-from-an-automatic-trigger-rot-problem — wr-itil PostToolUse:Write|Edit|MultiEdit hook.
3
3
  #
4
4
  # The ratified Option-C "authoring-time enforcement gate" (CORE SLICE,
5
- # advisory rollout). P375's root cause: the repo conflates a "named
5
+ # advisory rollout). repo-conflates-a-named-re-entry-point-with-a-self-firing-cadence-deferrals-not-transitively-reachable-from-an-automatic-trigger-rot-problem's root cause: the repo conflates a "named
6
6
  # re-entry point" (a /skill, a lifecycle transition, "next review") with
7
7
  # a SELF-FIRING cadence. A deferral that names `/wr-itil:manage-rfc`
8
8
  # rots because nothing self-fires manage-rfc on that artefact ("BUT
9
9
  # NOTHING TRIGGERS THAT WORK!!!", 2026-06-23). The correct rot test: a
10
10
  # deferral is legal only if its trigger chain is reachable from a
11
11
  # SELF-FIRING event (a hook, SessionStart, PreToolUse/PostToolUse, a CI
12
- # workflow, cron, or a work-problems pre-flight). ADR-084's SessionStart
12
+ # workflow, cron, or a work-problems pre-flight). self-firing-deferral-census-a-sessionstart-surfacer-so-deferred-governance-work-cannot-silently-rot-architecture-rule's SessionStart
13
13
  # census (Option A) only SURFACES accumulated rot; this gate attacks the
14
14
  # root cause — it fires at AUTHORING time, the moment a new uncadenced
15
15
  # deferral is written.
@@ -20,7 +20,7 @@
20
20
  # authoring surface — SKILL.md, docs/decisions/*.md (ADRs),
21
21
  # docs/rfcs/*.md (RFCs), or a hook *.sh — and is NOT under
22
22
  # docs/problems/ (tickets descriptively narrate deferrals; highest
23
- # false-positive surface; already covered by the ADR-084 census).
23
+ # false-positive surface; already covered by the self-firing-deferral-census-a-sessionstart-surfacer-so-deferred-governance-work-cannot-silently-rot-architecture-rule census).
24
24
  # 2. The new text (Edit new_string / Write content / MultiEdit joined
25
25
  # new_strings) introduces a deferral phrasing (DEFER_RE).
26
26
  # 3. Within the +/-5 line window of the match there is NO cadence
@@ -28,12 +28,12 @@
28
28
  # `<!-- cadence: <trigger> -->` comment is the recommended carrier,
29
29
  # but a bare prose mention of a self-firing surface also satisfies.
30
30
  #
31
- # THE LOAD-BEARING P375 REFINEMENT vs the P234 sibling
31
+ # THE LOAD-BEARING repo-conflates-a-named-re-entry-point-with-a-self-firing-cadence-deferrals-not-transitively-reachable-from-an-automatic-trigger-rot-problem REFINEMENT vs the agent-defers-framework-required-mechanical-work-to-next-retro-next-session-with-rationalization-defer-is-fictional-work-never-scheduled-problem sibling
32
32
  # (itil-fictional-defer-detect.sh): a bare named on-demand skill
33
33
  # (/wr-foo:bar) or a bare ticket ID (Pnnn / RFC-nnn / ADR-nnn) does NOT
34
34
  # satisfy the cadence requirement — that bare-naming IS the conflation
35
- # P375 names illegal. So CADENCE_RE deliberately OMITS skill-invocation
36
- # and ticket-ID forms (which the P234 hook WRONGLY accepts).
35
+ # repo-conflates-a-named-re-entry-point-with-a-self-firing-cadence-deferrals-not-transitively-reachable-from-an-automatic-trigger-rot-problem names illegal. So CADENCE_RE deliberately OMITS skill-invocation
36
+ # and ticket-ID forms (which the agent-defers-framework-required-mechanical-work-to-next-retro-next-session-with-rationalization-defer-is-fictional-work-never-scheduled-problem hook WRONGLY accepts).
37
37
  #
38
38
  # CORE-SLICE BOUNDARY (named loudly per the architect review): the gate
39
39
  # checks the cadence names a self-firing CLASS — it does NOT validate
@@ -42,9 +42,9 @@
42
42
  # retrospective-deferral-census.sh -->). Citing a plausible-but-fictional
43
43
  # hook name passes this slice; the graph check closes that gap later.
44
44
  #
45
- # Advisory only — NEVER blocks (exit 0 always). Per ADR-040/045
46
- # declarative-first + ADR-013 Rule 6 fail-open + the P375 architect
47
- # review (advisory-first per ADR-057 staged rollout; escalation to a
45
+ # Advisory only — NEVER blocks (exit 0 always). Per session-start-briefing-surface-sessionstart-hook-over-tiered-directory-indexed-readme-architecture-rule/045
46
+ # declarative-first + structured-user-interaction-for-governance-skill-decisions-architecture-rule Rule 6 fail-open + the repo-conflates-a-named-re-entry-point-with-a-self-firing-cadence-deferrals-not-transitively-reachable-from-an-automatic-trigger-rot-problem architect
47
+ # review (advisory-first per three-phase-declarative-first-rollout-for-cluster-shaped-governance-rules-architecture-rule staged rollout; escalation to a
48
48
  # PreToolUse block is a queued user-owned rollout-mode decision once the
49
49
  # advisory's false-positive rate is measured). AFK self-suppress:
50
50
  # WR_SUPPRESS_DEFERRAL_CADENCE_GATE=1 (mirrors the census's
@@ -52,27 +52,27 @@
52
52
  # authoring governance prose should be able to mute it).
53
53
  #
54
54
  # References:
55
- # P375 — driver (this gate is the Option-C root-cause fix).
56
- # P234 — the PostToolUse sibling (retro-only, accepts skills/IDs);
55
+ # repo-conflates-a-named-re-entry-point-with-a-self-firing-cadence-deferrals-not-transitively-reachable-from-an-automatic-trigger-rot-problem — driver (this gate is the Option-C root-cause fix).
56
+ # agent-defers-framework-required-mechanical-work-to-next-retro-next-session-with-rationalization-defer-is-fictional-work-never-scheduled-problem — the PostToolUse sibling (retro-only, accepts skills/IDs);
57
57
  # converging the two onto a shared vocabulary is a tracked
58
- # P375 follow-on, NOT done here (ADR-002/003 self-containment
58
+ # repo-conflates-a-named-re-entry-point-with-a-self-firing-cadence-deferrals-not-transitively-reachable-from-an-automatic-trigger-rot-problem follow-on, NOT done here (monorepo-with-independently-installable-per-plugin-packages-architecture-rule/003 self-containment
59
59
  # — itil keeps its own copy of the deferral vocabulary).
60
- # ADR-084 — the surfacing-only census (Option A) this gate complements.
61
- # ADR-040 — declarative-first; advisory over hard block.
62
- # ADR-045 — hook injection budget; advisory ~600 bytes, ceiling 1000.
63
- # ADR-013 — Rule 6 fail-open on empty/malformed stdin.
64
- # ADR-052 — behavioural bats live alongside.
65
- # ADR-057 — staged advisory-first rollout for cluster-shaped rules.
60
+ # self-firing-deferral-census-a-sessionstart-surfacer-so-deferred-governance-work-cannot-silently-rot-architecture-rule — the surfacing-only census (Option A) this gate complements.
61
+ # session-start-briefing-surface-sessionstart-hook-over-tiered-directory-indexed-readme-architecture-rule — declarative-first; advisory over hard block.
62
+ # hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule — hook injection budget; advisory ~600 bytes, ceiling 1000.
63
+ # structured-user-interaction-for-governance-skill-decisions-architecture-rule — Rule 6 fail-open on empty/malformed stdin.
64
+ # behavioural-tests-default-for-skill-testing-architecture-rule — behavioural bats live alongside.
65
+ # three-phase-declarative-first-rollout-for-cluster-shaped-governance-rules-architecture-rule — staged advisory-first rollout for cluster-shaped rules.
66
66
 
67
67
  # Self-suppress (AFK). Only the literal "1" suppresses.
68
68
  [ "${WR_SUPPRESS_DEFERRAL_CADENCE_GATE:-}" = "1" ] && exit 0
69
69
 
70
70
  # Per-surface configuration (copy-and-retarget extensible, like the
71
- # P234 sibling: adjust the regex vars below).
71
+ # agent-defers-framework-required-mechanical-work-to-next-retro-next-session-with-rationalization-defer-is-fictional-work-never-scheduled-problem sibling: adjust the regex vars below).
72
72
  DEFER_RE='deferred to|deferred pending|defer pending|pending review|re-rate at next|\(deferred|: deferred|deferred[ ]*[—.,;:-]|lands in [Ss]lice|future slice|flesh(ed)? out later|next review|when ready'
73
73
  # Cadence-satisfying SELF-FIRING citations. NOTE the deliberate absence
74
74
  # of skill-invocation (/wr-foo:bar) and ticket-ID (Pnnn/RFC-nnn/ADR-nnn)
75
- # — those are the P375 conflation and do NOT satisfy the cadence.
75
+ # — those are the repo-conflates-a-named-re-entry-point-with-a-self-firing-cadence-deferrals-not-transitively-reachable-from-an-automatic-trigger-rot-problem conflation and do NOT satisfy the cadence.
76
76
  HOOK_PATH_RE='[A-Za-z0-9_./-]+\.sh\b'
77
77
  SESSIONSTART_RE='SessionStart'
78
78
  TOOLUSE_RE='PreToolUse|PostToolUse'
@@ -175,7 +175,7 @@ rm -f "$SCAN"
175
175
 
176
176
  [ -n "$FICTIONAL_LINE" ] || exit 0
177
177
 
178
- # Advisory to stderr. ADR-045 budget (~600 bytes target). exit 0 always.
179
- echo "P375 ADVISORY: uncadenced deferral authored in ${FILE_PATH} — \"${FICTIONAL_PHRASE}\". A named on-demand re-entry point (/wr-foo:bar, a lifecycle transition, \"next review\") is NOT a cadence — nothing self-fires it, so the work rots. Add a cadence annotation naming a SELF-FIRING trigger within +/-5 lines: <!-- cadence: <hook *.sh | SessionStart | PreToolUse/PostToolUse | .github/workflows/ | cron | work-problems pre-flight> --> OR do the work now. (Core slice checks the trigger CLASS, not that it exists.) See P375." >&2
178
+ # Advisory to stderr. hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule budget (~600 bytes target). exit 0 always.
179
+ echo "repo-conflates-a-named-re-entry-point-with-a-self-firing-cadence-deferrals-not-transitively-reachable-from-an-automatic-trigger-rot-problem ADVISORY: uncadenced deferral authored in ${FILE_PATH} — \"${FICTIONAL_PHRASE}\". A named on-demand re-entry point (/wr-foo:bar, a lifecycle transition, \"next review\") is NOT a cadence — nothing self-fires it, so the work rots. Add a cadence annotation naming a SELF-FIRING trigger within +/-5 lines: <!-- cadence: <hook *.sh | SessionStart | PreToolUse/PostToolUse | .github/workflows/ | cron | work-problems pre-flight> --> OR do the work now. (Core slice checks the trigger CLASS, not that it exists.) See repo-conflates-a-named-re-entry-point-with-a-self-firing-cadence-deferrals-not-transitively-reachable-from-an-automatic-trigger-rot-problem." >&2
180
180
 
181
181
  exit 0
@@ -1,11 +1,11 @@
1
1
  #!/bin/bash
2
- # P234 Phase 1 — wr-itil PostToolUse:Write|Edit hook.
2
+ # agent-defers-framework-required-mechanical-work-to-next-retro-next-session-with-rationalization-defer-is-fictional-work-never-scheduled-problem Phase 1 — wr-itil PostToolUse:Write|Edit hook.
3
3
  #
4
4
  # Detects "fictional defer" rationales in `docs/retros/*.md` writes —
5
5
  # defer-rationale phrases (`next retro`, `next session`, `defer
6
6
  # pending`, `defer with cause:`, `deferred per`) that lack a
7
7
  # SCHEDULED-FUTURE-SURFACE citation in the surrounding +/-5-line
8
- # window. The regression class P234 captures (2026-05-17 session 3
8
+ # window. The regression class agent-defers-framework-required-mechanical-work-to-next-retro-next-session-with-rationalization-defer-is-fictional-work-never-scheduled-problem captures (2026-05-17 session 3
9
9
  # retro: 3 MUST_SPLIT files deferred with "cascade case: archive-of-
10
10
  # archive tier design needed" rationale; user correction "Don't defer"
11
11
  # revealed the cascade was mechanical, not a design barrier).
@@ -25,13 +25,13 @@
25
25
  # (e.g. `deferred per Branch B` — Branch B's next-retro
26
26
  # check-briefing-budgets.sh trigger IS the scheduled surface).
27
27
  #
28
- # When all four hold, the hook emits a stderr advisory citing P234 +
28
+ # When all four hold, the hook emits a stderr advisory citing agent-defers-framework-required-mechanical-work-to-next-retro-next-session-with-rationalization-defer-is-fictional-work-never-scheduled-problem +
29
29
  # the SCHEDULED-FUTURE-SURFACE definition + remediation pattern
30
30
  # (cite a surface OR execute the deferred work now). The advisory
31
31
  # names the file path, line number, and detected phrase so the next
32
32
  # assistant turn has enough context to self-correct.
33
33
  #
34
- # Advisory only — NEVER blocks. Per ADR-013 Rule 6 fail-safe + ADR-045
34
+ # Advisory only — NEVER blocks. Per structured-user-interaction-for-governance-skill-decisions-architecture-rule Rule 6 fail-safe + hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule
35
35
  # honour-system budget (target ~600 bytes; hard ceiling 1000). Mirrors
36
36
  # the itil-rfc-trailer-advisory.sh PostToolUse precedent (stderr +
37
37
  # exit 0) and the itil-mid-loop-ask-detect.sh per-surface configuration
@@ -39,19 +39,19 @@
39
39
  # EXEMPT_PHRASES at the top so the hook is copy-and-retarget extensible).
40
40
  #
41
41
  # References:
42
- # P234 — this hook (Phase 1 structural enforcement).
43
- # P148 — Tickets Deferred section misuse; same class, different
42
+ # agent-defers-framework-required-mechanical-work-to-next-retro-next-session-with-rationalization-defer-is-fictional-work-never-scheduled-problem — this hook (Phase 1 structural enforcement).
43
+ # agent-defers-ticket-creation-to-retro-summary-tickets-deferred-section-instead-of-immediately-invoking-wr-itil-manage-problem-observations-could-be-lost-if-user-is-in-a-rush-problem — Tickets Deferred section misuse; same class, different
44
44
  # surface (advisory script not hook).
45
- # P132 — over-ask class (inverse-correctness axis of P234 under-do);
45
+ # agents-over-ask-in-interactive-sessions-conflating-mechanical-stages-with-user-interactive-stages-of-multi-stage-skill-contracts-inverse-problem — over-ask class (inverse-correctness axis of agent-defers-framework-required-mechanical-work-to-next-retro-next-session-with-rationalization-defer-is-fictional-work-never-scheduled-problem under-do);
46
46
  # Phase 2b hook itil-mid-loop-ask-detect.sh is the canonical
47
47
  # advisory-shape template.
48
- # ADR-013 — Rule 6 fail-open on missing inputs / parse errors.
49
- # ADR-014 — single-commit grain (this hook never auto-fixes).
50
- # ADR-040 — declarative-first; advisory-only over hard block.
51
- # ADR-044 — framework-resolution boundary; named in advisory.
52
- # ADR-045 — hook injection budget; honour-system <1000 hard ceiling.
53
- # ADR-052 — behavioural-tests default; bats live alongside.
54
- # ADR-057 — three-phase declarative-first cluster rollout
48
+ # structured-user-interaction-for-governance-skill-decisions-architecture-rule — Rule 6 fail-open on missing inputs / parse errors.
49
+ # governance-skills-commit-their-own-completed-work-architecture-rule — single-commit grain (this hook never auto-fixes).
50
+ # session-start-briefing-surface-sessionstart-hook-over-tiered-directory-indexed-readme-architecture-rule — declarative-first; advisory-only over hard block.
51
+ # decision-delegation-contract-when-agents-act-on-the-framework-vs-ask-the-user-architecture-rule — framework-resolution boundary; named in advisory.
52
+ # hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule — hook injection budget; honour-system <1000 hard ceiling.
53
+ # behavioural-tests-default-for-skill-testing-architecture-rule — behavioural-tests default; bats live alongside.
54
+ # three-phase-declarative-first-rollout-for-cluster-shaped-governance-rules-architecture-rule — three-phase declarative-first cluster rollout
55
55
  # (Phase 2 advisory-second slot).
56
56
 
57
57
  # Per-surface configuration. Extending coverage to other accumulator-
@@ -169,7 +169,7 @@ done <<< "$MATCHES"
169
169
 
170
170
  # Emit advisory to stderr (PostToolUse precedent matches
171
171
  # itil-rfc-trailer-advisory.sh). Always exit 0 — advisory, never block.
172
- # Voice-tone target ~600 bytes; ADR-045 honour-system ceiling <1000.
173
- echo "P234 ADVISORY: fictional defer detected in ${FILE_PATH}:${FICTIONAL_LINE} — phrase: \"${FICTIONAL_PHRASE}\". No SCHEDULED-FUTURE-SURFACE cited within +/-5 lines. Per ADR-044 framework-resolution boundary, cite a concrete surface (ticket ID Pnnn, named skill /wr-foo:bar, hook path *.sh, CI workflow .github/workflows/, or dated ADR-nnn YYYY-MM-DD) OR execute the deferred work in this session. See P234." >&2
172
+ # Voice-tone target ~600 bytes; hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule honour-system ceiling <1000.
173
+ echo "agent-defers-framework-required-mechanical-work-to-next-retro-next-session-with-rationalization-defer-is-fictional-work-never-scheduled-problem ADVISORY: fictional defer detected in ${FILE_PATH}:${FICTIONAL_LINE} — phrase: \"${FICTIONAL_PHRASE}\". No SCHEDULED-FUTURE-SURFACE cited within +/-5 lines. Per decision-delegation-contract-when-agents-act-on-the-framework-vs-ask-the-user-architecture-rule framework-resolution boundary, cite a concrete surface (ticket ID Pnnn, named skill /wr-foo:bar, hook path *.sh, CI workflow .github/workflows/, or dated ADR-nnn YYYY-MM-DD) OR execute the deferred work in this session. See agent-defers-framework-required-mechanical-work-to-next-retro-next-session-with-rationalization-defer-is-fictional-work-never-scheduled-problem." >&2
174
174
 
175
175
  exit 0
@@ -1,28 +1,28 @@
1
1
  #!/bin/bash
2
- # wr-itil — PostToolUse:Bash hook (P345/RFC-044/STORY-038). Detects the
2
+ # wr-itil — PostToolUse:Bash hook (fix-titled-commits-do-not-transition-the-ticket-lifecycle-in-the-same-commit-grain-ticket-stays-open-across-release-ci-verify-multiple-intervening-commits-problem/fix-title-lifecycle-drift-advisory-hook-release-design/fix-titled-commits-surface-a-lifecycle-drift-advisory-delivery-story). Detects the
3
3
  # fix-without-paired-lifecycle-transition drift: a just-landed commit whose
4
4
  # subject is fix-typed (`fix: ...` / `fix(<pkg>): ...`) and names P<NNN>
5
5
  # ticket(s) that are still in `docs/problems/open/` — i.e. the commit claims
6
6
  # to fix a ticket but carried no Open -> Known Error (or -> Verifying)
7
7
  # transition in the same grain. The ticket then ages across release + CI
8
- # verification until a catch-up cadence notices (P345; P334 witness chain).
8
+ # verification until a catch-up cadence notices (fix-titled-commits-do-not-transition-the-ticket-lifecycle-in-the-same-commit-grain-ticket-stays-open-across-release-ci-verify-multiple-intervening-commits-problem; generate-decisions-compendium-sh-uses-awk-substr-with-unicode-ellipsis-not-portable-between-macos-bsd-awk-and-linux-gnu-awk-ci-drift-gate-fires-on-cross-platform-regenerations-problem witness chain).
9
9
  #
10
- # ADVISORY-ONLY per ADR-092: Open -> Known Error asserts a knowledge claim
10
+ # ADVISORY-ONLY per fix-titled-commit-lifecycle-drift-surfaces-as-an-advisory-never-an-auto-fire-or-hard-gate-architecture-rule: Open -> Known Error asserts a knowledge claim
11
11
  # (root cause known + workaround documented) that a fix-titled commit does
12
12
  # NOT establish, so this hook must never auto-fire the transition and never
13
13
  # block the commit. The hook DETECTS and ADVISES; a skill
14
14
  # (/wr-itil:transition-problem) — or the human — PERFORMS the transition
15
- # (ADR-014 hook-detects-skill-commits grain). Sibling (copy-and-retarget) of
16
- # itil-commit-trailer-transition-advisory.sh (P378): different signal —
15
+ # (governance-skills-commit-their-own-completed-work-architecture-rule hook-detects-skill-commits grain). Sibling (copy-and-retarget) of
16
+ # itil-commit-trailer-transition-advisory.sh (rfc-lifecycle-is-not-self-maintaining-it-leans-on-human-memory-problem): different signal —
17
17
  # commit-title P<NNN> tokens vs Refs: trailers.
18
18
  #
19
- # Advisory-only (ADR-013 Rule 6 fail-open; ADR-045 ≤300-byte TOTAL emission
19
+ # Advisory-only (structured-user-interaction-for-governance-skill-decisions-architecture-rule Rule 6 fail-open; hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule ≤300-byte TOTAL emission
20
20
  # even with multiple named tickets; exit 0 on every path).
21
21
  # Bypass: BYPASS_FIX_TITLE_LIFECYCLE_ADVISORY=1.
22
22
  #
23
- # @adr ADR-092 (advisory-only posture + binding rule) ADR-014 (hook detects,
24
- # skill commits) ADR-045 (budget) ADR-013 (Rule 6 fail-open) ADR-052 (bats)
25
- # @problem P345 @rfc RFC-044 @story STORY-038
23
+ # @adr fix-titled-commit-lifecycle-drift-surfaces-as-an-advisory-never-an-auto-fire-or-hard-gate-architecture-rule (advisory-only posture + binding rule) governance-skills-commit-their-own-completed-work-architecture-rule (hook detects,
24
+ # skill commits) hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule (budget) structured-user-interaction-for-governance-skill-decisions-architecture-rule (Rule 6 fail-open) behavioural-tests-default-for-skill-testing-architecture-rule (bats)
25
+ # @problem fix-titled-commits-do-not-transition-the-ticket-lifecycle-in-the-same-commit-grain-ticket-stays-open-across-release-ci-verify-multiple-intervening-commits-problem @rfc fix-title-lifecycle-drift-advisory-hook-release-design @story fix-titled-commits-surface-a-lifecycle-drift-advisory-delivery-story
26
26
 
27
27
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
28
28
  # shellcheck source=lib/command-detect.sh
@@ -59,7 +59,7 @@ while IFS= read -r pid; do
59
59
  shopt -s nullglob; files=(./docs/problems/open/${num}-*.md); shopt -u nullglob
60
60
  if [ ${#files[@]} -gt 0 ]; then
61
61
  OPEN_COUNT=$((OPEN_COUNT + 1))
62
- # Cap the named IDs at 3 so TOTAL emission stays ≤300 bytes (ADR-045).
62
+ # Cap the named IDs at 3 so TOTAL emission stays ≤300 bytes (hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule).
63
63
  if [ "$OPEN_COUNT" -le 3 ]; then
64
64
  OPEN_IDS="${OPEN_IDS:+$OPEN_IDS,}$pid"
65
65
  fi
@@ -68,5 +68,5 @@ done <<< "$PIDS"
68
68
  [ "$OPEN_COUNT" -gt 0 ] || exit 0
69
69
  [ "$OPEN_COUNT" -gt 3 ] && OPEN_IDS="${OPEN_IDS}+$((OPEN_COUNT - 3))"
70
70
 
71
- echo "P345 ADVISORY: fix-titled commit names ${OPEN_IDS} still Open — no paired lifecycle transition landed. Transition it (/wr-itil:transition-problem <NNN> known-error) or document why not. Bypass: BYPASS_FIX_TITLE_LIFECYCLE_ADVISORY=1." >&2
71
+ echo "fix-titled-commits-do-not-transition-the-ticket-lifecycle-in-the-same-commit-grain-ticket-stays-open-across-release-ci-verify-multiple-intervening-commits-problem ADVISORY: fix-titled commit names ${OPEN_IDS} still Open — no paired lifecycle transition landed. Transition it (/wr-itil:transition-problem <NNN> known-error) or document why not. Bypass: BYPASS_FIX_TITLE_LIFECYCLE_ADVISORY=1." >&2
72
72
  exit 0
@@ -1,8 +1,8 @@
1
1
  #!/bin/bash
2
- # P132 Phase 2b — wr-itil Stop hook.
2
+ # agents-over-ask-in-interactive-sessions-conflating-mechanical-stages-with-user-interactive-stages-of-multi-stage-skill-contracts-inverse-problem Phase 2b — wr-itil Stop hook.
3
3
  #
4
4
  # Detects orchestrator main-turn `AskUserQuestion` calls fired mid-loop
5
- # inside `/wr-itil:work-problems` — the regression class P132 captures
5
+ # inside `/wr-itil:work-problems` — the regression class agents-over-ask-in-interactive-sessions-conflating-mechanical-stages-with-user-interactive-stages-of-multi-stage-skill-contracts-inverse-problem captures
6
6
  # (2026-05-17 reopen evidence: orchestrator asked iter-target selection
7
7
  # between iters 3 and 4; halted the AFK loop for hours of user time).
8
8
  #
@@ -16,24 +16,24 @@
16
16
  # is still mid-loop, not in its post-loop wrap-up).
17
17
  #
18
18
  # When all three match the hook emits a structured `stopReason`
19
- # advisory citing P130 + the Mid-loop ask discipline subsection of
19
+ # advisory citing wr-itil-work-problems-orchestrator-defaults-to-subprocess-dispatch-even-when-the-user-is-observably-interactive-loses-real-time-presence-advantage-problem + the Mid-loop ask discipline subsection of
20
20
  # `packages/itil/skills/work-problems/SKILL.md`. Advisory ONLY — the
21
21
  # hook NEVER blocks. The next assistant turn reads the stopReason in
22
22
  # its context and self-corrects (queue the question to
23
23
  # outstanding_questions and continue iterating).
24
24
  #
25
25
  # Mirrors the sibling `itil-assistant-output-review.sh` Stop hook
26
- # precedent (P085 prose-ask detection) on transcript-extraction shape
26
+ # precedent (problem-085-assistant-asks-for-input-when-the-next-step-is-obvious-and-uses-prose-asks-instead-of-askuserquestion-when-input-is-actually-needed-problem prose-ask detection) on transcript-extraction shape
27
27
  # and stopReason emit format.
28
28
  #
29
29
  # References:
30
- # P132 — this hook (Phase 2b structural enforcement).
31
- # P130 — orchestrator presence-aware dispatch; named in advisory.
32
- # ADR-013 — Rule 1 (interactive default) + Rule 6 (AFK fail-safe).
33
- # ADR-044 — framework-resolution boundary; named in advisory.
34
- # ADR-045 — hook injection budget; advisory honour-system band.
35
- # ADR-052 — behavioural tests default.
36
- # ADR-005 — plugin testing strategy.
30
+ # agents-over-ask-in-interactive-sessions-conflating-mechanical-stages-with-user-interactive-stages-of-multi-stage-skill-contracts-inverse-problem — this hook (Phase 2b structural enforcement).
31
+ # wr-itil-work-problems-orchestrator-defaults-to-subprocess-dispatch-even-when-the-user-is-observably-interactive-loses-real-time-presence-advantage-problem — orchestrator presence-aware dispatch; named in advisory.
32
+ # structured-user-interaction-for-governance-skill-decisions-architecture-rule — Rule 1 (interactive default) + Rule 6 (AFK fail-safe).
33
+ # decision-delegation-contract-when-agents-act-on-the-framework-vs-ask-the-user-architecture-rule — framework-resolution boundary; named in advisory.
34
+ # hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule — hook injection budget; advisory honour-system band.
35
+ # behavioural-tests-default-for-skill-testing-architecture-rule — behavioural tests default.
36
+ # plugin-testing-strategy-architecture-rule — plugin testing strategy.
37
37
 
38
38
  # Per-surface configuration. Extending coverage to other orchestrators
39
39
  # (run-retro Step 4b Stage 1, /install-updates Step 6a) is a future
@@ -126,16 +126,16 @@ fi
126
126
 
127
127
  # All three signals present → emit advisory stopReason. The next
128
128
  # assistant turn reads this in its context and self-corrects.
129
- # Voice-tone target ~600 bytes; ADR-045 honour-system slack < 1000.
129
+ # Voice-tone target ~600 bytes; hook-injection-budget-policy-for-pretooluse-and-posttooluse-hooks-architecture-rule honour-system slack < 1000.
130
130
  jq -n '{
131
131
  stopReason: (
132
132
  "MID-LOOP ASK DETECTED: AskUserQuestion fired inside /wr-itil:work-problems orchestrator main turn. " +
133
- "Per P130 + Mid-loop ask discipline subsection of work-problems SKILL.md, mid-loop AskUserQuestion is " +
133
+ "Per wr-itil-work-problems-orchestrator-defaults-to-subprocess-dispatch-even-when-the-user-is-observably-interactive-loses-real-time-presence-advantage-problem + Mid-loop ask discipline subsection of work-problems SKILL.md, mid-loop AskUserQuestion is " +
134
134
  "forbidden except at framework-prescribed halt points (Step 0 session-continuity, Step 2.5/2.5b loop-end emit, " +
135
135
  "Step 6.5 above-appetite Rule 5 / CI failure, Step 6.75 dirty halt). " +
136
136
  "If at a halt point, this advisory is inapplicable. " +
137
137
  "If mid-loop, queue the question to outstanding_questions and continue iterating. " +
138
- "See ADR-044 framework-resolution boundary."
138
+ "See decision-delegation-contract-when-agents-act-on-the-framework-vs-ask-the-user-architecture-rule framework-resolution boundary."
139
139
  )
140
140
  }'
141
141