@windyroad/itil 0.61.1 → 0.61.2

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 (171) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/package.json +7 -2
  3. package/agents/test/fixtures/proceed-new-genuinely-new.md +0 -43
  4. package/agents/test/fixtures/proceed-new-subtle-sibling.md +0 -47
  5. package/agents/test/fixtures/regression-p347-vs-p346.md +0 -54
  6. package/agents/test/hang-off-check.bats +0 -225
  7. package/hooks/test/block-list.bats +0 -153
  8. package/hooks/test/command-detect.bats +0 -181
  9. package/hooks/test/itil-assistant-output-gate.bats +0 -114
  10. package/hooks/test/itil-assistant-output-review.bats +0 -224
  11. package/hooks/test/itil-bash-polling-antipattern-detect.bats +0 -154
  12. package/hooks/test/itil-changeset-discipline.bats +0 -603
  13. package/hooks/test/itil-claude-space-protection.bats +0 -294
  14. package/hooks/test/itil-commit-trailer-transition-advisory.bats +0 -80
  15. package/hooks/test/itil-correction-detect.bats +0 -189
  16. package/hooks/test/itil-deferral-cadence-gate.bats +0 -187
  17. package/hooks/test/itil-fictional-defer-detect.bats +0 -292
  18. package/hooks/test/itil-fix-title-lifecycle-advisory.bats +0 -129
  19. package/hooks/test/itil-mid-loop-ask-detect.bats +0 -220
  20. package/hooks/test/itil-no-implement-draft-gate.bats +0 -210
  21. package/hooks/test/itil-pending-questions-surface.bats +0 -307
  22. package/hooks/test/itil-readme-refresh-discipline.bats +0 -642
  23. package/hooks/test/itil-rfc-oversight-nudge.bats +0 -83
  24. package/hooks/test/itil-rfc-trailer-advisory.bats +0 -375
  25. package/hooks/test/itil-story-mirror-migration-nudge.bats +0 -122
  26. package/hooks/test/manage-problem-enforce-create.bats +0 -424
  27. package/hooks/test/p057-staging-trap-detect.bats +0 -231
  28. package/hooks/test/pre-publish-intake-gate.bats +0 -144
  29. package/hooks/test/runtime-sid-marker.bats +0 -90
  30. package/hooks/test/session-id.bats +0 -370
  31. package/scripts/migrate-problems-add-type.sh +0 -116
  32. package/scripts/test/catchup-scan.bats +0 -274
  33. package/scripts/test/check-afk-accept-eligible.bats +0 -310
  34. package/scripts/test/check-fail-soft-skip-discipline.bats +0 -172
  35. package/scripts/test/check-fix-rfc-trace.bats +0 -164
  36. package/scripts/test/check-locale-discipline.bats +0 -291
  37. package/scripts/test/check-problems-readme-budget.bats +0 -192
  38. package/scripts/test/check-rfc-has-stories.bats +0 -69
  39. package/scripts/test/check-rfc-rejected-alternatives.bats +0 -108
  40. package/scripts/test/check-rfc-stories-ratified.bats +0 -82
  41. package/scripts/test/check-upstream-responses.bats +0 -503
  42. package/scripts/test/classify-readme-drift.bats +0 -392
  43. package/scripts/test/derive-first-dispatch.bats +0 -274
  44. package/scripts/test/derive-release-vehicle.bats +0 -454
  45. package/scripts/test/detect-unratified-stories-maps.bats +0 -60
  46. package/scripts/test/dual-tolerant-glob-rfc-002-t2.bats +0 -309
  47. package/scripts/test/effort-tally.bats +0 -170
  48. package/scripts/test/evaluate-relevance.bats +0 -773
  49. package/scripts/test/kind-a-commands.bats +0 -46
  50. package/scripts/test/mark-create-gate.bats +0 -59
  51. package/scripts/test/mark-story-oversight-confirmed.bats +0 -53
  52. package/scripts/test/migrate-problems-add-type.bats +0 -280
  53. package/scripts/test/migrate-story-status-mirror.bats +0 -167
  54. package/scripts/test/no-type-regression-guard.bats +0 -74
  55. package/scripts/test/oversight-mirror-corpus-lint.bats +0 -150
  56. package/scripts/test/plugin-exercise-index.bats +0 -386
  57. package/scripts/test/plugin-maturity-doc-lint.bats +0 -470
  58. package/scripts/test/plugin-maturity-populate.bats +0 -631
  59. package/scripts/test/plugin-maturity-render.bats +0 -469
  60. package/scripts/test/plugin-validate-ci-gate.bats +0 -208
  61. package/scripts/test/reconcile-readme.bats +0 -1007
  62. package/scripts/test/reconcile-rfcs.bats +0 -496
  63. package/scripts/test/reconcile-stories.bats +0 -173
  64. package/scripts/test/reconcile-story-maps.bats +0 -74
  65. package/scripts/test/release-watch-poll-loop.bats +0 -180
  66. package/scripts/test/resolve-governance-plugin-dirs.bats +0 -78
  67. package/scripts/test/rfc-stories-extension.bats +0 -175
  68. package/scripts/test/skill-invocations.bats +0 -535
  69. package/scripts/test/skill-md-dual-tolerant-coverage-rfc-002-t3.bats +0 -374
  70. package/scripts/test/story-oversight-lib.bats +0 -190
  71. package/scripts/test/update-jtbd-references-related-problems.bats +0 -178
  72. package/scripts/test/update-problem-references-section.bats +0 -242
  73. package/scripts/test/update-problem-rfcs-section.bats +0 -242
  74. package/scripts/test/update-references-section-sibling-helpers.bats +0 -80
  75. package/scripts/test/update-rfc-commits-section.bats +0 -77
  76. package/scripts/test/verify-iter-summary.bats +0 -196
  77. package/scripts/test/working-the-problem-traversal.bats +0 -116
  78. package/skills/capture-problem/test/capture-problem-step-1-5b-jtbd-trace.bats +0 -398
  79. package/skills/capture-problem/test/capture-problem.bats +0 -389
  80. package/skills/capture-story/test/capture-story-behavioural.bats +0 -317
  81. package/skills/capture-story-map/test/capture-story-map-behavioural.bats +0 -98
  82. package/skills/close-incident/test/close-incident-contract.bats +0 -146
  83. package/skills/link-incident/test/link-incident-contract.bats +0 -125
  84. package/skills/list-incidents/test/list-incidents-contract.bats +0 -115
  85. package/skills/list-problems/test/list-problems-contract.bats +0 -100
  86. package/skills/list-stories/test/list-stories-contract.bats +0 -127
  87. package/skills/list-story-maps/test/list-story-maps-contract.bats +0 -46
  88. package/skills/manage-incident/test/manage-incident-adr-044-contract.bats +0 -206
  89. package/skills/manage-incident/test/manage-incident-close-forwarder.bats +0 -67
  90. package/skills/manage-incident/test/manage-incident-link-forwarder.bats +0 -67
  91. package/skills/manage-incident/test/manage-incident-list-forwarder.bats +0 -68
  92. package/skills/manage-incident/test/manage-incident-mitigate-forwarder.bats +0 -66
  93. package/skills/manage-incident/test/manage-incident-restore-forwarder.bats +0 -66
  94. package/skills/manage-incident/test/manage-incident.bats +0 -171
  95. package/skills/manage-problem/test/manage-problem-adr-044-step4-derive-first.bats +0 -151
  96. package/skills/manage-problem/test/manage-problem-auto-migrate-step.bats +0 -53
  97. package/skills/manage-problem/test/manage-problem-concern-boundary.bats +0 -64
  98. package/skills/manage-problem/test/manage-problem-effort-buckets.bats +0 -56
  99. package/skills/manage-problem/test/manage-problem-external-root-cause-detection.bats +0 -119
  100. package/skills/manage-problem/test/manage-problem-first-run-intake-prompt.bats +0 -43
  101. package/skills/manage-problem/test/manage-problem-git-mv-restage-reminder.bats +0 -48
  102. package/skills/manage-problem/test/manage-problem-id-collision-guard.bats +0 -39
  103. package/skills/manage-problem/test/manage-problem-list-forwarder.bats +0 -66
  104. package/skills/manage-problem/test/manage-problem-next-id-origin-lookup.bats +0 -50
  105. package/skills/manage-problem/test/manage-problem-no-prose-options.bats +0 -74
  106. package/skills/manage-problem/test/manage-problem-output-formatting.bats +0 -30
  107. package/skills/manage-problem/test/manage-problem-parked-and-cache.bats +0 -73
  108. package/skills/manage-problem/test/manage-problem-readme-refresh-on-transition.bats +0 -62
  109. package/skills/manage-problem/test/manage-problem-readme-tie-break-order.bats +0 -318
  110. package/skills/manage-problem/test/manage-problem-readme-vq-sort-order.bats +0 -206
  111. package/skills/manage-problem/test/manage-problem-release-vehicle-seed.bats +0 -83
  112. package/skills/manage-problem/test/manage-problem-review-forwarder.bats +0 -71
  113. package/skills/manage-problem/test/manage-problem-step-9d-recovery-path.bats +0 -97
  114. package/skills/manage-problem/test/manage-problem-transition-forwarder.bats +0 -96
  115. package/skills/manage-problem/test/manage-problem-transitive-dependencies.bats +0 -365
  116. package/skills/manage-problem/test/manage-problem-verification-detection.bats +0 -64
  117. package/skills/manage-problem/test/manage-problem-verification-pending.bats +0 -114
  118. package/skills/manage-problem/test/manage-problem-work-forwarder.bats +0 -88
  119. package/skills/manage-story/test/manage-story-contract.bats +0 -174
  120. package/skills/manage-story-map/test/manage-story-map-contract.bats +0 -63
  121. package/skills/mitigate-incident/test/mitigate-incident-contract.bats +0 -258
  122. package/skills/reconcile-readme/test/reconcile-readme-contract.bats +0 -201
  123. package/skills/report-upstream/test/report-upstream-contract.bats +0 -394
  124. package/skills/restore-incident/test/restore-incident-contract.bats +0 -170
  125. package/skills/review-problems/test/inbound-channels-cache-shape.bats +0 -127
  126. package/skills/review-problems/test/inbound-discovery-contract.bats +0 -383
  127. package/skills/review-problems/test/jtbd-301-verdict-shape-contract.bats +0 -225
  128. package/skills/review-problems/test/review-problems-contract.bats +0 -235
  129. package/skills/review-problems/test/review-problems-likely-verified-cell-shape.bats +0 -229
  130. package/skills/scaffold-intake/test/scaffold-intake-contract.bats +0 -126
  131. package/skills/scaffold-intake/test/scaffold-intake-fixture.bats +0 -164
  132. package/skills/scaffold-intake/test/scaffold-intake-secrets-absent.bats +0 -87
  133. package/skills/transition-problem/test/transition-problem-contract.bats +0 -285
  134. package/skills/transition-problems/test/transition-problems-contract.bats +0 -331
  135. package/skills/update-upstream/test/update-upstream-contract.bats +0 -375
  136. package/skills/work-problem/test/work-problem-contract.bats +0 -294
  137. package/skills/work-problems/test/work-problems-above-appetite-remediation.bats +0 -139
  138. package/skills/work-problems/test/work-problems-adr-013-rule-6-p352-amendment.bats +0 -166
  139. package/skills/work-problems/test/work-problems-auto-migrate-step.bats +0 -57
  140. package/skills/work-problems/test/work-problems-cost-logging.bats +0 -109
  141. package/skills/work-problems/test/work-problems-deviation-candidate-shape.bats +0 -121
  142. package/skills/work-problems/test/work-problems-first-run-intake-prompt.bats +0 -36
  143. package/skills/work-problems/test/work-problems-inter-iteration-verify.bats +0 -59
  144. package/skills/work-problems/test/work-problems-mid-loop-userpromptsubmit-handler.bats +0 -69
  145. package/skills/work-problems/test/work-problems-no-mid-loop-asking.bats +0 -192
  146. package/skills/work-problems/test/work-problems-p341-pre-all-done-gate.bats +0 -122
  147. package/skills/work-problems/test/work-problems-p342-r007-derive-then-pass-flags.bats +0 -170
  148. package/skills/work-problems/test/work-problems-p342-retro-auto-ticket-carveout.bats +0 -120
  149. package/skills/work-problems/test/work-problems-preflight-failure-handling.bats +0 -248
  150. package/skills/work-problems/test/work-problems-preflight-session-continuity.bats +0 -139
  151. package/skills/work-problems/test/work-problems-preflight.bats +0 -69
  152. package/skills/work-problems/test/work-problems-release-cadence.bats +0 -63
  153. package/skills/work-problems/test/work-problems-step-0-iter-error-staleness.bats +0 -93
  154. package/skills/work-problems/test/work-problems-step-0b-cache-staleness-behavioural.bats +0 -138
  155. package/skills/work-problems/test/work-problems-step-0c-deferred-placeholder-staleness-behavioural.bats +0 -238
  156. package/skills/work-problems/test/work-problems-step-0d-outbound-responses-staleness-behavioural.bats +0 -174
  157. package/skills/work-problems/test/work-problems-step-2-5-routing.bats +0 -80
  158. package/skills/work-problems/test/work-problems-step-2-5b-cross-halt-routing.bats +0 -149
  159. package/skills/work-problems/test/work-problems-step-3-5-jtbd-ratification-predicate.bats +0 -191
  160. package/skills/work-problems/test/work-problems-step-5-bats-polling-discipline.bats +0 -91
  161. package/skills/work-problems/test/work-problems-step-5-delegation.bats +0 -333
  162. package/skills/work-problems/test/work-problems-step-5-idle-timeout-sigterm.bats +0 -421
  163. package/skills/work-problems/test/work-problems-step-5-is-error-transient-halt.bats +0 -278
  164. package/skills/work-problems/test/work-problems-step-5-iter-changeset-required.bats +0 -95
  165. package/skills/work-problems/test/work-problems-step-5-prompt-body-re-grounding.bats +0 -128
  166. package/skills/work-problems/test/work-problems-step-5-stream-timeout-salvage.bats +0 -251
  167. package/skills/work-problems/test/work-problems-step-6-5-always-drain.bats +0 -203
  168. package/skills/work-problems/test/work-problems-step-6-5-cache-refresh-chain.bats +0 -174
  169. package/skills/work-problems/test/work-problems-step-6-5-fix-and-continue.bats +0 -254
  170. package/skills/work-problems/test/work-problems-step-6-5-postrelease-kv-callback.bats +0 -209
  171. package/skills/work-problems/test/work-problems-stop-condition-questions.bats +0 -85
@@ -1,206 +0,0 @@
1
- #!/usr/bin/env bats
2
- # ADR-044 alignment contract assertions for manage-incident SKILL.md
3
- # (P136 Phase 2 sub-task 3 — added 2026-04-28).
4
- #
5
- # tdd-review: structural-permitted (justification: SKILL.md prose contract
6
- # assertions; behavioural skill-runtime harness pending P012 + P081 Phase 2;
7
- # expected to migrate to behavioural form once the harness exists. Added
8
- # during P136 Phase 2 ADR-044 alignment audit per the inline plan's
9
- # bridge-marker rule.)
10
- #
11
- # Note: the sibling file manage-incident.bats deliberately avoids structural-
12
- # grep on SKILL.md prose (P011 ban; functional/behavioural-by-default). This
13
- # file is the dedicated structural-grep-permitted home for the ADR-044
14
- # alignment contract during the bridge window. After P081 Phase 2 retrofits
15
- # the project's structural-grep tests to behavioural form, this file's
16
- # assertions migrate too.
17
- #
18
- # @problem P136 (ADR-044 alignment audit master — Phase 2 manage-incident)
19
- # @adr ADR-044 (Decision-Delegation Contract)
20
- # @adr ADR-013 amended Rule 1 (structured user interaction)
21
- # @adr ADR-013 Confirmation criterion #1 (no prose-ask vocabulary)
22
- # @adr ADR-011 (evidence-first workflow)
23
- # @jtbd JTBD-201 (restore service fast with audit trail)
24
- # @jtbd JTBD-001 (enforce governance without slowing down)
25
- # @jtbd JTBD-101 (extend the suite with consistent patterns)
26
-
27
- setup() {
28
- SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
29
- SKILL_FILE="${SKILL_DIR}/SKILL.md"
30
- [ -f "$SKILL_FILE" ]
31
- }
32
-
33
- # ----------------------------------------------------------------------
34
- # Surface 1 — Step 2 duplicate-check (cat-1 direction-setting; refactor)
35
- # ----------------------------------------------------------------------
36
-
37
- @test "SKILL.md Step 2 duplicate-check prompt does NOT use 'would you like' (ADR-013 Confirmation #1)" {
38
- # Refactor closes ADR-013 Confirmation criterion #1 regression at line 134.
39
- # The duplicate-check AskUserQuestion options are now structured via the
40
- # tool's options[] mechanism, not inlined as prose '(a)/(b)/(c)'.
41
- run awk '/^### 2\. /,/^### 3\. /' "$SKILL_FILE"
42
- [ "$status" -eq 0 ]
43
- ! echo "$output" | grep -qiE "would you like"
44
- }
45
-
46
- @test "SKILL.md Step 2 duplicate-check prompt does NOT use parenthetical (a)/(b)/(c)" {
47
- run awk '/^### 2\. /,/^### 3\. /' "$SKILL_FILE"
48
- [ "$status" -eq 0 ]
49
- ! echo "$output" | grep -qE "\(a\) update|\(b\) declare|\(c\) cancel"
50
- }
51
-
52
- @test "SKILL.md Step 2 duplicate-check cross-references ADR-044 category-1 (direction-setting)" {
53
- run awk '/^### 2\. /,/^### 3\. /' "$SKILL_FILE"
54
- [ "$status" -eq 0 ]
55
- [[ "$output" == *"ADR-044"* ]]
56
- [[ "$output" == *"direction-setting"* ]] || [[ "$output" == *"category 1"* ]] || [[ "$output" == *"category-1"* ]]
57
- }
58
-
59
- @test "SKILL.md Step 2 still presents 3 options (update / declare / cancel) for AskUserQuestion" {
60
- # Negative-of-negative guard — the gate must REMAIN. Refactor changes the
61
- # SHAPE (options[] vs prose), not the existence of the 3 user choices.
62
- run awk '/^### 2\. /,/^### 3\. /' "$SKILL_FILE"
63
- [ "$status" -eq 0 ]
64
- [[ "$output" == *"Update"* ]] || [[ "$output" == *"update"* ]]
65
- [[ "$output" == *"Declare"* ]] || [[ "$output" == *"declare"* ]]
66
- [[ "$output" == *"Cancel"* ]] || [[ "$output" == *"cancel"* ]]
67
- }
68
-
69
- # ----------------------------------------------------------------------
70
- # Surface 2 — Step 4 gather info (P132 derive-first refactor — cat-4 silent-framework
71
- # on derivable fields; cat-1 direction-setting fallback only on Scope)
72
- # ----------------------------------------------------------------------
73
-
74
- @test "SKILL.md Step 4 gather-info cross-references ADR-044 category-1 (direction-setting)" {
75
- run awk '/^### 4\. /,/^### 5\. /' "$SKILL_FILE"
76
- [ "$status" -eq 0 ]
77
- [[ "$output" == *"ADR-044"* ]]
78
- [[ "$output" == *"direction-setting"* ]] || [[ "$output" == *"category 1"* ]] || [[ "$output" == *"category-1"* ]]
79
- }
80
-
81
- @test "SKILL.md Step 4 cross-references ADR-044 category-4 (silent-framework) for derivable fields (P132 derive-first)" {
82
- # P132 derive-first refactor: Title / Symptoms / Start time / Severity-when-evidence-present
83
- # resolve via silent-framework per ADR-044 category 4. Only Scope retains AskUserQuestion as
84
- # the genuine category-1 direction-setting surface.
85
- run awk '/^### 4\. /,/^### 5\. /' "$SKILL_FILE"
86
- [ "$status" -eq 0 ]
87
- [[ "$output" == *"silent-framework"* ]] || [[ "$output" == *"category 4"* ]] || [[ "$output" == *"category-4"* ]]
88
- }
89
-
90
- @test "SKILL.md Step 4 derives Title from prose silently (P132 inverse-P078)" {
91
- # I001 regression cited in P132 line 14: agent asked "Title" with 3 candidate
92
- # options when kebab-casing the description would have produced the slug directly.
93
- # The refactor names "Title" + "derive"/"derived"/"kebab" in the same step.
94
- run awk '/^### 4\. /,/^### 5\. /' "$SKILL_FILE"
95
- [ "$status" -eq 0 ]
96
- [[ "$output" == *"Title"* ]]
97
- [[ "$output" == *"derive"* ]] || [[ "$output" == *"derived"* ]]
98
- [[ "$output" == *"kebab"* ]] || [[ "$output" == *"prose"* ]]
99
- }
100
-
101
- @test "SKILL.md Step 4 derives Start time from evidence sources (P132 inverse-P078)" {
102
- # I001 regression cited in P132 line 16: agent asked "Start time" with 3 candidate
103
- # options when git log first-touch evidence would have produced 2026-04-24 directly.
104
- # The refactor names git-log / timestamp / wall-clock as the three priority-ordered sources.
105
- run awk '/^### 4\. /,/^### 5\. /' "$SKILL_FILE"
106
- [ "$status" -eq 0 ]
107
- [[ "$output" == *"Start time"* ]] || [[ "$output" == *"start-time"* ]]
108
- [[ "$output" == *"git log"* ]] || [[ "$output" == *"timestamp"* ]]
109
- }
110
-
111
- @test "SKILL.md Step 4 derives Severity from RISK-POLICY matrix + evidence (P132 inverse-P078)" {
112
- # I001 regression cited in P132 line 15: agent asked "Severity" with 4 candidate
113
- # options when the RISK-POLICY matrix + observable evidence (cluster age, scorer
114
- # state) maps to a clear cell. The refactor cites RISK-POLICY.md + evidence in
115
- # the Severity row of the dispatch table. Ambiguous-evidence fallback to
116
- # AskUserQuestion is preserved as the genuine cat-5 (taste) surface.
117
- run awk '/^### 4\. /,/^### 5\. /' "$SKILL_FILE"
118
- [ "$status" -eq 0 ]
119
- [[ "$output" == *"Severity"* ]]
120
- [[ "$output" == *"RISK-POLICY"* ]]
121
- }
122
-
123
- @test "SKILL.md Step 4 retains Scope as AskUserQuestion direction-setting (negative-of-negative guard)" {
124
- # Regression-resistance: the refactor MUST preserve the genuine cat-1 direction-setting
125
- # surface on Scope. Semantic scope (who/what affected, blast radius) is user-judgment;
126
- # the framework cannot resolve it deterministically. Same reasoning as Step 2 duplicate-check.
127
- run awk '/^### 4\. /,/^### 5\. /' "$SKILL_FILE"
128
- [ "$status" -eq 0 ]
129
- [[ "$output" == *"Scope"* ]]
130
- [[ "$output" == *"AskUserQuestion"* ]]
131
- }
132
-
133
- @test "SKILL.md Step 4 cites P132 (inverse-P078 audit traceability)" {
134
- # P132 + ADR-044 must appear in Step 4 or Related section so the audit trail
135
- # for the I001 regression fix is recoverable from the SKILL.md surface.
136
- run grep -nE "P132" "$SKILL_FILE"
137
- [ "$status" -eq 0 ]
138
- }
139
-
140
- @test "SKILL.md Step 4 documents stderr advisory shape for derived fields (ADR-026 grounding)" {
141
- # ADR-026 cost-source grounding: each silent derivation emits a stderr advisory
142
- # citing the source. Pattern parity with capture-problem Step 1.5 stderr advisory.
143
- run awk '/^### 4\. /,/^### 5\. /' "$SKILL_FILE"
144
- [ "$status" -eq 0 ]
145
- [[ "$output" == *"stderr"* ]] || [[ "$output" == *"advisory"* ]]
146
- }
147
-
148
- # ----------------------------------------------------------------------
149
- # Surface 3 — Step 6 evidence-first gate refactor (cat-2; align with mitigate-incident)
150
- # ----------------------------------------------------------------------
151
-
152
- @test "SKILL.md Step 6 evidence-first gate uses 3-option pattern (Add / Record-anyway / Cancel)" {
153
- run awk '/^### 6\. /,/^### 7\. /' "$SKILL_FILE"
154
- [ "$status" -eq 0 ]
155
- [[ "$output" == *"Add evidence"* ]]
156
- [[ "$output" == *"Record"* ]]
157
- [[ "$output" == *"audit trail"* ]] || [[ "$output" == *"Audit trail"* ]]
158
- [[ "$output" == *"Cancel"* ]] || [[ "$output" == *"cancel"* ]]
159
- }
160
-
161
- @test "SKILL.md Step 6 evidence-first gate cross-references ADR-044 category-2 (deviation-approval)" {
162
- run awk '/^### 6\. /,/^### 7\. /' "$SKILL_FILE"
163
- [ "$status" -eq 0 ]
164
- [[ "$output" == *"ADR-044"* ]]
165
- [[ "$output" == *"deviation-approval"* ]] || [[ "$output" == *"category 2"* ]] || [[ "$output" == *"category-2"* ]]
166
- }
167
-
168
- @test "SKILL.md Step 6 evidence-first gate documents the bypass-marker (audit-trail consistency)" {
169
- # Aligns with mitigate-incident Step 3 (line 87): on bypass, append
170
- # 'Evidence-gate bypassed by user — reason: <justification>' to the
171
- # ## Audit trail section. Cross-skill consistency.
172
- run awk '/^### 6\. /,/^### 7\. /' "$SKILL_FILE"
173
- [ "$status" -eq 0 ]
174
- [[ "$output" == *"bypass"* ]] || [[ "$output" == *"bypassed"* ]]
175
- }
176
-
177
- # ----------------------------------------------------------------------
178
- # Surface 4 — Step 14 risk-above-appetite (cat-3 cosmetic cross-ref)
179
- # ----------------------------------------------------------------------
180
-
181
- @test "SKILL.md Step 14 risk-above-appetite cross-references ADR-044 category-3 (one-time-override)" {
182
- run awk '/^### 14\. /,/^### 15\. /' "$SKILL_FILE"
183
- [ "$status" -eq 0 ]
184
- [[ "$output" == *"ADR-044"* ]]
185
- [[ "$output" == *"one-time-override"* ]] || [[ "$output" == *"category 3"* ]] || [[ "$output" == *"category-3"* ]]
186
- }
187
-
188
- # ----------------------------------------------------------------------
189
- # P081 + P136 bridge marker
190
- # ----------------------------------------------------------------------
191
-
192
- @test "bats file carries the tdd-review: structural-permitted marker" {
193
- run grep -nE "tdd-review:[[:space:]]+structural-permitted" "${BATS_TEST_FILENAME}"
194
- [ "$status" -eq 0 ]
195
- }
196
-
197
- # ----------------------------------------------------------------------
198
- # Cross-reference: P136 audit citation in SKILL.md (Related or inline)
199
- # ----------------------------------------------------------------------
200
-
201
- @test "SKILL.md cites P136 + ADR-044 (audit traceability)" {
202
- run grep -nE "P136" "$SKILL_FILE"
203
- [ "$status" -eq 0 ]
204
- run grep -nE "ADR-044" "$SKILL_FILE"
205
- [ "$status" -eq 0 ]
206
- }
@@ -1,67 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Contract assertions for manage-incident's `close` subcommand forwarder (P071 split slice 6c).
3
- #
4
- # Per ADR-010 amended (Skill Granularity section) + P071 phased plan:
5
- # `/wr-itil:manage-incident <I> close` delegates to the new
6
- # `/wr-itil:close-incident <I>` skill via a thin-router forwarder.
7
- # Original skill already carries `deprecated-arguments: true` frontmatter
8
- # (slice 5); forwarder emits a canonical one-line systemMessage
9
- # deprecation notice.
10
- #
11
- # Structural assertion — Permitted Exception to the source-grep ban
12
- # (ADR-005 / P011 / ADR-037 contract-assertion pattern).
13
- #
14
- # @problem P071
15
- # @jtbd JTBD-001 (enforce governance without slowing down)
16
- # @jtbd JTBD-101 (extend the suite with clear patterns)
17
- # @jtbd JTBD-201 (restore service fast with an audit trail)
18
- #
19
- # Cross-reference:
20
- # P071: docs/problems/071-argument-based-skill-subcommands-are-not-discoverable.open.md
21
- # ADR-010 amended — split naming + forwarder contract + deprecated-arguments flag
22
- # ADR-011 — manage-incident skill-wrapping precedent (close gate on linked problem)
23
- # ADR-022 — problem lifecycle verification-pending status (.verifying.md allowance)
24
- # ADR-013 Rule 1 — structured user interaction (forwarder emits systemMessage, not AskUserQuestion)
25
- # ADR-037 — contract-assertion bats pattern
26
-
27
- setup() {
28
- SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
29
- SKILL_FILE="${SKILL_DIR}/SKILL.md"
30
- }
31
-
32
- @test "manage-incident SKILL.md frontmatter has deprecated-arguments: true (ADR-010 amended)" {
33
- # Already pinned by slice 5; slice 6c inherits. Guard against regression.
34
- run grep -nE "^deprecated-arguments:[[:space:]]*true[[:space:]]*$" "$SKILL_FILE"
35
- [ "$status" -eq 0 ]
36
- }
37
-
38
- @test "manage-incident Step 1 forwards 'close' argument to /wr-itil:close-incident (P071)" {
39
- # The forwarder names the target skill explicitly so the router is legible
40
- # at the contract level. ADR-010's canonical shape: "invokes the new
41
- # named skill via the Skill tool, not via re-prompting the user".
42
- run grep -inE "/wr-itil:close-incident" "$SKILL_FILE"
43
- [ "$status" -eq 0 ]
44
- }
45
-
46
- @test "manage-incident Step 1 emits the canonical close deprecation notice (ADR-010 amended)" {
47
- # ADR-010's canonical deprecation-notice template:
48
- # "/wr-<plugin>:<old> <arg> is deprecated; use /wr-<plugin>:<new>
49
- # directly. This forwarder will be removed in <plugin>'s next major
50
- # version."
51
- # The notice MUST be emitted as a systemMessage (not AskUserQuestion)
52
- # because deprecation is informational, not decisional (ADR-013 Rule 1
53
- # structured-interaction scope).
54
- run grep -inE "is deprecated.*use /wr-itil:close-incident|deprecated.*close-incident|close.*removed in .* next major version" "$SKILL_FILE"
55
- [ "$status" -eq 0 ]
56
- }
57
-
58
- @test "manage-incident Step 1 close forwarder delegates via Skill tool (P071 regression guard)" {
59
- # The forwarder must not duplicate the close logic — it must delegate.
60
- # Per ADR-010: "thin-router forwarder re-invokes the new named skill
61
- # via the Skill tool". If the forwarder grows its own gate + rename
62
- # logic, the deprecation window will harden into a permanent fork.
63
- # Guard against this by asserting the forwarder block mentions "delegate"
64
- # or "Skill tool" language near the close-incident reference.
65
- run grep -inE "delegate.*close-incident|Skill tool.*close-incident|close-incident.*Skill tool" "$SKILL_FILE"
66
- [ "$status" -eq 0 ]
67
- }
@@ -1,67 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Contract assertions for manage-incident's `link` subcommand forwarder (P071 split slice 6d).
3
- #
4
- # Per ADR-010 amended (Skill Granularity section) + P071 phased plan:
5
- # `/wr-itil:manage-incident <I> link P<M>` delegates to the new
6
- # `/wr-itil:link-incident <I> P<M>` skill via a thin-router forwarder.
7
- # Original skill already carries `deprecated-arguments: true` frontmatter
8
- # (slice 5); forwarder emits a canonical one-line systemMessage
9
- # deprecation notice.
10
- #
11
- # Structural assertion — Permitted Exception to the source-grep ban
12
- # (ADR-005 / P011 / ADR-037 contract-assertion pattern).
13
- #
14
- # @problem P071
15
- # @jtbd JTBD-001 (enforce governance without slowing down)
16
- # @jtbd JTBD-101 (extend the suite with clear patterns)
17
- # @jtbd JTBD-201 (restore service fast with an audit trail)
18
- #
19
- # Cross-reference:
20
- # P071: docs/problems/071-argument-based-skill-subcommands-are-not-discoverable.open.md
21
- # ADR-010 amended — split naming + forwarder contract + deprecated-arguments flag
22
- # ADR-011 — manage-incident skill-wrapping precedent (Linked Problem section)
23
- # ADR-013 Rule 1 — structured user interaction (forwarder emits systemMessage, not AskUserQuestion)
24
- # ADR-037 — contract-assertion bats pattern
25
-
26
- setup() {
27
- SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
28
- SKILL_FILE="${SKILL_DIR}/SKILL.md"
29
- }
30
-
31
- @test "manage-incident SKILL.md frontmatter has deprecated-arguments: true (ADR-010 amended)" {
32
- # Already pinned by slice 5; slice 6d inherits. Guard against regression.
33
- run grep -nE "^deprecated-arguments:[[:space:]]*true[[:space:]]*$" "$SKILL_FILE"
34
- [ "$status" -eq 0 ]
35
- }
36
-
37
- @test "manage-incident Step 1 forwards 'link' argument to /wr-itil:link-incident (P071)" {
38
- # The forwarder names the target skill explicitly so the router is legible
39
- # at the contract level. ADR-010's canonical shape: "invokes the new
40
- # named skill via the Skill tool, not via re-prompting the user".
41
- run grep -inE "/wr-itil:link-incident" "$SKILL_FILE"
42
- [ "$status" -eq 0 ]
43
- }
44
-
45
- @test "manage-incident Step 1 emits the canonical link deprecation notice (ADR-010 amended)" {
46
- # ADR-010's canonical deprecation-notice template:
47
- # "/wr-<plugin>:<old> <arg> is deprecated; use /wr-<plugin>:<new>
48
- # directly. This forwarder will be removed in <plugin>'s next major
49
- # version."
50
- # The notice MUST be emitted as a systemMessage (not AskUserQuestion)
51
- # because deprecation is informational, not decisional (ADR-013 Rule 1
52
- # structured-interaction scope).
53
- run grep -inE "is deprecated.*use /wr-itil:link-incident|deprecated.*link-incident|link.*removed in .* next major version" "$SKILL_FILE"
54
- [ "$status" -eq 0 ]
55
- }
56
-
57
- @test "manage-incident Step 1 link forwarder delegates via Skill tool (P071 regression guard)" {
58
- # The forwarder must not duplicate the link logic — it must delegate.
59
- # Per ADR-010: "thin-router forwarder re-invokes the new named skill
60
- # via the Skill tool". If the forwarder grows its own problem-file-lookup
61
- # + Linked Problem write logic, the deprecation window will harden into
62
- # a permanent fork. Guard against this by asserting the forwarder block
63
- # mentions "delegate" or "Skill tool" language near the link-incident
64
- # reference.
65
- run grep -inE "delegate.*link-incident|Skill tool.*link-incident|link-incident.*Skill tool" "$SKILL_FILE"
66
- [ "$status" -eq 0 ]
67
- }
@@ -1,68 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Contract assertions for manage-incident's `list` subcommand forwarder (P071 split slice 5).
3
- #
4
- # Per ADR-010 amended (Skill Granularity section) + P071 phased plan:
5
- # `/wr-itil:manage-incident list` delegates to the new `/wr-itil:list-incidents`
6
- # skill via a thin-router forwarder. Original skill carries
7
- # `deprecated-arguments: true` frontmatter; forwarder emits a
8
- # canonical one-line systemMessage deprecation notice.
9
- #
10
- # Structural assertion — Permitted Exception to the source-grep ban
11
- # (ADR-005 / P011 / ADR-037 contract-assertion pattern).
12
- #
13
- # @problem P071
14
- # @jtbd JTBD-001 (enforce governance without slowing down)
15
- # @jtbd JTBD-101 (extend the suite with clear patterns)
16
- # @jtbd JTBD-201 (restore service fast with an audit trail)
17
- #
18
- # Cross-reference:
19
- # P071: docs/problems/071-argument-based-skill-subcommands-are-not-discoverable.open.md
20
- # ADR-010 amended — split naming + forwarder contract + deprecated-arguments flag
21
- # ADR-011 — manage-incident skill-wrapping precedent
22
- # ADR-013 Rule 1 — structured user interaction (forwarder emits systemMessage, not AskUserQuestion)
23
- # ADR-037 — contract-assertion bats pattern
24
-
25
- setup() {
26
- SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
27
- SKILL_FILE="${SKILL_DIR}/SKILL.md"
28
- }
29
-
30
- @test "manage-incident SKILL.md frontmatter has deprecated-arguments: true (ADR-010 amended)" {
31
- # ADR-010 amendment pins the frontmatter flag name as `deprecated-arguments`.
32
- # The host skill of any forwarder route must carry this flag so ADR-037
33
- # cross-plugin contract assertions can find the opt-in during the
34
- # deprecation window.
35
- run grep -nE "^deprecated-arguments:[[:space:]]*true[[:space:]]*$" "$SKILL_FILE"
36
- [ "$status" -eq 0 ]
37
- }
38
-
39
- @test "manage-incident Step 1 forwards 'list' argument to /wr-itil:list-incidents (P071)" {
40
- # The forwarder names the target skill explicitly so the router is legible
41
- # at the contract level. ADR-010's canonical shape: "invokes the new
42
- # named skill via the Skill tool, not via re-prompting the user".
43
- run grep -inE "/wr-itil:list-incidents" "$SKILL_FILE"
44
- [ "$status" -eq 0 ]
45
- }
46
-
47
- @test "manage-incident Step 1 emits the canonical deprecation notice (ADR-010 amended)" {
48
- # ADR-010's canonical deprecation-notice template:
49
- # "/wr-<plugin>:<old> <arg> is deprecated; use /wr-<plugin>:<new>
50
- # directly. This forwarder will be removed in <plugin>'s next major
51
- # version."
52
- # The notice MUST be emitted as a systemMessage (not AskUserQuestion)
53
- # because deprecation is informational, not decisional (ADR-013 Rule 1
54
- # structured-interaction scope).
55
- run grep -inE "is deprecated.*use /wr-itil:list-incidents|deprecated.*list-incidents|removed in .* next major version" "$SKILL_FILE"
56
- [ "$status" -eq 0 ]
57
- }
58
-
59
- @test "manage-incident Step 1 forwarder does not re-implement the list logic (P071 regression guard)" {
60
- # The forwarder must not duplicate the list logic — it must delegate.
61
- # Per ADR-010: "thin-router forwarder re-invokes the new named skill
62
- # via the Skill tool". If the forwarder grows its own scan logic, the
63
- # deprecation window will harden into a permanent fork. Guard against
64
- # this by asserting the forwarder block mentions "delegate" or
65
- # "Skill tool" language near the list-incidents reference.
66
- run grep -inE "delegate.*list-incidents|Skill tool.*list-incidents|list-incidents.*Skill tool" "$SKILL_FILE"
67
- [ "$status" -eq 0 ]
68
- }
@@ -1,66 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Contract assertions for manage-incident's `mitigate` subcommand forwarder (P071 split slice 6a).
3
- #
4
- # Per ADR-010 amended (Skill Granularity section) + P071 phased plan:
5
- # `/wr-itil:manage-incident <I> mitigate <action>` delegates to the new
6
- # `/wr-itil:mitigate-incident <I> <action>` skill via a thin-router
7
- # forwarder. Original skill already carries `deprecated-arguments: true`
8
- # frontmatter (slice 5); forwarder emits a canonical one-line systemMessage
9
- # deprecation notice.
10
- #
11
- # Structural assertion — Permitted Exception to the source-grep ban
12
- # (ADR-005 / P011 / ADR-037 contract-assertion pattern).
13
- #
14
- # @problem P071
15
- # @jtbd JTBD-001 (enforce governance without slowing down)
16
- # @jtbd JTBD-101 (extend the suite with clear patterns)
17
- # @jtbd JTBD-201 (restore service fast with an audit trail)
18
- #
19
- # Cross-reference:
20
- # P071: docs/problems/071-argument-based-skill-subcommands-are-not-discoverable.open.md
21
- # ADR-010 amended — split naming + forwarder contract + deprecated-arguments flag
22
- # ADR-011 — manage-incident skill-wrapping precedent
23
- # ADR-013 Rule 1 — structured user interaction (forwarder emits systemMessage, not AskUserQuestion)
24
- # ADR-037 — contract-assertion bats pattern
25
-
26
- setup() {
27
- SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
28
- SKILL_FILE="${SKILL_DIR}/SKILL.md"
29
- }
30
-
31
- @test "manage-incident SKILL.md frontmatter has deprecated-arguments: true (ADR-010 amended)" {
32
- # Already pinned by slice 5; slice 6a inherits. Guard against regression.
33
- run grep -nE "^deprecated-arguments:[[:space:]]*true[[:space:]]*$" "$SKILL_FILE"
34
- [ "$status" -eq 0 ]
35
- }
36
-
37
- @test "manage-incident Step 1 forwards 'mitigate' argument to /wr-itil:mitigate-incident (P071)" {
38
- # The forwarder names the target skill explicitly so the router is legible
39
- # at the contract level. ADR-010's canonical shape: "invokes the new
40
- # named skill via the Skill tool, not via re-prompting the user".
41
- run grep -inE "/wr-itil:mitigate-incident" "$SKILL_FILE"
42
- [ "$status" -eq 0 ]
43
- }
44
-
45
- @test "manage-incident Step 1 emits the canonical mitigate deprecation notice (ADR-010 amended)" {
46
- # ADR-010's canonical deprecation-notice template:
47
- # "/wr-<plugin>:<old> <arg> is deprecated; use /wr-<plugin>:<new>
48
- # directly. This forwarder will be removed in <plugin>'s next major
49
- # version."
50
- # The notice MUST be emitted as a systemMessage (not AskUserQuestion)
51
- # because deprecation is informational, not decisional (ADR-013 Rule 1
52
- # structured-interaction scope).
53
- run grep -inE "is deprecated.*use /wr-itil:mitigate-incident|deprecated.*mitigate-incident|mitigate.*removed in .* next major version" "$SKILL_FILE"
54
- [ "$status" -eq 0 ]
55
- }
56
-
57
- @test "manage-incident Step 1 mitigate forwarder delegates via Skill tool (P071 regression guard)" {
58
- # The forwarder must not duplicate the mitigate logic — it must delegate.
59
- # Per ADR-010: "thin-router forwarder re-invokes the new named skill
60
- # via the Skill tool". If the forwarder grows its own rename + evidence-gate
61
- # logic, the deprecation window will harden into a permanent fork.
62
- # Guard against this by asserting the forwarder block mentions "delegate"
63
- # or "Skill tool" language near the mitigate-incident reference.
64
- run grep -inE "delegate.*mitigate-incident|Skill tool.*mitigate-incident|mitigate-incident.*Skill tool" "$SKILL_FILE"
65
- [ "$status" -eq 0 ]
66
- }
@@ -1,66 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Contract assertions for manage-incident's `restored` subcommand forwarder (P071 split slice 6b).
3
- #
4
- # Per ADR-010 amended (Skill Granularity section) + P071 phased plan:
5
- # `/wr-itil:manage-incident <I> restored` delegates to the new
6
- # `/wr-itil:restore-incident <I>` skill via a thin-router forwarder.
7
- # Original skill already carries `deprecated-arguments: true` frontmatter
8
- # (slice 5); forwarder emits a canonical one-line systemMessage
9
- # deprecation notice.
10
- #
11
- # Structural assertion — Permitted Exception to the source-grep ban
12
- # (ADR-005 / P011 / ADR-037 contract-assertion pattern).
13
- #
14
- # @problem P071
15
- # @jtbd JTBD-001 (enforce governance without slowing down)
16
- # @jtbd JTBD-101 (extend the suite with clear patterns)
17
- # @jtbd JTBD-201 (restore service fast with an audit trail)
18
- #
19
- # Cross-reference:
20
- # P071: docs/problems/071-argument-based-skill-subcommands-are-not-discoverable.open.md
21
- # ADR-010 amended — split naming + forwarder contract + deprecated-arguments flag
22
- # ADR-011 — manage-incident skill-wrapping precedent (restore transition + manage-problem handoff)
23
- # ADR-013 Rule 1 — structured user interaction (forwarder emits systemMessage, not AskUserQuestion)
24
- # ADR-037 — contract-assertion bats pattern
25
-
26
- setup() {
27
- SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
28
- SKILL_FILE="${SKILL_DIR}/SKILL.md"
29
- }
30
-
31
- @test "manage-incident SKILL.md frontmatter has deprecated-arguments: true (ADR-010 amended)" {
32
- # Already pinned by slice 5; slice 6b inherits. Guard against regression.
33
- run grep -nE "^deprecated-arguments:[[:space:]]*true[[:space:]]*$" "$SKILL_FILE"
34
- [ "$status" -eq 0 ]
35
- }
36
-
37
- @test "manage-incident Step 1 forwards 'restored' argument to /wr-itil:restore-incident (P071)" {
38
- # The forwarder names the target skill explicitly so the router is legible
39
- # at the contract level. ADR-010's canonical shape: "invokes the new
40
- # named skill via the Skill tool, not via re-prompting the user".
41
- run grep -inE "/wr-itil:restore-incident" "$SKILL_FILE"
42
- [ "$status" -eq 0 ]
43
- }
44
-
45
- @test "manage-incident Step 1 emits the canonical restored deprecation notice (ADR-010 amended)" {
46
- # ADR-010's canonical deprecation-notice template:
47
- # "/wr-<plugin>:<old> <arg> is deprecated; use /wr-<plugin>:<new>
48
- # directly. This forwarder will be removed in <plugin>'s next major
49
- # version."
50
- # The notice MUST be emitted as a systemMessage (not AskUserQuestion)
51
- # because deprecation is informational, not decisional (ADR-013 Rule 1
52
- # structured-interaction scope).
53
- run grep -inE "is deprecated.*use /wr-itil:restore-incident|deprecated.*restore-incident|restored.*removed in .* next major version" "$SKILL_FILE"
54
- [ "$status" -eq 0 ]
55
- }
56
-
57
- @test "manage-incident Step 1 restored forwarder delegates via Skill tool (P071 regression guard)" {
58
- # The forwarder must not duplicate the restore logic — it must delegate.
59
- # Per ADR-010: "thin-router forwarder re-invokes the new named skill
60
- # via the Skill tool". If the forwarder grows its own rename + handoff
61
- # logic, the deprecation window will harden into a permanent fork.
62
- # Guard against this by asserting the forwarder block mentions "delegate"
63
- # or "Skill tool" language near the restore-incident reference.
64
- run grep -inE "delegate.*restore-incident|Skill tool.*restore-incident|restore-incident.*Skill tool" "$SKILL_FILE"
65
- [ "$status" -eq 0 ]
66
- }