@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,64 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Doc-lint guard: manage-problem SKILL.md must surface Verification Pending
3
- # tickets whose fix path has been exercised in practice — the detection-layer
4
- # fix for P048. Minimal-scope candidates per P048:
5
- # - Fix 1: step 9d always fires even on the fast-path cache hit.
6
- # - Fix 4: step 9c / Verification Queue highlights tickets whose release
7
- # age is >= 14 days as "likely verified" candidates.
8
- #
9
- # Candidates 2 (standalone verify-fixes op), 3 (exercise observations with a
10
- # new file-level state dimension), and 5 (AFK-mode hook) are deferred —
11
- # candidate 3 needs an ADR-scope decision per P048 investigation tasks.
12
- #
13
- # Structural assertion — Permitted Exception to the source-grep ban
14
- # (ADR-005 / P011).
15
- #
16
- # Cross-reference:
17
- # P048: docs/problems/048-manage-problem-does-not-detect-verification-candidates.open.md
18
- # ADR-022 (Verification Pending status): docs/decisions/022-problem-lifecycle-verification-pending-status.proposed.md
19
- # ADR-013 Rule 1: docs/decisions/013-structured-user-interaction-for-governance-decisions.proposed.md
20
- # @jtbd JTBD-001 (enforce governance without slowing down)
21
- # @jtbd JTBD-006 (progress the backlog while I'm away)
22
- # @jtbd JTBD-101 (extend the suite with clear patterns)
23
-
24
- setup() {
25
- SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
26
- SKILL_FILE="${SKILL_DIR}/SKILL.md"
27
- }
28
-
29
- @test "SKILL.md exists (P048 precondition)" {
30
- [ -f "$SKILL_FILE" ]
31
- }
32
-
33
- @test "SKILL.md fast-path explicitly fires step 9d on cache hit (P048 Candidate 1)" {
34
- # The fast-path currently reads: "Skip steps 9a-9b entirely / Proceed
35
- # directly to step 9c". P048 reports step 9d being treated as skipped
36
- # alongside 9a-9b. Fix: add explicit wording that step 9d fires even on
37
- # cache hit, so verification candidates are always offered on review.
38
- run grep -inE "step 9d.*(always fires?|still fires?|fires? (even|on) (cache|fast-path))|fast-path.*step 9d fires|cache hit.*step 9d" "$SKILL_FILE"
39
- [ "$status" -eq 0 ]
40
- }
41
-
42
- @test "SKILL.md step 9c Verification Queue highlights release-age candidates (P048 Candidate 4)" {
43
- # Review output must surface Verification Pending tickets whose release
44
- # age crosses a threshold as "likely verified" candidates. Accept either
45
- # a literal "likely verified" callout OR an explicit age-based criterion
46
- # (>= 14 days) in the Verification Queue presentation.
47
- run grep -inE "likely verified|release age|age.*(>=|greater than|over|older than).*(days?|d)|stale verification" "$SKILL_FILE"
48
- [ "$status" -eq 0 ]
49
- }
50
-
51
- @test "SKILL.md step 9c Verification Queue documents the 14-day default threshold (P048 Candidate 4)" {
52
- # The 14-day threshold is a within-skill default per architect review;
53
- # the default must be named in the SKILL.md so implementations stay
54
- # consistent until a policy-level decision moves it.
55
- run grep -inE "14[ -]day|14 days|fourteen days" "$SKILL_FILE"
56
- [ "$status" -eq 0 ]
57
- }
58
-
59
- @test "SKILL.md cites P048 for the detection-layer extension" {
60
- # Traceability: the SKILL.md must name the problem ticket this
61
- # detection extension addresses so reviewers can chase history.
62
- run grep -n "P048" "$SKILL_FILE"
63
- [ "$status" -eq 0 ]
64
- }
@@ -1,114 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Doc-lint guard: manage-problem / work-problems / manage-incident SKILL.md
3
- # files must document the Verification Pending lifecycle status per ADR-022.
4
- # README.md template must present a Verification Queue section driven off the
5
- # `.verifying.md` glob.
6
- #
7
- # Structural assertion — Permitted Exception to the source-grep ban
8
- # (ADR-005 / P011). These tests assert that the three skill specification
9
- # documents and the README template contain the status contract introduced
10
- # by ADR-022 (Problem lifecycle — Verification Pending).
11
- #
12
- # Migration of existing `.known-error.md` files to `.verifying.md` is a
13
- # separate follow-up commit per ADR-022 Scope; these tests cover only the
14
- # documentation/contract changes that land in this iteration.
15
- #
16
- # Cross-reference:
17
- # ADR-022: docs/decisions/022-problem-lifecycle-verification-pending-status.proposed.md
18
- # P049: docs/problems/049-known-error-status-overloaded-with-fix-released-substate.*.md
19
- # P048: docs/problems/048-manage-problem-does-not-detect-verification-candidates.open.md
20
- # ADR-011: docs/decisions/011-manage-incident-skill.proposed.md
21
- # ADR-014: docs/decisions/014-governance-skills-commit-their-own-work.proposed.md
22
- # @jtbd JTBD-001 (enforce governance without slowing down)
23
- # @jtbd JTBD-006 (progress the backlog while I'm away)
24
- # @jtbd JTBD-101 (extend the suite with clear patterns)
25
- # @jtbd JTBD-201 (restore service fast with an audit trail)
26
-
27
- setup() {
28
- TEST_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")" && pwd)"
29
- # Test file lives at packages/itil/skills/manage-problem/test/ — walk up to the
30
- # repo root and then into the three SKILL.md locations.
31
- REPO_ROOT="$(cd "${TEST_DIR}/../../../../.." && pwd)"
32
- MANAGE_PROBLEM="${REPO_ROOT}/packages/itil/skills/manage-problem/SKILL.md"
33
- WORK_PROBLEMS="${REPO_ROOT}/packages/itil/skills/work-problems/SKILL.md"
34
- MANAGE_INCIDENT="${REPO_ROOT}/packages/itil/skills/manage-incident/SKILL.md"
35
- README_FILE="${REPO_ROOT}/docs/problems/README.md"
36
- }
37
-
38
- @test "ADR-022 exists (P049 precondition)" {
39
- [ -f "${REPO_ROOT}/docs/decisions/022-problem-lifecycle-verification-pending-status.proposed.md" ] || \
40
- [ -f "${REPO_ROOT}/docs/decisions/022-problem-lifecycle-verification-pending-status.accepted.md" ]
41
- }
42
-
43
- @test "manage-problem SKILL.md exists (P049 precondition)" {
44
- [ -f "$MANAGE_PROBLEM" ]
45
- }
46
-
47
- @test "manage-problem SKILL.md lifecycle table includes Verification Pending status (P049 + ADR-022)" {
48
- # ADR-022 Confirmation item 1: the lifecycle table must carry
49
- # "Verification Pending | .verifying.md" as a first-class row.
50
- run grep -inE "Verification Pending" "$MANAGE_PROBLEM"
51
- [ "$status" -eq 0 ]
52
- run grep -inE "\.verifying\.md" "$MANAGE_PROBLEM"
53
- [ "$status" -eq 0 ]
54
- }
55
-
56
- @test "manage-problem SKILL.md WSJF multiplier table documents Verification Pending exclusion (P049 + ADR-022)" {
57
- # ADR-022 Confirmation item 1: status multiplier table must carry a row
58
- # with the new status and either multiplier 0 OR explicit "excluded"
59
- # wording. Accept either so future tuning within the ADR's "reassessment
60
- # criteria" envelope doesn't require this test to change.
61
- run grep -inE "Verification Pending.*(0|excluded)|excluded.*Verification Pending" "$MANAGE_PROBLEM"
62
- [ "$status" -eq 0 ]
63
- }
64
-
65
- @test "manage-problem SKILL.md documents the Known Error to Verification Pending transition (P049 + ADR-022)" {
66
- # ADR-022 Scope line 61: the skill must describe the Known Error →
67
- # Verification Pending transition explicitly (git mv + Status field
68
- # update + Fix Released section in the same commit).
69
- run grep -inE "(Known Error|\.known-error\.md).*(→|->|to).*(Verification Pending|\.verifying\.md)|git mv.*\.verifying\.md" "$MANAGE_PROBLEM"
70
- [ "$status" -eq 0 ]
71
- }
72
-
73
- @test "manage-problem SKILL.md review step 9 targets .verifying.md via glob or suffix (P049 + ADR-022)" {
74
- # ADR-022 Confirmation: step 9d targets *.verifying.md via glob rather
75
- # than scanning .known-error.md bodies.
76
- run grep -inE "\*\.verifying\.md|\.verifying\.md.*glob|glob.*\.verifying\.md" "$MANAGE_PROBLEM"
77
- [ "$status" -eq 0 ]
78
- }
79
-
80
- @test "manage-problem SKILL.md review step 9 has a Verification Queue section (P049 + ADR-022)" {
81
- # ADR-022 Scope line 63: dedicated Verification Queue section parallel to
82
- # the main ranked table.
83
- run grep -inE "Verification Queue" "$MANAGE_PROBLEM"
84
- [ "$status" -eq 0 ]
85
- }
86
-
87
- @test "manage-problem SKILL.md cites ADR-022 (P049)" {
88
- # Traceability: the skill must cite the ADR that governs the status
89
- # contract so reviewers can chase the decision from the implementation.
90
- run grep -n "ADR-022" "$MANAGE_PROBLEM"
91
- [ "$status" -eq 0 ]
92
- }
93
-
94
- @test "work-problems SKILL.md classifier uses the .verifying.md suffix (P049 + ADR-022)" {
95
- # ADR-022 Scope line 67: work-problems classifier becomes suffix-based
96
- # rather than file-body-scan-based.
97
- run grep -inE "\.verifying\.md" "$WORK_PROBLEMS"
98
- [ "$status" -eq 0 ]
99
- }
100
-
101
- @test "manage-incident SKILL.md linked-problem close gating accepts .verifying.md (P049 + ADR-022)" {
102
- # ADR-022 Scope line 68: incident close gating accepts .verifying.md
103
- # alongside .known-error.md and .closed.md; .open.md still blocks.
104
- run grep -inE "\.verifying\.md" "$MANAGE_INCIDENT"
105
- [ "$status" -eq 0 ]
106
- }
107
-
108
- @test "docs/problems/README.md template has a Verification Queue section (P049 + ADR-022)" {
109
- # ADR-022 Scope line 69: README replaces the hand-maintained "Known Errors
110
- # (Fix Released — pending verification)" shadow table with a Verification
111
- # Queue driven off the glob.
112
- run grep -inE "Verification Queue" "$README_FILE"
113
- [ "$status" -eq 0 ]
114
- }
@@ -1,88 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Contract assertions for manage-problem's `work` subcommand forwarder (P071 split slice 3).
3
- #
4
- # Per ADR-010 amended (Skill Granularity section) + P071 phased plan:
5
- # `/wr-itil:manage-problem work` delegates to the new
6
- # `/wr-itil:work-problem` (singular) skill via a thin-router forwarder.
7
- # Original skill already carries `deprecated-arguments: true` frontmatter
8
- # from slice 1; this file asserts the work-forwarder-specific contract.
9
- #
10
- # CRITICAL naming distinction: the forwarder target is singular
11
- # `/wr-itil:work-problem` — NOT the plural `/wr-itil:work-problems`
12
- # (the AFK orchestrator that already exists). Name coexistence is a
13
- # P071-acknowledged trade-off.
14
- #
15
- # Structural assertion — Permitted Exception to the source-grep ban
16
- # (ADR-005 / P011 / ADR-037 contract-assertion pattern).
17
- #
18
- # @problem P071
19
- # @jtbd JTBD-001 (enforce governance without slowing down)
20
- # @jtbd JTBD-101 (extend the suite with clear patterns)
21
- #
22
- # Cross-reference:
23
- # P071: docs/problems/071-argument-based-skill-subcommands-are-not-discoverable.open.md
24
- # ADR-010 amended — split naming + forwarder contract + deprecated-arguments flag
25
- # ADR-013 Rule 1 — structured user interaction (forwarder emits systemMessage, not AskUserQuestion)
26
- # ADR-037 — contract-assertion bats pattern
27
-
28
- setup() {
29
- SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
30
- SKILL_FILE="${SKILL_DIR}/SKILL.md"
31
- }
32
-
33
- @test "manage-problem Step 1 forwards 'work' argument to /wr-itil:work-problem singular (P071 slice 3)" {
34
- # The forwarder names the target skill explicitly so the router is
35
- # legible at the contract level. ADR-010's canonical shape: "invokes
36
- # the new named skill via the Skill tool, not via re-prompting the
37
- # user". Target is the SINGULAR name.
38
- run grep -inE "/wr-itil:work-problem\b" "$SKILL_FILE"
39
- [ "$status" -eq 0 ]
40
- }
41
-
42
- @test "manage-problem Step 1 work-forwarder target is singular, not plural (name collision guard)" {
43
- # The forwarder target MUST be /wr-itil:work-problem (singular).
44
- # The plural /wr-itil:work-problems already exists as the AFK
45
- # orchestrator and has a completely different semantics (batch loop
46
- # vs single ticket). A forwarder that routed 'work' to the plural
47
- # orchestrator would subtly break interactive invocations — the user
48
- # would get an AFK-mode iteration loop when they wanted one ticket.
49
- #
50
- # Assert the forwarder block explicitly names 'singular' so the
51
- # distinction is legible at the contract level.
52
- run grep -inE "/wr-itil:work-problem.*singular|singular.*work-problem" "$SKILL_FILE"
53
- [ "$status" -eq 0 ]
54
- }
55
-
56
- @test "manage-problem Step 1 emits the canonical work deprecation notice (ADR-010 amended)" {
57
- # ADR-010's canonical deprecation-notice template:
58
- # "/wr-<plugin>:<old> <arg> is deprecated; use /wr-<plugin>:<new>
59
- # directly. This forwarder will be removed in <plugin>'s next major
60
- # version."
61
- # The notice MUST be emitted as a systemMessage (not AskUserQuestion)
62
- # because deprecation is informational, not decisional (ADR-013 Rule 1
63
- # scope). Work-forwarder notice is distinct from list + review
64
- # forwarders; all three must co-exist verbatim.
65
- run grep -inE "is deprecated.*use /wr-itil:work-problem|deprecated.*work-problem|removed in .* next major version" "$SKILL_FILE"
66
- [ "$status" -eq 0 ]
67
- }
68
-
69
- @test "manage-problem Step 1 work-forwarder does not re-implement selection logic (P071 regression guard)" {
70
- # The forwarder must not duplicate the selection logic — it must
71
- # delegate. Per ADR-010: "thin-router forwarder re-invokes the new
72
- # named skill via the Skill tool". If the forwarder grows its own
73
- # freshness-check + AskUserQuestion + delegate stack, the
74
- # deprecation window will harden into a permanent fork.
75
- run grep -inE "delegate.*work-problem\b|Skill tool.*work-problem\b|work-problem\b.*Skill tool" "$SKILL_FILE"
76
- [ "$status" -eq 0 ]
77
- }
78
-
79
- @test "manage-problem work-forwarder Step 1 parser delegates, does not run inline (P071 slice 3)" {
80
- # Slice 3's defining behaviour: Step 1's `work` branch must delegate,
81
- # not run the review+select flow inline. The parser line must say
82
- # "delegate to /wr-itil:work-problem", matching the shape the list
83
- # and review forwarders use. A stale "run a review (step 9) first"
84
- # line would indicate the forwarder was added without updating the
85
- # parser (common slip per slice 2's lesson).
86
- run grep -nE "^- If arguments contain \"work\", \*\*delegate to \`/wr-itil:work-problem\`\*\*" "$SKILL_FILE"
87
- [ "$status" -eq 0 ]
88
- }
@@ -1,174 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Behavioural contract fixtures for /wr-itil:manage-story (P170 Phase 2
3
- # Slice 8 — ADR-060 amendment 2026-05-10 lines 200-253 + 270 + 292).
4
- #
5
- # Per ADR-052: behavioural assertions on observable SKILL contract
6
- # surfaces. Skill-prose behaviour for prompt-driven agents isn't
7
- # directly testable in bats; these tests assert presence of the
8
- # load-bearing identifiers in the SKILL contract (the closest in-
9
- # session-reachable approximation per P081 + P012).
10
- #
11
- # Behavioural surfaces under test:
12
- # 1. SKILL.md presence + canonical name.
13
- # 2. I6-I11 invariant table presence (load-bearing).
14
- # 3. I7 + I8 hard-block fires at accepted transition (not earlier).
15
- # 4. I10 INVEST shape gate names all 4 INVEST checks (Testable /
16
- # Valuable / Independent / Estimable) + L/XL decomposition-
17
- # candidate advisory per ADR-060 line 252 nitpick N3.
18
- # 5. Auto-transition triggers named: draft→in-progress on first
19
- # non-capture commit; in-progress→done on criteria-ticked + RFC
20
- # closed.
21
- # 6. Bootstrap-exemption marker contract named per ADR-060 line 339.
22
- # 7. Reverse-trace refresh on all 4 parent tiers (problem / JTBD /
23
- # RFC / story-map) named, with story-map manual placement noted
24
- # per architect amend finding 2 on Slice 7.
25
- # 8. No-WSJF-leak (I11) — no WSJF field in argument grammar or
26
- # frontmatter handling.
27
- #
28
- # @problem P170
29
- # @jtbd JTBD-008 (Decompose a Fix Into Coordinated Changes)
30
- # @jtbd JTBD-001 (extended scope — change-set-level governance)
31
- # @adr ADR-060 (Problem-RFC-Story framework — story tier)
32
- # @adr ADR-052 (Behavioural-tests-default)
33
- # @adr ADR-032 (governance-skill aside-invocation pattern)
34
-
35
- setup() {
36
- REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
37
- SKILL_FILE="${REPO_ROOT}/packages/itil/skills/manage-story/SKILL.md"
38
- }
39
-
40
- # ---------------------------------------------------------------------------
41
- # Surface 0: SKILL.md presence + canonical name
42
- # ---------------------------------------------------------------------------
43
-
44
- @test "manage-story: SKILL.md exists" {
45
- [ -f "$SKILL_FILE" ]
46
- }
47
-
48
- @test "manage-story: SKILL.md frontmatter declares wr-itil:manage-story name" {
49
- run grep -E '^name: wr-itil:manage-story$' "$SKILL_FILE"
50
- [ "$status" -eq 0 ]
51
- }
52
-
53
- # ---------------------------------------------------------------------------
54
- # Surface 1: I6-I11 invariant table presence
55
- # ---------------------------------------------------------------------------
56
-
57
- @test "manage-story: SKILL.md declares I6 trace-to-problem invariant" {
58
- run grep -E 'I6.*trace-to-problem|trace-to-problem.*I6' "$SKILL_FILE"
59
- [ "$status" -eq 0 ]
60
- }
61
-
62
- @test "manage-story: SKILL.md declares I7 trace-to-RFC invariant" {
63
- run grep -E 'I7.*trace-to-RFC|trace-to-RFC.*I7' "$SKILL_FILE"
64
- [ "$status" -eq 0 ]
65
- }
66
-
67
- @test "manage-story: SKILL.md declares I8 trace-to-story-map invariant" {
68
- run grep -E 'I8.*trace-to-story-map|trace-to-story-map.*I8' "$SKILL_FILE"
69
- [ "$status" -eq 0 ]
70
- }
71
-
72
- @test "manage-story: SKILL.md declares I9 trace-to-JTBD invariant" {
73
- run grep -E 'I9.*trace-to-JTBD|trace-to-JTBD.*I9' "$SKILL_FILE"
74
- [ "$status" -eq 0 ]
75
- }
76
-
77
- @test "manage-story: SKILL.md declares I10 INVEST shape invariant" {
78
- run grep -E 'I10.*INVEST|INVEST.*I10' "$SKILL_FILE"
79
- [ "$status" -eq 0 ]
80
- }
81
-
82
- @test "manage-story: SKILL.md declares I11 no-WSJF-leak invariant" {
83
- run grep -E 'I11.*WSJF|WSJF.*I11|no-WSJF-leak' "$SKILL_FILE"
84
- [ "$status" -eq 0 ]
85
- }
86
-
87
- # ---------------------------------------------------------------------------
88
- # Surface 2: I7 + I8 fire at accepted transition (not earlier)
89
- # ---------------------------------------------------------------------------
90
-
91
- @test "manage-story: SKILL.md states I7 + I8 hard-block fires at accepted transition" {
92
- # The deferred-from-capture contract is load-bearing per ADR-060
93
- # line 291 — capture-story permits absent traces; manage-story
94
- # accepted gate enforces them.
95
- run grep -iE 'I7.*accepted|hard-block at.*accepted|fires at.*accepted.*I7' "$SKILL_FILE"
96
- [ "$status" -eq 0 ]
97
- }
98
-
99
- # ---------------------------------------------------------------------------
100
- # Surface 3: I10 INVEST 4-axis check
101
- # ---------------------------------------------------------------------------
102
-
103
- @test "manage-story: SKILL.md names all 4 INVEST checks (Testable/Valuable/Independent/Estimable)" {
104
- for axis in Testable Valuable Independent Estimable; do
105
- run grep -i "$axis" "$SKILL_FILE"
106
- [ "$status" -eq 0 ]
107
- done
108
- }
109
-
110
- @test "manage-story: SKILL.md names L/XL decomposition-candidate advisory per ADR-060 nitpick N3" {
111
- run grep -iE 'L/XL.*decomposition|decomposition.candidate|N3' "$SKILL_FILE"
112
- [ "$status" -eq 0 ]
113
- }
114
-
115
- # ---------------------------------------------------------------------------
116
- # Surface 4: Auto-transition triggers
117
- # ---------------------------------------------------------------------------
118
-
119
- @test "manage-story: SKILL.md names accepted → in-progress on the first implementing commit (ADR-096: draft blocked, not auto-advanced)" {
120
- run grep -iE 'accepted → in-progress' "$SKILL_FILE"
121
- [ "$status" -eq 0 ]
122
- # ADR-096: the old draft → in-progress auto-transition is removed.
123
- run grep -iE 'NO .draft → in-progress. transition|never implementable' "$SKILL_FILE"
124
- [ "$status" -eq 0 ]
125
- }
126
-
127
- @test "manage-story: SKILL.md names in-progress → done auto-transition on criteria-ticked + RFC closed" {
128
- run grep -iE 'in-progress.*done.*criteria.*ticked|all.*criteria.*ticked.*RFC.*closed|RFC.*closed.*all-criteria' "$SKILL_FILE"
129
- [ "$status" -eq 0 ]
130
- }
131
-
132
- # ---------------------------------------------------------------------------
133
- # Surface 5: Bootstrap-exemption marker
134
- # ---------------------------------------------------------------------------
135
-
136
- @test "manage-story: SKILL.md names bootstrap-exemption marker per ADR-060 line 339" {
137
- run grep -iE 'bootstrap-exempt|bootstrap.exemption|ADR-053.*Bootstrapping' "$SKILL_FILE"
138
- [ "$status" -eq 0 ]
139
- }
140
-
141
- # ---------------------------------------------------------------------------
142
- # Surface 6: Reverse-trace refresh on 4 parent tiers
143
- # ---------------------------------------------------------------------------
144
-
145
- @test "manage-story: SKILL.md names reverse-trace refresh on problem parents via update-problem-references-section.sh" {
146
- run grep -E 'update-problem-references-section\.sh.*Stories' "$SKILL_FILE"
147
- [ "$status" -eq 0 ]
148
- }
149
-
150
- @test "manage-story: SKILL.md names reverse-trace refresh on JTBD parents via update-jtbd-references-section.sh" {
151
- run grep -E 'update-jtbd-references-section\.sh.*Stories' "$SKILL_FILE"
152
- [ "$status" -eq 0 ]
153
- }
154
-
155
- @test "manage-story: SKILL.md names reverse-trace refresh on RFC parents via update-rfc-references-section.sh" {
156
- run grep -E 'update-rfc-references-section\.sh.*Stories' "$SKILL_FILE"
157
- [ "$status" -eq 0 ]
158
- }
159
-
160
- @test "manage-story: SKILL.md names story-map parents as MANUAL placement (no automatic refresh per Slice 7 architect amend finding 2)" {
161
- run grep -iE 'manually-authored|manual placement|no automatic refresh' "$SKILL_FILE"
162
- [ "$status" -eq 0 ]
163
- }
164
-
165
- # ---------------------------------------------------------------------------
166
- # Surface 7: I11 no-WSJF-leak — no WSJF field in argument grammar
167
- # ---------------------------------------------------------------------------
168
-
169
- @test "manage-story: SKILL.md argument grammar does NOT include a WSJF flag/token (I11 invariant)" {
170
- # The argument grammar block — extract the fenced block following
171
- # "## Argument grammar" and verify no WSJF token in it.
172
- run grep -A 20 '^## Argument grammar' "$SKILL_FILE"
173
- [[ "$output" != *"WSJF"* ]] && [[ "$output" != *"wsjf"* ]]
174
- }
@@ -1,63 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Behavioural contract fixtures for /wr-itil:manage-story-map (P170 Phase 2 Slice 4).
3
-
4
- setup() {
5
- REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
6
- SKILL_FILE="${REPO_ROOT}/packages/itil/skills/manage-story-map/SKILL.md"
7
- }
8
-
9
- @test "manage-story-map: SKILL.md exists" {
10
- [ -f "$SKILL_FILE" ]
11
- }
12
-
13
- @test "manage-story-map: SKILL.md frontmatter declares wr-itil:manage-story-map name" {
14
- run grep -E '^name: wr-itil:manage-story-map$' "$SKILL_FILE"
15
- [ "$status" -eq 0 ]
16
- }
17
-
18
- @test "manage-story-map: SKILL.md declares I3 trace-to-problem invariant" {
19
- run grep -E 'I3.*trace-to-problem|trace-to-problem.*I3' "$SKILL_FILE"
20
- [ "$status" -eq 0 ]
21
- }
22
-
23
- @test "manage-story-map: SKILL.md declares I4 trace-to-JTBD invariant" {
24
- run grep -E 'I4.*trace-to-JTBD|trace-to-JTBD.*I4' "$SKILL_FILE"
25
- [ "$status" -eq 0 ]
26
- }
27
-
28
- @test "manage-story-map: SKILL.md declares I5 no-WSJF-leak invariant" {
29
- run grep -E 'I5.*WSJF|WSJF.*I5|no-WSJF-leak' "$SKILL_FILE"
30
- [ "$status" -eq 0 ]
31
- }
32
-
33
- @test "manage-story-map: SKILL.md names 5 lifecycle states (draft / accepted / in-progress / completed / archived)" {
34
- for state in draft accepted in-progress completed archived; do
35
- run grep -E "${state}" "$SKILL_FILE"
36
- [ "$status" -eq 0 ]
37
- done
38
- }
39
-
40
- @test "manage-story-map: SKILL.md names bootstrap-exemption marker per ADR-060 line 339" {
41
- run grep -iE 'bootstrap-exempt|ADR-053.*Bootstrapping' "$SKILL_FILE"
42
- [ "$status" -eq 0 ]
43
- }
44
-
45
- @test "manage-story-map: SKILL.md names reverse-trace refresh on problem parents via Story Maps section" {
46
- run grep -E 'wr-itil-update-problem-references-section.*Story Maps' "$SKILL_FILE"
47
- [ "$status" -eq 0 ]
48
- }
49
-
50
- @test "manage-story-map: SKILL.md names reverse-trace refresh on JTBD parents via Story Maps section" {
51
- run grep -E 'wr-itil-update-jtbd-references-section.*Story Maps' "$SKILL_FILE"
52
- [ "$status" -eq 0 ]
53
- }
54
-
55
- @test "manage-story-map: SKILL.md states map HTML files do NOT carry markdown reverse-trace section themselves (per Slice 7 architect amend finding 2)" {
56
- run grep -iE 'do NOT carry.*markdown reverse-trace|authored manually|manual.*data-attribute' "$SKILL_FILE"
57
- [ "$status" -eq 0 ]
58
- }
59
-
60
- @test "manage-story-map: argument grammar contains no WSJF token (I5 invariant)" {
61
- run grep -A 10 '^## Argument grammar' "$SKILL_FILE"
62
- [[ "$output" != *"WSJF"* ]] && [[ "$output" != *"wsjf"* ]]
63
- }