@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,229 +0,0 @@
1
- #!/usr/bin/env bats
2
-
3
- # P186: `Likely verified?` column in docs/problems/README.md
4
- # Verification Queue must carry an evidence-first cell shape — NOT
5
- # the original P048 Candidate 4 age-based heuristic (≥14 days = yes).
6
- # Sibling proxy-for-evidence anti-pattern to P185 at the review-problems
7
- # Step 3/5 surface. User critique 2026-05-12: "I don't like 'it's been
8
- # a while, so likely verified' approach. We want firm evidence. For
9
- # these, it should be things you actually observe."
10
- #
11
- # Three canonical values per P186:
12
- # yes — observed: <evidence> (session-observed evidence the fix works)
13
- # no — not observed (fix released, no evidence yet; default)
14
- # no — observed regression (fix released, bug recurred)
15
- #
16
- # Hybrid coverage per ADR-005 + ADR-037 + ADR-052:
17
- # - Structural contract-assertions (Permitted Exception per ADR-005 /
18
- # contract-assertion pattern per ADR-037 — narrowly scoped to marker
19
- # presence per architect verdict): each render-block site carries the
20
- # canonical LIKELY-VERIFIED-CELL-SHAPE marker pointing to P186.
21
- # - Behavioural-shape assertions: each render site documents the three
22
- # canonical cell values + the age-based heuristic is NOT cited as
23
- # authority anywhere the marker fires.
24
- # - Drift-tripwire prose assertion: primary render sites (review-problems
25
- # + manage-problem) name P186 in the drift-re-opens contract per
26
- # P138 / P150 fix-shape precedent.
27
- #
28
- # @problem P186
29
- # @jtbd JTBD-001 (enforce governance without slowing down — evidence-grounded
30
- # closure decision rather than calendar proxy)
31
- # @jtbd JTBD-006 (progress backlog AFK — `observed: <evidence>` cell IS the
32
- # audit trail the AFK contract requires)
33
- #
34
- # Cross-reference:
35
- # P186: docs/problems/open/186-vq-likely-verified-column-uses-age-heuristic-not-evidence.md
36
- # P185: sibling proxy-for-evidence anti-pattern at capture-problem Step 1.5
37
- # P150: sibling fix shape — VQ-SORT-DIRECTION marker
38
- # P138: sibling fix shape — TIE-BREAK-LADDER-SOURCE marker
39
- # P048: introduced the Verification Queue + 14-day heuristic this ticket supersedes
40
- # ADR-022 — `.verifying.md` lifecycle; VQ rendering
41
- # ADR-026 — agent output grounding (evidence-citation discipline)
42
- # ADR-037 — contract-assertion bats pattern
43
- # ADR-052 — behavioural-tests default
44
-
45
- setup() {
46
- REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
47
- REVIEW_SKILL="$REPO_ROOT/packages/itil/skills/review-problems/SKILL.md"
48
- MANAGE_SKILL="$REPO_ROOT/packages/itil/skills/manage-problem/SKILL.md"
49
- LIST_SKILL="$REPO_ROOT/packages/itil/skills/list-problems/SKILL.md"
50
- TRANSITION_SKILL="$REPO_ROOT/packages/itil/skills/transition-problem/SKILL.md"
51
- TRANSITIONS_SKILL="$REPO_ROOT/packages/itil/skills/transition-problems/SKILL.md"
52
- RECONCILE_SKILL="$REPO_ROOT/packages/itil/skills/reconcile-readme/SKILL.md"
53
-
54
- MARKER='<!-- LIKELY-VERIFIED-CELL-SHAPE: evidence-based per P186 -->'
55
- }
56
-
57
- # ---------------------------------------------------------------------------
58
- # Marker presence at every render site (P138 / P150 fix-shape precedent)
59
- # ---------------------------------------------------------------------------
60
-
61
- @test "review-problems carries the LIKELY-VERIFIED-CELL-SHAPE marker" {
62
- run grep -F "$MARKER" "$REVIEW_SKILL"
63
- [ "$status" -eq 0 ]
64
- count=$(grep -c -F "$MARKER" "$REVIEW_SKILL")
65
- # review-problems is the primary owner — Step 3 presentation AND Step 5
66
- # README template both render the column.
67
- [ "$count" -ge 2 ]
68
- }
69
-
70
- @test "manage-problem carries the LIKELY-VERIFIED-CELL-SHAPE marker at every render site" {
71
- run grep -F "$MARKER" "$MANAGE_SKILL"
72
- [ "$status" -eq 0 ]
73
- count=$(grep -c -F "$MARKER" "$MANAGE_SKILL")
74
- # manage-problem renders the VQ at 4 sites: Step 5 P094, Step 7 P062,
75
- # Step 9c presentation, Step 9e README template. Marker must appear at
76
- # each — drift re-opens P186.
77
- [ "$count" -ge 4 ]
78
- }
79
-
80
- @test "list-problems VQ rendering carries the LIKELY-VERIFIED-CELL-SHAPE marker" {
81
- run grep -F "$MARKER" "$LIST_SKILL"
82
- [ "$status" -eq 0 ]
83
- }
84
-
85
- @test "transition-problem Step 7 README refresh carries the LIKELY-VERIFIED-CELL-SHAPE marker" {
86
- run grep -F "$MARKER" "$TRANSITION_SKILL"
87
- [ "$status" -eq 0 ]
88
- }
89
-
90
- @test "transition-problems batch render carries the LIKELY-VERIFIED-CELL-SHAPE marker" {
91
- run grep -F "$MARKER" "$TRANSITIONS_SKILL"
92
- [ "$status" -eq 0 ]
93
- }
94
-
95
- @test "reconcile-readme rendering carries the LIKELY-VERIFIED-CELL-SHAPE marker" {
96
- run grep -F "$MARKER" "$RECONCILE_SKILL"
97
- [ "$status" -eq 0 ]
98
- }
99
-
100
- # ---------------------------------------------------------------------------
101
- # Canonical cell values present at every render site
102
- # ---------------------------------------------------------------------------
103
-
104
- @test "review-problems documents all three canonical cell values" {
105
- run grep -F 'yes — observed:' "$REVIEW_SKILL"
106
- [ "$status" -eq 0 ]
107
- run grep -F 'no — not observed' "$REVIEW_SKILL"
108
- [ "$status" -eq 0 ]
109
- run grep -F 'no — observed regression' "$REVIEW_SKILL"
110
- [ "$status" -eq 0 ]
111
- }
112
-
113
- @test "manage-problem documents all three canonical cell values" {
114
- run grep -F 'yes — observed:' "$MANAGE_SKILL"
115
- [ "$status" -eq 0 ]
116
- run grep -F 'no — not observed' "$MANAGE_SKILL"
117
- [ "$status" -eq 0 ]
118
- run grep -F 'no — observed regression' "$MANAGE_SKILL"
119
- [ "$status" -eq 0 ]
120
- }
121
-
122
- @test "list-problems documents all three canonical cell values" {
123
- run grep -F 'yes — observed:' "$LIST_SKILL"
124
- [ "$status" -eq 0 ]
125
- run grep -F 'no — not observed' "$LIST_SKILL"
126
- [ "$status" -eq 0 ]
127
- run grep -F 'no — observed regression' "$LIST_SKILL"
128
- [ "$status" -eq 0 ]
129
- }
130
-
131
- # ---------------------------------------------------------------------------
132
- # Drift-tripwire prose at primary render sites (P138 / P150 precedent)
133
- # ---------------------------------------------------------------------------
134
-
135
- @test "review-problems names drift-re-opens-P186 contract" {
136
- run grep -F 'drift re-opens P186' "$REVIEW_SKILL"
137
- [ "$status" -eq 0 ]
138
- }
139
-
140
- @test "manage-problem names drift-re-opens-P186 contract" {
141
- # manage-problem hosts the drift-tripwire prose at Step 5 P094 AND Step 7
142
- # P062 — both render sites name P186 alongside the existing P138 / P150
143
- # contracts. List-problems / transition-problem(s) / reconcile-readme
144
- # carry the marker but defer the canonical drift contract to the primary
145
- # owners (manage-problem / review-problems) per the P138 + P150 precedent.
146
- run grep -F 'drift here re-opens P186' "$MANAGE_SKILL"
147
- [ "$status" -eq 0 ]
148
- count=$(grep -c -i 're-opens P186' "$MANAGE_SKILL")
149
- [ "$count" -ge 2 ]
150
- }
151
-
152
- # ---------------------------------------------------------------------------
153
- # Age-based heuristic must NOT survive as the authoritative cell rule
154
- # ---------------------------------------------------------------------------
155
-
156
- @test "review-problems no longer cites the 14-day heuristic as the cell rule" {
157
- # The P048 Candidate 4 "marks tickets ≥14 days old" phrasing was the
158
- # exact framing the user critique targeted. After P186, the cell shape
159
- # contract no longer references age as the authoritative trigger — age
160
- # is preserved separately via the `Released` column. The phrase may
161
- # survive in historical context (e.g. Related-section pointer back to
162
- # P048) but NOT as the live rendering rule.
163
- run grep -F 'marks tickets ≥14 days old' "$REVIEW_SKILL"
164
- [ "$status" -ne 0 ]
165
- }
166
-
167
- @test "manage-problem Step 9c no longer treats age as the cell trigger" {
168
- # Pre-P186 Step 9c documented `yes (N days)` and `no (N days)` as the
169
- # cell values keyed on a 14-day threshold. The new shape replaces both
170
- # with evidence-first values; the literal `yes (N days)` template must
171
- # not survive as a documented cell value (it can still appear in
172
- # historical narrative such as the README VQ rows pending re-render).
173
- run grep -F '`yes (N days)` — release age ≥ 14 days' "$MANAGE_SKILL"
174
- [ "$status" -ne 0 ]
175
- }
176
-
177
- # ---------------------------------------------------------------------------
178
- # Behavioural / template-shape — README template row carries the new shape
179
- # ---------------------------------------------------------------------------
180
-
181
- @test "review-problems Step 5 README template row uses the new cell-shape vocabulary" {
182
- # The template ROW (the `| P<NNN> | <title> | ... |` line below the
183
- # Verification Queue header) must reference the new vocabulary, not
184
- # the old `yes (N days) / no (N days)` placeholder.
185
- run grep -F 'yes — observed' "$REVIEW_SKILL"
186
- [ "$status" -eq 0 ]
187
- # Old placeholder gone
188
- run grep -F '<yes (N days) / no (N days)>' "$REVIEW_SKILL"
189
- [ "$status" -ne 0 ]
190
- }
191
-
192
- @test "list-problems Step 3 template row uses the new cell-shape vocabulary" {
193
- run grep -F 'yes — observed' "$LIST_SKILL"
194
- [ "$status" -eq 0 ]
195
- # Old placeholder gone from list-problems template
196
- run grep -F 'yes (N days) / no (N days)' "$LIST_SKILL"
197
- [ "$status" -ne 0 ]
198
- }
199
-
200
- # ---------------------------------------------------------------------------
201
- # Behavioural — produced README's VQ section uses the new cell vocabulary
202
- # ---------------------------------------------------------------------------
203
- #
204
- # Behavioural assertion per ADR-052: the actual rendered docs/problems/
205
- # README.md Verification Queue rows must use the new evidence-first cell
206
- # shape, not age-based markers. This is the user-visible artefact the
207
- # entire fix targets.
208
-
209
- @test "docs/problems/README.md VQ section contains the new evidence-first cell vocabulary" {
210
- README="$REPO_ROOT/docs/problems/README.md"
211
- [ -f "$README" ]
212
- # At least one row should carry the new vocabulary after the iter
213
- # re-renders the VQ section. Tests run after the iter's edits land.
214
- run grep -F 'no — not observed' "$README"
215
- [ "$status" -eq 0 ]
216
- }
217
-
218
- @test "docs/problems/README.md VQ section no longer uses bare age-marker cells like 'no (N days)' as the dominant rendering" {
219
- README="$REPO_ROOT/docs/problems/README.md"
220
- [ -f "$README" ]
221
- # Allow a small residual count for transitional rows or quoted prose,
222
- # but the bulk of the VQ table must have migrated to the new shape.
223
- # Concretely: count `no — not observed` occurrences and require they
224
- # exceed the count of bare `no (<digit>` age-marker cells. This is a
225
- # behavioural check — the rendered surface, not the SKILL.md template.
226
- new_shape_count=$(grep -c -F 'no — not observed' "$README" || true)
227
- old_shape_count=$(grep -cE '\| no \([0-9]+ days?\) \|' "$README" || true)
228
- [ "$new_shape_count" -gt "$old_shape_count" ]
229
- }
@@ -1,126 +0,0 @@
1
- #!/usr/bin/env bats
2
-
3
- # P065 / ADR-036 / ADR-037 Confirmation: scaffold-intake SKILL.md must
4
- # encode the contract documented in ADR-036's Decision Outcome.
5
- #
6
- # Doc-lint structural test (Permitted Exception per ADR-005 — structural
7
- # SKILL.md content checks, not behavioural). Mirrors the report-upstream
8
- # contract bats pattern and the ADR-037 "Source review (at implementation
9
- # time)" requirement that every shipped skill ships at least one
10
- # `<skill>-contract.bats`.
11
-
12
- setup() {
13
- REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
14
- SKILL_MD="$REPO_ROOT/packages/itil/skills/scaffold-intake/SKILL.md"
15
- TEMPLATE_DIR="$REPO_ROOT/packages/itil/skills/scaffold-intake/templates"
16
- }
17
-
18
- @test "scaffold-intake: SKILL.md exists" {
19
- [ -f "$SKILL_MD" ]
20
- }
21
-
22
- @test "scaffold-intake: SKILL.md frontmatter declares the skill name" {
23
- run grep -F 'name: wr-itil:scaffold-intake' "$SKILL_MD"
24
- [ "$status" -eq 0 ]
25
- }
26
-
27
- @test "scaffold-intake: SKILL.md cross-references ADR-036 (driver decision)" {
28
- run grep -F 'ADR-036' "$SKILL_MD"
29
- [ "$status" -eq 0 ]
30
- }
31
-
32
- @test "scaffold-intake: SKILL.md cites ADR-032 foreground-synchronous pattern" {
33
- run grep -F 'ADR-032' "$SKILL_MD"
34
- [ "$status" -eq 0 ]
35
- run grep -iE 'foreground.synchronous' "$SKILL_MD"
36
- [ "$status" -eq 0 ]
37
- }
38
-
39
- @test "scaffold-intake: SKILL.md contains an explicit Rule 6 audit section (ADR-032 + ADR-013 Rule 6)" {
40
- # ADR-032 line 191 requires every skill that uses AskUserQuestion to
41
- # carry an enumerable Rule 6 audit. ADR-036 lines 92-97 ship the table
42
- # shape.
43
- run grep -iE 'rule 6 audit|rule-6 audit' "$SKILL_MD"
44
- [ "$status" -eq 0 ]
45
- }
46
-
47
- @test "scaffold-intake: SKILL.md enumerates the three trigger surfaces (ADR-036)" {
48
- # Trigger 1: first-run prompt from manage-problem / work-problems.
49
- # Trigger 2: pre-publish PreToolUse gate (hard stop).
50
- # Trigger 3: optional CI check (deferred / --ci flag).
51
- run grep -iE 'trigger 1|first-run' "$SKILL_MD"
52
- [ "$status" -eq 0 ]
53
- run grep -iE 'trigger 2|pre-publish' "$SKILL_MD"
54
- [ "$status" -eq 0 ]
55
- run grep -iE 'trigger 3|ci check|--ci' "$SKILL_MD"
56
- [ "$status" -eq 0 ]
57
- }
58
-
59
- @test "scaffold-intake: SKILL.md cites the INTAKE_BYPASS env override (ADR-036)" {
60
- run grep -F 'INTAKE_BYPASS' "$SKILL_MD"
61
- [ "$status" -eq 0 ]
62
- }
63
-
64
- @test "scaffold-intake: SKILL.md cites both marker files (ADR-036 + ADR-009)" {
65
- run grep -F '.claude/.intake-scaffold-done' "$SKILL_MD"
66
- [ "$status" -eq 0 ]
67
- run grep -F '.claude/.intake-scaffold-declined' "$SKILL_MD"
68
- [ "$status" -eq 0 ]
69
- }
70
-
71
- @test "scaffold-intake: SKILL.md documents idempotent + --force semantics (ADR-036)" {
72
- run grep -iE 'idempotent' "$SKILL_MD"
73
- [ "$status" -eq 0 ]
74
- run grep -F -- '--force' "$SKILL_MD"
75
- [ "$status" -eq 0 ]
76
- run grep -F -- '--dry-run' "$SKILL_MD"
77
- [ "$status" -eq 0 ]
78
- }
79
-
80
- @test "scaffold-intake: SKILL.md enumerates the five required intake files (ADR-036 Detection 5)" {
81
- for path in 'config.yml' 'problem-report.yml' 'SECURITY.md' 'SUPPORT.md' 'CONTRIBUTING.md'; do
82
- run grep -F "$path" "$SKILL_MD"
83
- [ "$status" -eq 0 ] || { echo "missing reference: $path"; return 1; }
84
- done
85
- }
86
-
87
- @test "scaffold-intake: SKILL.md documents AFK fail-safe (no auto-scaffold) per JTBD-006" {
88
- # JTBD-006 + ADR-013 Rule 6: AFK orchestrator branch must NOT auto-write
89
- # template files. The skill documents this as a Rule 6 fail-safe.
90
- run grep -iE 'afk|rule 6' "$SKILL_MD"
91
- [ "$status" -eq 0 ]
92
- run grep -iE 'no auto.?scaffold|do not auto.?scaffold|silent note|pending.intake.scaffold' "$SKILL_MD"
93
- [ "$status" -eq 0 ]
94
- }
95
-
96
- @test "scaffold-intake: SKILL.md cites ADR-014 commit discipline" {
97
- run grep -F 'ADR-014' "$SKILL_MD"
98
- [ "$status" -eq 0 ]
99
- }
100
-
101
- # --- Templates directory ---
102
-
103
- @test "scaffold-intake: templates/ directory exists with five template seeds" {
104
- [ -d "$TEMPLATE_DIR" ]
105
- [ -f "$TEMPLATE_DIR/config.yml.tmpl" ]
106
- [ -f "$TEMPLATE_DIR/problem-report.yml.tmpl" ]
107
- [ -f "$TEMPLATE_DIR/SECURITY.md.tmpl" ]
108
- [ -f "$TEMPLATE_DIR/SUPPORT.md.tmpl" ]
109
- [ -f "$TEMPLATE_DIR/CONTRIBUTING.md.tmpl" ]
110
- }
111
-
112
- @test "scaffold-intake: problem-report.yml.tmpl is problem-first (P066 shape)" {
113
- run grep -F 'title: "[problem] "' "$TEMPLATE_DIR/problem-report.yml.tmpl"
114
- [ "$status" -eq 0 ]
115
- run grep -F 'labels: ["problem", "needs-triage"]' "$TEMPLATE_DIR/problem-report.yml.tmpl"
116
- [ "$status" -eq 0 ]
117
- }
118
-
119
- @test "scaffold-intake: templates use mustache-style substitution tokens (ADR-036)" {
120
- # ADR-036 declares the token list. Each token must appear in at least
121
- # one template file for the substitution surface to be wired.
122
- for token in '{{project_name}}' '{{project_url}}' '{{security_contact}}'; do
123
- run grep -rF "$token" "$TEMPLATE_DIR/"
124
- [ "$status" -eq 0 ] || { echo "missing token: $token"; return 1; }
125
- done
126
- }
@@ -1,164 +0,0 @@
1
- #!/usr/bin/env bats
2
-
3
- # P065 / ADR-036 Confirmation behavioural-replay 1+2:
4
- # Fixture-based behavioural test for scaffold-intake. Exercises the skill's
5
- # core write-and-substitute contract against a mock empty downstream repo.
6
- #
7
- # This is the behavioural counterpart to scaffold-intake-contract.bats.
8
- # It does NOT invoke the skill via Claude Code — it asserts the
9
- # contract by replaying the skill's documented bash steps:
10
- # 1. detect project name + url from package.json
11
- # 2. enumerate missing intake files
12
- # 3. write substituted templates to the correct paths
13
- # 4. mark .claude/.intake-scaffold-done
14
- # The bats reads templates/*.tmpl directly, applies the substitution rules
15
- # defined in ADR-036, and asserts on the resulting files.
16
- #
17
- # Per feedback_behavioural_tests.md (P081): asserts observable file-system
18
- # outcomes (files exist, content substituted, idempotent re-run no-ops),
19
- # not source content.
20
-
21
- setup() {
22
- REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
23
- TEMPLATE_DIR="$REPO_ROOT/packages/itil/skills/scaffold-intake/templates"
24
- ORIG_DIR="$PWD"
25
- TEST_DIR=$(mktemp -d)
26
- cd "$TEST_DIR"
27
-
28
- # Seed a minimal package.json so the skill's detection step has inputs.
29
- cat > package.json <<'JSON'
30
- {
31
- "name": "example-downstream",
32
- "repository": {
33
- "url": "https://github.com/example/downstream.git"
34
- }
35
- }
36
- JSON
37
- }
38
-
39
- teardown() {
40
- cd "$ORIG_DIR"
41
- rm -rf "$TEST_DIR"
42
- }
43
-
44
- # Helper: replay the skill's substitute-and-write step for one template.
45
- # This is the inline mustache-style substitution declared in ADR-036.
46
- scaffold_one() {
47
- local tmpl="$1"
48
- local out="$2"
49
- local project_name="example-downstream"
50
- local project_url="https://github.com/example/downstream"
51
- local security_contact="Use GitHub Security Advisories"
52
- local plugin_list="@windyroad/itil"
53
- local year="2026"
54
- mkdir -p "$(dirname "$out")"
55
- sed \
56
- -e "s|{{project_name}}|$project_name|g" \
57
- -e "s|{{project_url}}|$project_url|g" \
58
- -e "s|{{security_contact}}|$security_contact|g" \
59
- -e "s|{{plugin_list}}|$plugin_list|g" \
60
- -e "s|{{year}}|$year|g" \
61
- "$TEMPLATE_DIR/$tmpl" > "$out"
62
- }
63
-
64
- scaffold_all() {
65
- scaffold_one "config.yml.tmpl" ".github/ISSUE_TEMPLATE/config.yml"
66
- scaffold_one "problem-report.yml.tmpl" ".github/ISSUE_TEMPLATE/problem-report.yml"
67
- scaffold_one "SECURITY.md.tmpl" "SECURITY.md"
68
- scaffold_one "SUPPORT.md.tmpl" "SUPPORT.md"
69
- scaffold_one "CONTRIBUTING.md.tmpl" "CONTRIBUTING.md"
70
- mkdir -p .claude
71
- : > .claude/.intake-scaffold-done
72
- }
73
-
74
- # --- Empty repo: scaffold writes all five files ---
75
-
76
- @test "fixture: empty repo gains all five intake files" {
77
- scaffold_all
78
- [ -f .github/ISSUE_TEMPLATE/config.yml ]
79
- [ -f .github/ISSUE_TEMPLATE/problem-report.yml ]
80
- [ -f SECURITY.md ]
81
- [ -f SUPPORT.md ]
82
- [ -f CONTRIBUTING.md ]
83
- }
84
-
85
- @test "fixture: substitution tokens are resolved (no raw {{...}} left in scaffolded files)" {
86
- scaffold_all
87
- for f in \
88
- .github/ISSUE_TEMPLATE/config.yml \
89
- .github/ISSUE_TEMPLATE/problem-report.yml \
90
- SECURITY.md \
91
- SUPPORT.md \
92
- CONTRIBUTING.md; do
93
- run grep -F '{{' "$f"
94
- [ "$status" -ne 0 ] || { echo "raw mustache token left in $f"; return 1; }
95
- done
96
- }
97
-
98
- @test "fixture: project_name substitution propagated into scaffolded SECURITY.md or CONTRIBUTING.md" {
99
- scaffold_all
100
- # The project name should appear at least once in either SECURITY.md or
101
- # CONTRIBUTING.md; the exact placement is template-dependent but
102
- # ABSENCE from both files would indicate a substitution miss.
103
- run bash -c "grep -F 'example-downstream' SECURITY.md SUPPORT.md CONTRIBUTING.md"
104
- [ "$status" -eq 0 ]
105
- }
106
-
107
- @test "fixture: scaffolded problem-report.yml retains problem-first shape (P066)" {
108
- scaffold_all
109
- run grep -F 'title: "[problem] "' .github/ISSUE_TEMPLATE/problem-report.yml
110
- [ "$status" -eq 0 ]
111
- run grep -F 'labels: ["problem", "needs-triage"]' .github/ISSUE_TEMPLATE/problem-report.yml
112
- [ "$status" -eq 0 ]
113
- }
114
-
115
- @test "fixture: done marker written after successful scaffold" {
116
- scaffold_all
117
- [ -f .claude/.intake-scaffold-done ]
118
- }
119
-
120
- # --- Idempotency: re-scaffolding produces no diff ---
121
-
122
- @test "fixture: full re-application is idempotent (no diff)" {
123
- scaffold_all
124
- # Snapshot into a sibling temp dir — NOT inside $TEST_DIR. GNU cp refuses
125
- # `cp -R . dest` when dest is a child of source ("cannot copy a directory
126
- # into itself"), so the test fails on Linux CI even though macOS BSD cp
127
- # tolerates it. Putting the snapshot outside $TEST_DIR removes the platform
128
- # divergence (P127).
129
- SNAPSHOT_DIR=$(mktemp -d)
130
- cp -R "$TEST_DIR/." "$SNAPSHOT_DIR"
131
- # Re-apply.
132
- scaffold_all
133
- # Diff against snapshot.
134
- run diff -ru "$SNAPSHOT_DIR" "$TEST_DIR"
135
- rm -rf "$SNAPSHOT_DIR"
136
- # diff exit 0 means no differences.
137
- [ "$status" -eq 0 ]
138
- }
139
-
140
- # --- Partial repo: pre-existing CONTRIBUTING.md is preserved ---
141
-
142
- @test "fixture: pre-existing CONTRIBUTING.md is preserved (idempotent skip)" {
143
- echo "# Custom Contributing" > CONTRIBUTING.md
144
- echo "Custom adopter content; must not be overwritten by scaffold." >> CONTRIBUTING.md
145
- ORIGINAL=$(cat CONTRIBUTING.md)
146
-
147
- # Scaffold the OTHER four files (skill skips the existing one).
148
- scaffold_one "config.yml.tmpl" ".github/ISSUE_TEMPLATE/config.yml"
149
- scaffold_one "problem-report.yml.tmpl" ".github/ISSUE_TEMPLATE/problem-report.yml"
150
- scaffold_one "SECURITY.md.tmpl" "SECURITY.md"
151
- scaffold_one "SUPPORT.md.tmpl" "SUPPORT.md"
152
- # Deliberately do NOT call scaffold_one for CONTRIBUTING.md — that's
153
- # the skill's idempotent skip behaviour for present files.
154
-
155
- # Other files were created.
156
- [ -f .github/ISSUE_TEMPLATE/config.yml ]
157
- [ -f .github/ISSUE_TEMPLATE/problem-report.yml ]
158
- [ -f SECURITY.md ]
159
- [ -f SUPPORT.md ]
160
-
161
- # CONTRIBUTING.md unchanged.
162
- AFTER=$(cat CONTRIBUTING.md)
163
- [ "$ORIGINAL" = "$AFTER" ]
164
- }
@@ -1,87 +0,0 @@
1
- #!/usr/bin/env bats
2
-
3
- # P065 / ADR-036 / ADR-037 Confirmation: scaffold-intake's templates and
4
- # SKILL.md must not leak absolute paths, host-specific identifiers, or
5
- # secrets that would compromise downstream adopters who scaffold from
6
- # them.
7
- #
8
- # Sentinel test: per ADR-037 "Source review", every skill that emits
9
- # user-substituted content ships a `<skill>-secrets-absent.bats` to
10
- # catch hardcoded environment leakage at PR time.
11
-
12
- setup() {
13
- REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
14
- TEMPLATE_DIR="$REPO_ROOT/packages/itil/skills/scaffold-intake/templates"
15
- SKILL_MD="$REPO_ROOT/packages/itil/skills/scaffold-intake/SKILL.md"
16
- }
17
-
18
- # --- Templates: no absolute paths from the author's environment ---
19
-
20
- @test "secrets-absent: templates contain no /Users/ or /home/ absolute paths" {
21
- run grep -rE '/Users/[a-zA-Z0-9_-]+/' "$TEMPLATE_DIR/"
22
- [ "$status" -ne 0 ]
23
- run grep -rE '/home/[a-zA-Z0-9_-]+/' "$TEMPLATE_DIR/"
24
- [ "$status" -ne 0 ]
25
- }
26
-
27
- @test "secrets-absent: templates contain no Windows-style absolute paths" {
28
- run grep -rE '[A-Z]:\\Users\\' "$TEMPLATE_DIR/"
29
- [ "$status" -ne 0 ]
30
- }
31
-
32
- # --- Templates: no obvious credential shapes ---
33
-
34
- @test "secrets-absent: templates contain no credential-shaped tokens (AKIA, ghp_, sk_, github_pat_)" {
35
- run grep -rE 'AKIA[0-9A-Z]{16}|ghp_[A-Za-z0-9]{36}|github_pat_[A-Za-z0-9_]{80,}|sk_(live|test)_[A-Za-z0-9]{24,}' "$TEMPLATE_DIR/"
36
- [ "$status" -ne 0 ]
37
- }
38
-
39
- @test "secrets-absent: templates contain no aws_access or aws_secret keys in plain text" {
40
- run grep -rEi 'aws_access_key_id|aws_secret_access_key' "$TEMPLATE_DIR/"
41
- [ "$status" -ne 0 ]
42
- }
43
-
44
- # --- Templates: name-of-this-repo must be substituted, not hardcoded ---
45
-
46
- @test "secrets-absent: templates do not hardcode 'windyroad/agent-plugins' (must use {{project_url}}/{{project_name}} substitution)" {
47
- # The author repo is windyroad/agent-plugins; downstream-scaffolded
48
- # files must use the per-project substitution token, not the literal
49
- # author repo. Otherwise downstream adopters get our SECURITY.md
50
- # advisory URL pointing to OUR security advisories, which is wrong.
51
- #
52
- # Allow it ONLY in commentary lines that explain "templated from this
53
- # repo's intake".
54
- run grep -rl 'windyroad/agent-plugins' "$TEMPLATE_DIR/"
55
- if [ "$status" -eq 0 ]; then
56
- # Anything found must be inside a comment explicitly framing it as
57
- # an example. Fail otherwise.
58
- while read -r f; do
59
- run grep -nE 'windyroad/agent-plugins' "$f"
60
- while read -r line; do
61
- line_no="${line%%:*}"
62
- line_text="${line#*:}"
63
- # Allow only if line begins with a comment marker (#) AND mentions example/seed.
64
- if echo "$line_text" | grep -qE '^[[:space:]]*#' && echo "$line_text" | grep -qiE 'example|seed|template|reference'; then
65
- continue
66
- fi
67
- echo "hardcoded windyroad/agent-plugins reference at $f:$line_no"
68
- echo " $line_text"
69
- return 1
70
- done <<< "$output"
71
- done < <(grep -rl 'windyroad/agent-plugins' "$TEMPLATE_DIR/")
72
- fi
73
- }
74
-
75
- # --- SKILL.md: no transcript-leak shapes ---
76
-
77
- @test "secrets-absent: SKILL.md contains no /Users/ or /home/ absolute paths" {
78
- run grep -E '/Users/[a-zA-Z0-9_-]+/' "$SKILL_MD"
79
- [ "$status" -ne 0 ]
80
- run grep -E '/home/[a-zA-Z0-9_-]+/' "$SKILL_MD"
81
- [ "$status" -ne 0 ]
82
- }
83
-
84
- @test "secrets-absent: SKILL.md contains no credential-shaped tokens" {
85
- run grep -E 'AKIA[0-9A-Z]{16}|ghp_[A-Za-z0-9]{36}|github_pat_[A-Za-z0-9_]{80,}' "$SKILL_MD"
86
- [ "$status" -ne 0 ]
87
- }