@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,80 +0,0 @@
1
- #!/usr/bin/env bats
2
-
3
- # P170 / Phase 2 Slice 2b — sanity bats for the 3 sibling helpers
4
- # (update-rfc-references-section.sh, update-jtbd-references-section.sh,
5
- # update-story-references-section.sh). Behavioural coverage of the
6
- # polymorphism is asserted by the comprehensive Slice 2a bats fixture
7
- # at update-problem-references-section.bats; this fixture asserts
8
- # existence + executable + arg-validation + structural no-branching
9
- # guard for the 3 siblings, deferring full behavioural coverage to
10
- # follow-on slice when the siblings are wired into consumer skills.
11
-
12
- setup() {
13
- REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../.." && pwd)"
14
- RFC_HELPER="$REPO_ROOT/packages/itil/scripts/update-rfc-references-section.sh"
15
- JTBD_HELPER="$REPO_ROOT/packages/itil/scripts/update-jtbd-references-section.sh"
16
- STORY_HELPER="$REPO_ROOT/packages/itil/scripts/update-story-references-section.sh"
17
- }
18
-
19
- @test "rfc-helper: exists and is executable" {
20
- [ -x "$RFC_HELPER" ]
21
- }
22
-
23
- @test "rfc-helper: requires rfc-file arg" {
24
- run bash "$RFC_HELPER"
25
- [ "$status" -ne 0 ]
26
- }
27
-
28
- @test "rfc-helper: requires section-name arg" {
29
- local tmp
30
- tmp="$(mktemp)"
31
- run bash "$RFC_HELPER" "$tmp"
32
- [ "$status" -ne 0 ]
33
- rm -f "$tmp"
34
- }
35
-
36
- @test "rfc-helper: body has no per-section-name branch" {
37
- ! grep -E 'case[[:space:]]+"\$\{?section[_-]?name\}?"|if[[:space:]]+\[[[:space:]]+"\$\{?section[_-]?name\}?"[[:space:]]+=' "$RFC_HELPER"
38
- }
39
-
40
- @test "jtbd-helper: exists and is executable" {
41
- [ -x "$JTBD_HELPER" ]
42
- }
43
-
44
- @test "jtbd-helper: requires jtbd-file arg" {
45
- run bash "$JTBD_HELPER"
46
- [ "$status" -ne 0 ]
47
- }
48
-
49
- @test "jtbd-helper: requires section-name arg" {
50
- local tmp
51
- tmp="$(mktemp)"
52
- run bash "$JTBD_HELPER" "$tmp"
53
- [ "$status" -ne 0 ]
54
- rm -f "$tmp"
55
- }
56
-
57
- @test "jtbd-helper: body has no per-section-name branch" {
58
- ! grep -E 'case[[:space:]]+"\$\{?section[_-]?name\}?"|if[[:space:]]+\[[[:space:]]+"\$\{?section[_-]?name\}?"[[:space:]]+=' "$JTBD_HELPER"
59
- }
60
-
61
- @test "story-helper: exists and is executable" {
62
- [ -x "$STORY_HELPER" ]
63
- }
64
-
65
- @test "story-helper: requires story-file arg" {
66
- run bash "$STORY_HELPER"
67
- [ "$status" -ne 0 ]
68
- }
69
-
70
- @test "story-helper: requires section-name arg" {
71
- local tmp
72
- tmp="$(mktemp)"
73
- run bash "$STORY_HELPER" "$tmp"
74
- [ "$status" -ne 0 ]
75
- rm -f "$tmp"
76
- }
77
-
78
- @test "story-helper: body has no per-section-name branch" {
79
- ! grep -E 'case[[:space:]]+"\$\{?section[_-]?name\}?"|if[[:space:]]+\[[[:space:]]+"\$\{?section[_-]?name\}?"[[:space:]]+=' "$STORY_HELPER"
80
- }
@@ -1,77 +0,0 @@
1
- #!/usr/bin/env bats
2
-
3
- # P378/RFC-030 Piece 1 (ADR-085): update-rfc-commits-section.sh renders the RFC
4
- # `## Commits` section as a derived view from `git log --grep "Refs: RFC-NNN"`.
5
- # Behavioural — exercises the renderer against a throwaway git repo.
6
-
7
- setup() {
8
- REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../.." && pwd)"
9
- HELPER="$REPO_ROOT/packages/itil/scripts/update-rfc-commits-section.sh"
10
- DIR="$(mktemp -d)"
11
- cd "$DIR"
12
- git init -q
13
- git config user.email t@e.x; git config user.name t
14
- mkdir -p docs/rfcs
15
- cat > docs/rfcs/RFC-201-thing.proposed.md <<'EOF'
16
- # RFC-201: thing
17
-
18
- ## Commits
19
-
20
- (placeholder)
21
-
22
- ## Related
23
-
24
- x
25
- EOF
26
- git add -A && git commit -qm "chore: seed"
27
- }
28
- teardown() { cd /; rm -rf "$DIR"; }
29
-
30
- @test "renders commits carrying the Refs: RFC-NNN trailer, newest first" {
31
- echo a > a; git add a; git commit -qm "$(printf 'feat: a\n\nRefs: RFC-201')"
32
- echo b > b; git add b; git commit -qm "$(printf 'fix: b\n\nRefs: RFC-201')"
33
- run bash "$HELPER" docs/rfcs/RFC-201-thing.proposed.md
34
- [ "$status" -eq 0 ]
35
- run sed -n '/## Commits/,/## Related/p' docs/rfcs/RFC-201-thing.proposed.md
36
- [[ "$output" == *"fix: b"* ]]
37
- [[ "$output" == *"feat: a"* ]]
38
- # newest first: fix: b appears before feat: a
39
- [[ "$output" == *"fix: b"*"feat: a"* ]]
40
- # placeholder body is gone
41
- [[ "$output" != *"(placeholder)"* ]]
42
- }
43
-
44
- @test "does NOT include commits without the trailer" {
45
- echo a > a; git add a; git commit -qm "$(printf 'feat: tagged\n\nRefs: RFC-201')"
46
- echo b > b; git add b; git commit -qm "chore: untagged"
47
- run bash "$HELPER" docs/rfcs/RFC-201-thing.proposed.md
48
- run sed -n '/## Commits/,/## Related/p' docs/rfcs/RFC-201-thing.proposed.md
49
- [[ "$output" == *"feat: tagged"* ]]
50
- [[ "$output" != *"chore: untagged"* ]]
51
- }
52
-
53
- @test "no trailer-bearing commits → renders a self-describing placeholder, not a false claim" {
54
- run bash "$HELPER" docs/rfcs/RFC-201-thing.proposed.md
55
- [ "$status" -eq 0 ]
56
- run sed -n '/## Commits/,/## Related/p' docs/rfcs/RFC-201-thing.proposed.md
57
- [[ "$output" == *"rendered from"* ]] && [[ "$output" == *"git log"* ]]
58
- [[ "$output" != *"maintained automatically"* ]]
59
- }
60
-
61
- @test "idempotent — second render is a byte-stable no-op" {
62
- echo a > a; git add a; git commit -qm "$(printf 'feat: a\n\nRefs: RFC-201')"
63
- bash "$HELPER" docs/rfcs/RFC-201-thing.proposed.md
64
- h1=$(shasum docs/rfcs/RFC-201-thing.proposed.md | cut -d' ' -f1)
65
- bash "$HELPER" docs/rfcs/RFC-201-thing.proposed.md
66
- h2=$(shasum docs/rfcs/RFC-201-thing.proposed.md | cut -d' ' -f1)
67
- [ "$h1" = "$h2" ]
68
- }
69
-
70
- @test "preserves sections after ## Commits (## Related survives)" {
71
- echo a > a; git add a; git commit -qm "$(printf 'feat: a\n\nRefs: RFC-201')"
72
- bash "$HELPER" docs/rfcs/RFC-201-thing.proposed.md
73
- run grep -c "## Related" docs/rfcs/RFC-201-thing.proposed.md
74
- [ "$output" -eq 1 ]
75
- run grep -c "^x$" docs/rfcs/RFC-201-thing.proposed.md
76
- [ "$output" -eq 1 ]
77
- }
@@ -1,196 +0,0 @@
1
- #!/usr/bin/env bats
2
-
3
- # @problem P335 — AFK iter subprocess over-claims completion in
4
- # ITERATION_SUMMARY notes / commit message while on-disk Confirmation
5
- # checkboxes remain `[ ]`. Step 6.75 currently runs `git status --porcelain`
6
- # only — catches commit-didn't-land but not commit-landed-with-false-claim.
7
- # This verifier closes the gap.
8
- #
9
- # Contract: `verify-iter-summary.sh` (or PATH shim
10
- # `wr-itil-verify-iter-summary`) reads:
11
- # $1 = commit_sha (the iter's landed commit)
12
- # $2 = path to a file containing the ITERATION_SUMMARY notes field
13
- # $3 = repo root (optional; defaults to `git rev-parse --show-toplevel`)
14
- #
15
- # Mechanism:
16
- # 1. Extract `ADR-NNN` identifiers from the commit message
17
- # (`git log -1 --format=%B <sha>`) AND the notes file.
18
- # 2. For each identifier, resolve to `docs/decisions/<NNN>-*.md` (any
19
- # status suffix — `.proposed.md` / `.accepted.md` / etc).
20
- # 3. Detect completion-claim signal in commit message OR notes (regex
21
- # family: `all .*(green|complete|done|checked|ticked)`,
22
- # `\([a-z]\)\s*[-–]\s*\([a-z]\)\s+(green|complete|all)`,
23
- # `all\s+Confirmation\s+items`).
24
- # 4. When signal present AND any `- [ ]` item exists in the cited ADR's
25
- # `## Confirmation` section → emit `OVER-CLAIM:` line and exit 1.
26
- # 5. Otherwise exit 0.
27
- #
28
- # Exit codes:
29
- # 0 = OK (no signal, or signal-and-all-items-checked, or no ADR referenced)
30
- # 1 = OVER-CLAIM detected
31
- # 2 = invocation error (missing args, bad sha, etc)
32
- #
33
- # @adr ADR-032 (subprocess-boundary trust contract — orchestrator decides
34
- # trust boundary; verifier is the policy-authorised silent check)
35
- # @adr ADR-049 (Plugin-bundled scripts ship as bin/ PATH shims;
36
- # wr-itil-verify-iter-summary is the shim name)
37
- # @adr ADR-052 (Behavioural tests for skill testing; this bats covers
38
- # the OVER-CLAIM detection behaviour, not script structure)
39
- # @jtbd JTBD-006 (Progress the Backlog While I'm Away — orchestrator-side
40
- # verification keeps AFK loop integrity intact when iter
41
- # self-certification fails)
42
-
43
- setup() {
44
- SCRIPTS_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
45
- SCRIPT="$SCRIPTS_DIR/verify-iter-summary.sh"
46
- FIXTURE_DIR="$(mktemp -d)"
47
- cd "$FIXTURE_DIR"
48
- git init -q
49
- git config user.email test@example.com
50
- git config user.name "Test"
51
- mkdir -p docs/decisions
52
- }
53
-
54
- teardown() {
55
- cd /
56
- rm -rf "$FIXTURE_DIR"
57
- }
58
-
59
- # Helper: create a fake ADR with the given Confirmation-section body.
60
- _make_adr() {
61
- local num="$1" status="$2" confirmation_body="$3"
62
- cat > "docs/decisions/${num}-fake-adr.${status}.md" <<EOF
63
- # ${num}. Fake ADR
64
-
65
- ## Status
66
- ${status}
67
-
68
- ## Confirmation
69
- ${confirmation_body}
70
- EOF
71
- }
72
-
73
- # Helper: commit a file with the given message; return the SHA via stdout.
74
- _commit_with_message() {
75
- local message="$1"
76
- echo "dummy" > dummy.txt
77
- git add dummy.txt
78
- git commit -q -m "$message"
79
- git log -1 --format=%H
80
- }
81
-
82
- # ── Existence + executable ──────────────────────────────────────────────────
83
-
84
- @test "verify-iter-summary: script exists" {
85
- [ -f "$SCRIPT" ]
86
- }
87
-
88
- @test "verify-iter-summary: script is executable" {
89
- [ -x "$SCRIPT" ]
90
- }
91
-
92
- # ── Exit 0: no completion-claim signal ──────────────────────────────────────
93
-
94
- @test "verify-iter-summary: notes mention ADR but no completion-claim signal → OK" {
95
- _make_adr 077 proposed "- [ ] **(a) Item A**
96
- - [ ] **(b) Item B**"
97
- local sha; sha=$(_commit_with_message "feat(architect): ADR-077 Slice 1 partial work")
98
- echo "P327 progressed; partial slice landed; further work needed for Confirmation items (a)+(b)." > notes.txt
99
-
100
- run "$SCRIPT" "$sha" notes.txt "$FIXTURE_DIR"
101
- [ "$status" -eq 0 ]
102
- }
103
-
104
- @test "verify-iter-summary: no ADR referenced at all → OK" {
105
- local sha; sha=$(_commit_with_message "fix(itil): rename helper variable")
106
- echo "Bugfix; no governance impact." > notes.txt
107
-
108
- run "$SCRIPT" "$sha" notes.txt "$FIXTURE_DIR"
109
- [ "$status" -eq 0 ]
110
- }
111
-
112
- # ── Exit 0: signal present but all items checked ────────────────────────────
113
-
114
- @test "verify-iter-summary: completion-claim signal AND all items checked → OK" {
115
- _make_adr 077 proposed "- [x] **(a) Item A**
116
- - [x] **(b) Item B**"
117
- local sha; sha=$(_commit_with_message "feat(architect): ADR-077 — all Confirmation items complete")
118
- echo "All ADR-077 Confirmation items green." > notes.txt
119
-
120
- run "$SCRIPT" "$sha" notes.txt "$FIXTURE_DIR"
121
- [ "$status" -eq 0 ]
122
- }
123
-
124
- # ── Exit 1: P335 witness shape — claim "all green" + unchecked items ────────
125
-
126
- @test "verify-iter-summary: claim 'all green at source' + unchecked items → OVER-CLAIM" {
127
- # The P335 session 8 iter 1 witness shape: commit message claims (a)–(j)
128
- # green; all 10 boxes are `[ ]`.
129
- _make_adr 077 proposed "- [ ] **(a) Agent prompt amendment**
130
- - [ ] **(b) Generator script**
131
- - [ ] **(c) Initial compendium**
132
- - [ ] **(d) create-adr integration**
133
- - [ ] **(e) capture-adr integration**
134
- - [ ] **(f) review-decisions integration**
135
- - [ ] **(g) CI drift bats**
136
- - [ ] **(h) Pre-commit hook**
137
- - [ ] **(i) ADR-031 assertion**
138
- - [ ] **(j) No silent regression**"
139
- local sha; sha=$(_commit_with_message "feat(architect): ADR-077 Slice 3 — all (a)-(j) green at source")
140
- echo "ADR-077 Slice 3 — Confirmation items (a)-(j) all green at source." > notes.txt
141
-
142
- run "$SCRIPT" "$sha" notes.txt "$FIXTURE_DIR"
143
- [ "$status" -eq 1 ]
144
- echo "$output" | grep -q "OVER-CLAIM"
145
- echo "$output" | grep -q "ADR-077"
146
- }
147
-
148
- @test "verify-iter-summary: claim 'all Confirmation items complete' + unchecked → OVER-CLAIM" {
149
- _make_adr 100 accepted "- [x] **(a) Done**
150
- - [ ] **(b) Still pending**"
151
- local sha; sha=$(_commit_with_message "feat: ADR-100 — all Confirmation items complete")
152
- echo "Implementation finished." > notes.txt
153
-
154
- run "$SCRIPT" "$sha" notes.txt "$FIXTURE_DIR"
155
- [ "$status" -eq 1 ]
156
- echo "$output" | grep -q "OVER-CLAIM"
157
- }
158
-
159
- @test "verify-iter-summary: signal only in notes (not commit msg) + unchecked → OVER-CLAIM" {
160
- _make_adr 200 proposed "- [ ] **(a) Missing**"
161
- local sha; sha=$(_commit_with_message "feat: ADR-200 progress")
162
- # Note completion signal lives in notes, not the commit subject.
163
- echo "All Confirmation items ticked for ADR-200." > notes.txt
164
-
165
- run "$SCRIPT" "$sha" notes.txt "$FIXTURE_DIR"
166
- [ "$status" -eq 1 ]
167
- echo "$output" | grep -q "OVER-CLAIM"
168
- echo "$output" | grep -q "ADR-200"
169
- }
170
-
171
- # ── Invocation errors ───────────────────────────────────────────────────────
172
-
173
- @test "verify-iter-summary: missing notes file → invocation error" {
174
- local sha; sha=$(_commit_with_message "init")
175
- run "$SCRIPT" "$sha" /nonexistent/notes.txt "$FIXTURE_DIR"
176
- [ "$status" -eq 2 ]
177
- }
178
-
179
- @test "verify-iter-summary: missing sha → invocation error" {
180
- echo "" > notes.txt
181
- run "$SCRIPT" "" notes.txt "$FIXTURE_DIR"
182
- [ "$status" -eq 2 ]
183
- }
184
-
185
- # ── Multi-ADR case ──────────────────────────────────────────────────────────
186
-
187
- @test "verify-iter-summary: two ADRs cited — one clean, one over-claim → OVER-CLAIM only on the bad one" {
188
- _make_adr 050 accepted "- [x] **(a) Clean**"
189
- _make_adr 060 proposed "- [ ] **(a) Dirty**"
190
- local sha; sha=$(_commit_with_message "feat: ADR-050 + ADR-060 — all green")
191
- echo "Both ADRs progressed; all items green." > notes.txt
192
-
193
- run "$SCRIPT" "$sha" notes.txt "$FIXTURE_DIR"
194
- [ "$status" -eq 1 ]
195
- echo "$output" | grep -q "ADR-060"
196
- }
@@ -1,116 +0,0 @@
1
- #!/usr/bin/env bats
2
- # Behavioural fixtures for the Phase 2 working-the-problem traversal
3
- # rewrite (P170 Phase 2 Slice 13 — ADR-060 lines 300-320).
4
- #
5
- # Per ADR-052: behavioural assertions on observable artefact + skill
6
- # contract state. The load-bearing surfaces under test are:
7
- # 1. manage-problem § Working a Problem → Known Error subsection names
8
- # the four traversal steps (Fix Strategy → RFCs → stories: array →
9
- # pick first not-done) + the two fallback paths (atomic-RFC empty
10
- # stories: [], legacy no-RFC Fix Strategy).
11
- # 2. work-problem § Step 3 Known Error case names the same traversal
12
- # and forward-points to manage-problem as the contract owner.
13
- # 3. The single-trailer vocabulary holds — `Refs: STORY-NNN` for
14
- # story-decomposed work, `Refs: RFC-NNN` for atomic-RFC fallback,
15
- # `Refs: P<NNN>` for legacy direct work (single trailer verb per
16
- # ADR-060 line 307).
17
- # 4. Story auto-transition triggers are named: draft → in-progress
18
- # on first non-capture commit; in-progress → done on
19
- # all-criteria-ticked + linked RFC closed.
20
- #
21
- # @problem P170
22
- # @jtbd JTBD-008 (Decompose a Fix Into Coordinated Changes — traversal
23
- # operationalises the "first-class entity" Desired
24
- # Outcome at implementation time)
25
- # @jtbd JTBD-101 (atomic-fix-adopter friction guard — empty stories: []
26
- # falls back to per-RFC dispatch without friction)
27
- # @adr ADR-060 (Problem-RFC-Story framework — working-the-problem
28
- # flow lines 300-320 + amendment 2026-05-10 nitpick N2
29
- # single-trailer vocabulary)
30
- # @adr ADR-052 (Behavioural-tests-default)
31
-
32
- setup() {
33
- REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../.." && pwd)"
34
- MANAGE_PROBLEM="${REPO_ROOT}/packages/itil/skills/manage-problem/SKILL.md"
35
- WORK_PROBLEM="${REPO_ROOT}/packages/itil/skills/work-problem/SKILL.md"
36
- }
37
-
38
- # ---------------------------------------------------------------------------
39
- # Surface 1: manage-problem § Working a Problem → Known Error names the
40
- # 4-step traversal (Fix Strategy → RFCs → stories: → pick first not-done)
41
- # ---------------------------------------------------------------------------
42
-
43
- @test "traversal: manage-problem names the Fix Strategy section extraction step" {
44
- run grep -E 'Read the problem.*\#\# Fix Strategy.*RFC' "$MANAGE_PROBLEM"
45
- [ "$status" -eq 0 ]
46
- }
47
-
48
- @test "traversal: manage-problem names the RFC frontmatter stories: array read step" {
49
- run grep -E 'frontmatter stories:.*ORDERED|stories:.*array.*execution sequence' "$MANAGE_PROBLEM"
50
- [ "$status" -eq 0 ]
51
- }
52
-
53
- @test "traversal: manage-problem names the pick-first-not-done filter (accepted or in-progress)" {
54
- run grep -E 'accepted.*in-progress.*done.*draft|first story whose.*status is.*accepted' "$MANAGE_PROBLEM"
55
- [ "$status" -eq 0 ]
56
- }
57
-
58
- # ---------------------------------------------------------------------------
59
- # Surface 2: manage-problem — empty stories: [] is a legacy/back-fill state,
60
- # NOT a legitimate atomic fallback (ADR-089: every RFC has >=1 story). The old
61
- # JTBD-101-friction-guard atomic-RFC-empty-stories fallback is removed; the
62
- # legacy no-RFC direct-implementation fallback (a distinct path) stays.
63
- # ---------------------------------------------------------------------------
64
-
65
- @test "traversal: manage-problem treats empty stories: [] as legacy/back-fill, not a legitimate atomic fallback (ADR-089)" {
66
- # Positive: the ADR-089 model (>=1 story; back-fill the legacy empty-stories RFC) is named.
67
- run grep -iE 'ADR-089|back-fill' "$MANAGE_PROBLEM"
68
- [ "$status" -eq 0 ]
69
- # Negative: the old atomic-RFC empty-stories fallback legitimation is gone.
70
- run grep -iE 'atomic-RFC fallback|atomic RFC.*JTBD-101.*friction guard' "$MANAGE_PROBLEM"
71
- [ "$status" -ne 0 ]
72
- }
73
-
74
- @test "traversal: manage-problem names the legacy no-RFC direct-implementation fallback" {
75
- run grep -iE 'legacy direct-implementation|no-RFC.*legacy|no RFCs.*direct' "$MANAGE_PROBLEM"
76
- [ "$status" -eq 0 ]
77
- }
78
-
79
- # ---------------------------------------------------------------------------
80
- # Surface 3: work-problem § Step 3 Known Error case forwards to manage-problem
81
- # ---------------------------------------------------------------------------
82
-
83
- @test "traversal: work-problem Step 3 Known Error case names the traversal chain" {
84
- # The traversal description must include all four chain elements:
85
- # Fix Strategy, RFCs, stories: array, pick first not-done.
86
- run grep -iE 'Fix Strategy.*stories:.*pick first|traverse.*Fix Strategy.*RFC.*stories' "$WORK_PROBLEM"
87
- [ "$status" -eq 0 ]
88
- }
89
-
90
- # ---------------------------------------------------------------------------
91
- # Surface 4: Single-trailer vocabulary (per ADR-060 line 307 + N2 amendment)
92
- # ---------------------------------------------------------------------------
93
-
94
- @test "traversal: manage-problem names Refs: STORY-NNN trailer for story-decomposed work" {
95
- run grep -E 'Refs: STORY-' "$MANAGE_PROBLEM"
96
- [ "$status" -eq 0 ]
97
- }
98
-
99
- @test "traversal: manage-problem names Refs: RFC-NNN trailer for cross-cutting RFC work (no single story)" {
100
- run grep -E 'Refs: RFC-' "$MANAGE_PROBLEM"
101
- [ "$status" -eq 0 ]
102
- }
103
-
104
- # ---------------------------------------------------------------------------
105
- # Surface 5: Story auto-transition triggers
106
- # ---------------------------------------------------------------------------
107
-
108
- @test "traversal: manage-problem names the story draft → in-progress auto-transition trigger" {
109
- run grep -iE 'draft.*in-progress.*first.*commit|auto-transitions.*draft.*in-progress' "$MANAGE_PROBLEM"
110
- [ "$status" -eq 0 ]
111
- }
112
-
113
- @test "traversal: manage-problem names the in-progress → done auto-transition trigger (criteria ticked + RFC closed)" {
114
- run grep -iE 'in-progress.*done.*acceptance-criteria.*ticked|ALL acceptance-criteria.*RFC reaches.*closed' "$MANAGE_PROBLEM"
115
- [ "$status" -eq 0 ]
116
- }