@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,48 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Doc-lint guard: manage-problem SKILL.md must document the re-stage-after-Edit
3
- # requirement for every `git mv` block that is followed by a content edit.
4
- #
5
- # Structural assertion — Permitted Exception to the source-grep ban (ADR-005 / P011).
6
- # The tests assert that the skill specification document warns authors that
7
- # `git mv` alone stages only the rename, and subsequent Edit-tool modifications
8
- # must be re-staged explicitly (`git add <new>`) before commit — otherwise the
9
- # commit captures a rename-only change and the content edit leaks into the
10
- # next commit, corrupting the audit trail (P054 / P046 incident, 2026-04-19).
11
- #
12
- # Cross-reference:
13
- # P057: docs/problems/057-git-mv-plus-edit-staging-ordering-trap.*.md
14
- # ADR-014: docs/decisions/014-governance-skills-commit-their-own-work.proposed.md
15
- # ADR-022: docs/decisions/022-problem-lifecycle-verification-pending-status.proposed.md
16
- # @jtbd JTBD-002 (ship with confidence — audit trail)
17
- # @jtbd JTBD-006 (progress the backlog while I'm away — audit trail)
18
-
19
- setup() {
20
- TEST_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")" && pwd)"
21
- REPO_ROOT="$(cd "${TEST_DIR}/../../../../.." && pwd)"
22
- SKILL_FILE="${REPO_ROOT}/packages/itil/skills/manage-problem/SKILL.md"
23
- }
24
-
25
- @test "manage-problem SKILL.md exists (P057 precondition)" {
26
- [ -f "$SKILL_FILE" ]
27
- }
28
-
29
- @test "manage-problem SKILL.md warns that git mv stages only the rename (P057)" {
30
- # The document must explicitly state that `git mv` stages the rename into
31
- # the index but does NOT pick up subsequent Edit-tool content changes.
32
- run grep -inE "git mv.*(only the rename|rename only|not .*content|stages only)" "$SKILL_FILE"
33
- [ "$status" -eq 0 ]
34
- }
35
-
36
- @test "manage-problem SKILL.md instructs re-staging the renamed file after Edit (P057)" {
37
- # Authors must be told to run `git add <new>` (or equivalent) after editing
38
- # the renamed file, before commit.
39
- run grep -inE "re-stage|re‑stage|\`git add\`.*after|after.*\`git add\`|git add <new>|git add .*\.verifying\.md|git add .*\.known-error\.md" "$SKILL_FILE"
40
- [ "$status" -eq 0 ]
41
- }
42
-
43
- @test "manage-problem SKILL.md cites P057 on the re-stage requirement (P057)" {
44
- # Traceability: the new guidance must cite P057 so reviewers can chase
45
- # the fix back to the incident that motivated it.
46
- run grep -n "P057" "$SKILL_FILE"
47
- [ "$status" -eq 0 ]
48
- }
@@ -1,39 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Doc-lint guard: manage-problem SKILL.md step 3 (Assign the next ID) must
3
- # include the next-ID collision guard against origin per ADR-019
4
- # confirmation criterion 2.
5
- #
6
- # Structural assertion — Permitted Exception to the source-grep ban (ADR-005 / P011).
7
- # These tests assert that the skill specification document instructs the
8
- # orchestrator to compare next-ID against origin/<base> before assigning,
9
- # so parallel sessions don't produce colliding ticket numbers.
10
- #
11
- # Cross-reference:
12
- # P043 (next-ID collision guard in ticket-creator skills)
13
- # P040 (work-problems does not fetch origin before starting — sibling)
14
- # ADR-019 (AFK orchestrator preflight, including next-ID guard)
15
- # @jtbd JTBD-006 (Progress the Backlog While I'm Away)
16
-
17
- setup() {
18
- SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
19
- SKILL_FILE="${SKILL_DIR}/SKILL.md"
20
- }
21
-
22
- @test "SKILL.md cites ADR-019 (next-ID collision guard)" {
23
- run grep -n "ADR-019" "$SKILL_FILE"
24
- [ "$status" -eq 0 ]
25
- }
26
-
27
- @test "SKILL.md step 3 references git ls-tree origin for next-ID lookup" {
28
- # ADR-019 mechanism: the orchestrator MUST re-check next-ID assignment
29
- # against `git ls-tree origin/<base>` before creating any new ticket.
30
- run grep -n "git ls-tree origin" "$SKILL_FILE"
31
- [ "$status" -eq 0 ]
32
- }
33
-
34
- @test "SKILL.md mentions taking the max of local and origin IDs" {
35
- # The guard logic is: take the max of local-max-ID and origin-max-ID,
36
- # then increment. Skill must mention this combination.
37
- run grep -niE "max of (the )?(two|local and origin)|max\(.*origin" "$SKILL_FILE"
38
- [ "$status" -eq 0 ]
39
- }
@@ -1,66 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Contract assertions for manage-problem's `list` subcommand forwarder (P071 split slice 1).
3
- #
4
- # Per ADR-010 amended (Skill Granularity section) + P071 phased plan:
5
- # `/wr-itil:manage-problem list` delegates to the new `/wr-itil:list-problems`
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
- #
17
- # Cross-reference:
18
- # P071: docs/problems/071-argument-based-skill-subcommands-are-not-discoverable.open.md
19
- # ADR-010 amended — split naming + forwarder contract + deprecated-arguments flag
20
- # ADR-013 Rule 1 — structured user interaction (forwarder emits systemMessage, not AskUserQuestion)
21
- # ADR-037 — contract-assertion bats pattern
22
-
23
- setup() {
24
- SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
25
- SKILL_FILE="${SKILL_DIR}/SKILL.md"
26
- }
27
-
28
- @test "manage-problem SKILL.md frontmatter has deprecated-arguments: true (ADR-010 amended)" {
29
- # ADR-010 amendment pins the frontmatter flag name as `deprecated-arguments`.
30
- # The host skill of any forwarder route must carry this flag so ADR-037
31
- # cross-plugin contract assertions can find the opt-in during the
32
- # deprecation window.
33
- run grep -nE "^deprecated-arguments:[[:space:]]*true[[:space:]]*$" "$SKILL_FILE"
34
- [ "$status" -eq 0 ]
35
- }
36
-
37
- @test "manage-problem Step 1 forwards 'list' argument to /wr-itil:list-problems (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:list-problems" "$SKILL_FILE"
42
- [ "$status" -eq 0 ]
43
- }
44
-
45
- @test "manage-problem Step 1 emits the canonical 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:list-problems|deprecated.*list-problems|removed in .* next major version" "$SKILL_FILE"
54
- [ "$status" -eq 0 ]
55
- }
56
-
57
- @test "manage-problem Step 1 forwarder does not re-implement the list logic (P071 regression guard)" {
58
- # The forwarder must not duplicate the list 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 scan logic, the
61
- # deprecation window will harden into a permanent fork. Guard against
62
- # this by asserting the forwarder block mentions "delegate" or
63
- # "Skill tool" language near the list-problems reference.
64
- run grep -inE "delegate.*list-problems|Skill tool.*list-problems|list-problems.*Skill tool" "$SKILL_FILE"
65
- [ "$status" -eq 0 ]
66
- }
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Doc-lint guard: manage-problem SKILL.md Step 3 origin-max lookup must use
3
- # `git ls-tree --name-only` to avoid false-matching blob SHA digits (P056).
4
- #
5
- # Structural assertion — Permitted Exception to the source-grep ban
6
- # (ADR-005 / P011). Default `git ls-tree` output shape is
7
- # `<mode> <type> <sha>\t<path>`. A `grep -oE '[0-9]{3}'` over that line
8
- # can match digits inside the 40-char blob SHA and return a wrong
9
- # `origin_max` (observed 997 on 2026-04-20 when opening P055). `--name-only`
10
- # drops mode/type/SHA columns leaving only the path, restoring the
11
- # invariant ADR-019 and P043 presume.
12
- #
13
- # Cross-reference:
14
- # P056: docs/problems/056-ticket-creator-next-id-lookup-blob-sha-false-match.*.md
15
- # P043 (closed): next-ID collision guard in ticket-creator skills
16
- # ADR-019: docs/decisions/019-afk-orchestrator-preflight.*.md
17
- # @jtbd JTBD-002 (ship with confidence — audit trail)
18
- # @jtbd JTBD-006 (progress the backlog while I'm away — collision-free IDs)
19
-
20
- setup() {
21
- TEST_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")" && pwd)"
22
- REPO_ROOT="$(cd "${TEST_DIR}/../../../../.." && pwd)"
23
- SKILL_FILE="${REPO_ROOT}/packages/itil/skills/manage-problem/SKILL.md"
24
- }
25
-
26
- @test "manage-problem SKILL.md exists (P056 precondition)" {
27
- [ -f "$SKILL_FILE" ]
28
- }
29
-
30
- @test "manage-problem SKILL.md origin-max lookup uses git ls-tree --name-only (P056)" {
31
- # The fix: `git ls-tree --name-only` drops mode/type/SHA columns so the
32
- # digit-extraction regex cannot match SHA hex runs.
33
- run grep -nE "git ls-tree --name-only .* docs/problems" "$SKILL_FILE"
34
- [ "$status" -eq 0 ]
35
- }
36
-
37
- @test "manage-problem SKILL.md does not keep the buggy bare git ls-tree pattern (P056)" {
38
- # Regression guard: `git ls-tree <ref> docs/problems/` without `--name-only`
39
- # piped directly into a digit regex is the bug. Any remaining pipeline of
40
- # this shape in a bash code block is a regression.
41
- run grep -nE "git ls-tree [^-].* docs/problems/ .*\| *grep -oE '\[0-9\]\{3\}'" "$SKILL_FILE"
42
- [ "$status" -ne 0 ]
43
- }
44
-
45
- @test "manage-problem SKILL.md cites P056 on the origin-max fix (P056)" {
46
- # Traceability: the fix must cite P056 so reviewers can chase the
47
- # correction back to the incident that motivated it.
48
- run grep -n "P056" "$SKILL_FILE"
49
- [ "$status" -eq 0 ]
50
- }
@@ -1,74 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Doc-lint guard: manage-problem SKILL.md must not contain prose option prompts.
3
- #
4
- # Structural assertion — Permitted Exception to the source-grep ban (ADR-005 / P011).
5
- # These tests do not assert hook behaviour; they assert that the skill specification
6
- # document conforms to the structured-interaction contract.
7
- #
8
- # Cross-reference:
9
- # ADR-013 Confirmation criterion (docs/decisions/013-structured-user-interaction-for-governance-decisions.proposed.md)
10
- # P021 investigation task: "add a BATS or doc-lint test that fails if the skill contains prose option patterns"
11
- # @jtbd JTBD-001 (enforce governance without slowing down)
12
- # @jtbd JTBD-101 (extend the suite with clear patterns)
13
-
14
- setup() {
15
- SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
16
- SKILL_FILE="${SKILL_DIR}/SKILL.md"
17
- }
18
-
19
- @test "SKILL.md exists and has frontmatter" {
20
- [ -f "$SKILL_FILE" ]
21
- run head -1 "$SKILL_FILE"
22
- [ "$status" -eq 0 ]
23
- [ "$output" = "---" ]
24
- }
25
-
26
- @test "SKILL.md does not contain 'Your call:' prose option prompt" {
27
- # ADR-013 Rule 1: all decision branch points must use AskUserQuestion, not prose.
28
- # 'Your call:' is the canonical unstructured prompt observed in P021 (risk-scorer image #3).
29
- run grep -n "Your call:" "$SKILL_FILE"
30
- [ "$status" -ne 0 ] # grep exits 1 when no match — that IS the pass condition
31
- }
32
-
33
- @test "SKILL.md does not contain freestanding 'Options: (a)' prose list" {
34
- # ADR-013 Rule 1: prose option lists must not appear as skill instructions.
35
- # Pattern: 'Options: (a)' as an instruction to Claude to present unstructured choices.
36
- # Note: 'Would you like to: (a)' in AskUserQuestion examples is a different pattern
37
- # and is NOT matched by this assertion.
38
- run grep -n "Options: (a)" "$SKILL_FILE"
39
- [ "$status" -ne 0 ]
40
- }
41
-
42
- @test "SKILL.md does not contain 'which way?' prose branch prompt" {
43
- # ADR-013 Confirmation criterion lists 'which way?' as a prohibited prose prompt.
44
- run grep -n "which way?" "$SKILL_FILE"
45
- [ "$status" -ne 0 ]
46
- }
47
-
48
- @test "SKILL.md mandates AskUserQuestion for work-next selection (WSJF tie-break)" {
49
- # ADR-013 Rule 1: the step 9c work-selection branch must use AskUserQuestion,
50
- # not a prose '(a)/(b)/(c)' list. This is a regression guard — if step 9c is
51
- # edited and the AskUserQuestion mandate is removed, this test catches it.
52
- # P021 investigation task: manage-problem WSJF tie → assert AskUserQuestion.
53
- run grep -n "AskUserQuestion" "$SKILL_FILE"
54
- [ "$status" -eq 0 ] # file MUST reference AskUserQuestion
55
- }
56
-
57
- @test "SKILL.md mandates AskUserQuestion for scope-change decisions during work" {
58
- # ADR-013 Rule 1: the 'Scope expansion during work' branch must use AskUserQuestion.
59
- # 'Scope change' is the header text used in the AskUserQuestion call for scope decisions
60
- # (per P021 amendment). Regression guard.
61
- run grep -n "Scope change" "$SKILL_FILE"
62
- [ "$status" -eq 0 ]
63
- }
64
-
65
- @test "SKILL.md step 9d requires fix summary extracted from Fix Released in AskUserQuestion (P030)" {
66
- # P030: verification prompts must include a one-line fix summary extracted from the
67
- # '## Fix Released' section so the user can answer without a clarifying round-trip.
68
- # This checks that step 9d explicitly instructs including fix content in the question,
69
- # not just detecting Fix Released to decide which problems need verification.
70
- # The fix must add wording like "extract" or "include" + "Fix Released" + "summary"
71
- # (or "question") within step 9d. A generic "Fix Released" mention is insufficient.
72
- run grep -n "fix summary\|Fix Released.*question\|Fix Released.*summary\|extract.*Fix Released\|include.*Fix Released\|summary.*Fix Released" "$SKILL_FILE"
73
- [ "$status" -eq 0 ]
74
- }
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Doc-lint guard: manage-problem SKILL.md must include the output formatting rule
3
- # requiring human-readable titles alongside bare IDs (P032).
4
- #
5
- # Structural assertion — Permitted Exception to the source-grep ban (ADR-005 / P011).
6
- # These tests assert that the skill specification document contains the output
7
- # formatting instruction so agents include titles with IDs in prose output.
8
- #
9
- # Cross-reference:
10
- # P032 (agent output uses opaque IDs without titles)
11
- # @jtbd JTBD-001 (enforce governance without slowing down)
12
-
13
- setup() {
14
- SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
15
- SKILL_FILE="${SKILL_DIR}/SKILL.md"
16
- }
17
-
18
- @test "SKILL.md contains output formatting section" {
19
- run grep -n "## Output Formatting" "$SKILL_FILE"
20
- [ "$status" -eq 0 ]
21
- }
22
-
23
- @test "SKILL.md output formatting rule requires titles with IDs (P032)" {
24
- # P032: agents must include human-readable titles when referencing IDs in prose.
25
- # The rule must mention including the title alongside IDs.
26
- run grep -n "title" "$SKILL_FILE"
27
- [ "$status" -eq 0 ]
28
- run grep -n "Output Formatting" "$SKILL_FILE"
29
- [ "$status" -eq 0 ]
30
- }
@@ -1,73 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Doc-lint guard: manage-problem SKILL.md must define the Parked lifecycle
3
- # status and the README.md fast-path cache for the `work` operation.
4
- #
5
- # Structural assertions — Permitted Exception to the source-grep ban (ADR-005 / P011).
6
- # These tests assert that the skill specification document conforms to the
7
- # P027 fix: first-class Parked status + README.md-based WSJF cache.
8
- #
9
- # Cross-reference:
10
- # P027: docs/problems/027-manage-problem-work-flow-is-expensive.open.md
11
- # @jtbd JTBD-001 (enforce governance without slowing down — under 60s)
12
- # @jtbd JTBD-005 (invoke governance assessments on demand)
13
-
14
- setup() {
15
- SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
16
- SKILL_FILE="${SKILL_DIR}/SKILL.md"
17
- }
18
-
19
- # ──────────────────────────────────────────────────────────────────────────────
20
- # Parked lifecycle status
21
- # ──────────────────────────────────────────────────────────────────────────────
22
-
23
- @test "SKILL.md lifecycle table includes Parked status" {
24
- # P027: Parked must be a first-class status so parked problems are
25
- # auto-excluded from work selection without manual user flags each session.
26
- run grep -q "Parked" "$SKILL_FILE"
27
- [ "$status" -eq 0 ]
28
- }
29
-
30
- @test "SKILL.md defines .parked.md file suffix" {
31
- # Parked problems need a distinct file suffix so the review step can
32
- # identify and exclude them by filename pattern alone.
33
- run grep -q "\.parked\.md" "$SKILL_FILE"
34
- [ "$status" -eq 0 ]
35
- }
36
-
37
- @test "SKILL.md excludes parked problems from WSJF ranking" {
38
- # Parked problems must not appear in the WSJF table — they are listed
39
- # separately so users can see them but they don't pollute the ranking.
40
- run grep -q "parked.*exclud\|exclud.*parked\|Parked.*exclud\|exclud.*Parked\|skip.*[Pp]arked\|[Pp]arked.*skip" "$SKILL_FILE"
41
- [ "$status" -eq 0 ]
42
- }
43
-
44
- # ──────────────────────────────────────────────────────────────────────────────
45
- # README.md cache (fast-path for `problem work`)
46
- # ──────────────────────────────────────────────────────────────────────────────
47
-
48
- @test "SKILL.md references README.md as the cache file" {
49
- # P027: docs/problems/README.md is the WSJF cache written by review
50
- # and read by work to skip the full re-scan when nothing changed.
51
- run grep -q "README\.md" "$SKILL_FILE"
52
- [ "$status" -eq 0 ]
53
- }
54
-
55
- @test "SKILL.md describes writing README.md after review" {
56
- # The review step (9e) must write/overwrite README.md with the ranked table.
57
- # Without this write, the cache never gets populated.
58
- run grep -q "README\.md" "$SKILL_FILE"
59
- [ "$status" -eq 0 ]
60
- }
61
-
62
- @test "SKILL.md describes checking README.md freshness using git history, not mtime" {
63
- # P031: The mtime-based `find -newer` check is broken in git worktrees
64
- # because all files receive the same mtime at checkout time.
65
- # The cache-freshness check must use git log to compare commits, not
66
- # filesystem timestamps.
67
- # Positive: SKILL.md uses git log for cache freshness.
68
- run grep -q "git log.*README\.md" "$SKILL_FILE"
69
- [ "$status" -eq 0 ]
70
- # Negative: SKILL.md must NOT use find -newer for cache freshness.
71
- run grep -q "\-newer" "$SKILL_FILE"
72
- [ "$status" -ne 0 ]
73
- }
@@ -1,62 +0,0 @@
1
- #!/usr/bin/env bats
2
-
3
- # P062: manage-problem SKILL.md documents that every Step 7 status
4
- # transition refreshes docs/problems/README.md and stages it in the
5
- # same commit — including folded-fix commits that ride with `fix(...)`.
6
- #
7
- # Doc-lint structural test (Permitted Exception per ADR-005). Asserts
8
- # SKILL.md wording for the refresh block, the four transition scopes,
9
- # the folded-fix-commit case, the fast-path interaction, and the
10
- # Step 11 commit convention's stage-list requirement.
11
-
12
- setup() {
13
- REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
14
- SKILL_MD="$REPO_ROOT/packages/itil/skills/manage-problem/SKILL.md"
15
- }
16
-
17
- @test "manage-problem: SKILL.md contains the README.md refresh block (P062)" {
18
- run grep -F 'README.md refresh on every transition (P062)' "$SKILL_MD"
19
- [ "$status" -eq 0 ]
20
- }
21
-
22
- @test "manage-problem: the refresh block lists all four transition scopes" {
23
- run grep -F 'Open → Known Error, Known Error → Verification Pending, Verification Pending → Closed, Parked' "$SKILL_MD"
24
- [ "$status" -eq 0 ]
25
- }
26
-
27
- @test "manage-problem: the refresh block covers folded-fix commits explicitly" {
28
- run grep -F '**Folded-fix commits**' "$SKILL_MD"
29
- [ "$status" -eq 0 ]
30
- }
31
-
32
- @test "manage-problem: the refresh block says refresh is a render not a re-rank" {
33
- run grep -F 'The refresh is a render, not a re-rank' "$SKILL_MD"
34
- [ "$status" -eq 0 ]
35
- }
36
-
37
- @test "manage-problem: the refresh block stages README.md in the same commit" {
38
- run grep -F 'git add docs/problems/README.md' "$SKILL_MD"
39
- [ "$status" -eq 0 ]
40
- }
41
-
42
- @test "manage-problem: Step 11 commit convention requires README.md in the stage list on transitions (P062)" {
43
- run grep -F 'stage list MUST include `docs/problems/README.md`' "$SKILL_MD"
44
- [ "$status" -eq 0 ]
45
- }
46
-
47
- @test "manage-problem: Step 11 references Step 7's refresh block from the stage-list requirement" {
48
- run grep -F "Step 7's \"README.md refresh on every transition\" block (P062)" "$SKILL_MD"
49
- [ "$status" -eq 0 ]
50
- }
51
-
52
- @test "manage-problem: refresh block describes the fast-path interaction" {
53
- run grep -F 'Fast-path interaction' "$SKILL_MD"
54
- [ "$status" -eq 0 ]
55
- run grep -F 'cache stays fresh by construction' "$SKILL_MD"
56
- [ "$status" -eq 0 ]
57
- }
58
-
59
- @test "manage-problem: refresh block describes Last reviewed line update" {
60
- run grep -F 'Update the "Last reviewed" line' "$SKILL_MD"
61
- [ "$status" -eq 0 ]
62
- }