@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.
- package/.claude-plugin/plugin.json +1 -1
- package/package.json +7 -2
- package/agents/test/fixtures/proceed-new-genuinely-new.md +0 -43
- package/agents/test/fixtures/proceed-new-subtle-sibling.md +0 -47
- package/agents/test/fixtures/regression-p347-vs-p346.md +0 -54
- package/agents/test/hang-off-check.bats +0 -225
- package/hooks/test/block-list.bats +0 -153
- package/hooks/test/command-detect.bats +0 -181
- package/hooks/test/itil-assistant-output-gate.bats +0 -114
- package/hooks/test/itil-assistant-output-review.bats +0 -224
- package/hooks/test/itil-bash-polling-antipattern-detect.bats +0 -154
- package/hooks/test/itil-changeset-discipline.bats +0 -603
- package/hooks/test/itil-claude-space-protection.bats +0 -294
- package/hooks/test/itil-commit-trailer-transition-advisory.bats +0 -80
- package/hooks/test/itil-correction-detect.bats +0 -189
- package/hooks/test/itil-deferral-cadence-gate.bats +0 -187
- package/hooks/test/itil-fictional-defer-detect.bats +0 -292
- package/hooks/test/itil-fix-title-lifecycle-advisory.bats +0 -129
- package/hooks/test/itil-mid-loop-ask-detect.bats +0 -220
- package/hooks/test/itil-no-implement-draft-gate.bats +0 -210
- package/hooks/test/itil-pending-questions-surface.bats +0 -307
- package/hooks/test/itil-readme-refresh-discipline.bats +0 -642
- package/hooks/test/itil-rfc-oversight-nudge.bats +0 -83
- package/hooks/test/itil-rfc-trailer-advisory.bats +0 -375
- package/hooks/test/itil-story-mirror-migration-nudge.bats +0 -122
- package/hooks/test/manage-problem-enforce-create.bats +0 -424
- package/hooks/test/p057-staging-trap-detect.bats +0 -231
- package/hooks/test/pre-publish-intake-gate.bats +0 -144
- package/hooks/test/runtime-sid-marker.bats +0 -90
- package/hooks/test/session-id.bats +0 -370
- package/scripts/migrate-problems-add-type.sh +0 -116
- package/scripts/test/catchup-scan.bats +0 -274
- package/scripts/test/check-afk-accept-eligible.bats +0 -310
- package/scripts/test/check-fail-soft-skip-discipline.bats +0 -172
- package/scripts/test/check-fix-rfc-trace.bats +0 -164
- package/scripts/test/check-locale-discipline.bats +0 -291
- package/scripts/test/check-problems-readme-budget.bats +0 -192
- package/scripts/test/check-rfc-has-stories.bats +0 -69
- package/scripts/test/check-rfc-rejected-alternatives.bats +0 -108
- package/scripts/test/check-rfc-stories-ratified.bats +0 -82
- package/scripts/test/check-upstream-responses.bats +0 -503
- package/scripts/test/classify-readme-drift.bats +0 -392
- package/scripts/test/derive-first-dispatch.bats +0 -274
- package/scripts/test/derive-release-vehicle.bats +0 -454
- package/scripts/test/detect-unratified-stories-maps.bats +0 -60
- package/scripts/test/dual-tolerant-glob-rfc-002-t2.bats +0 -309
- package/scripts/test/effort-tally.bats +0 -170
- package/scripts/test/evaluate-relevance.bats +0 -773
- package/scripts/test/kind-a-commands.bats +0 -46
- package/scripts/test/mark-create-gate.bats +0 -59
- package/scripts/test/mark-story-oversight-confirmed.bats +0 -53
- package/scripts/test/migrate-problems-add-type.bats +0 -280
- package/scripts/test/migrate-story-status-mirror.bats +0 -167
- package/scripts/test/no-type-regression-guard.bats +0 -74
- package/scripts/test/oversight-mirror-corpus-lint.bats +0 -150
- package/scripts/test/plugin-exercise-index.bats +0 -386
- package/scripts/test/plugin-maturity-doc-lint.bats +0 -470
- package/scripts/test/plugin-maturity-populate.bats +0 -631
- package/scripts/test/plugin-maturity-render.bats +0 -469
- package/scripts/test/plugin-validate-ci-gate.bats +0 -208
- package/scripts/test/reconcile-readme.bats +0 -1007
- package/scripts/test/reconcile-rfcs.bats +0 -496
- package/scripts/test/reconcile-stories.bats +0 -173
- package/scripts/test/reconcile-story-maps.bats +0 -74
- package/scripts/test/release-watch-poll-loop.bats +0 -180
- package/scripts/test/resolve-governance-plugin-dirs.bats +0 -78
- package/scripts/test/rfc-stories-extension.bats +0 -175
- package/scripts/test/skill-invocations.bats +0 -535
- package/scripts/test/skill-md-dual-tolerant-coverage-rfc-002-t3.bats +0 -374
- package/scripts/test/story-oversight-lib.bats +0 -190
- package/scripts/test/update-jtbd-references-related-problems.bats +0 -178
- package/scripts/test/update-problem-references-section.bats +0 -242
- package/scripts/test/update-problem-rfcs-section.bats +0 -242
- package/scripts/test/update-references-section-sibling-helpers.bats +0 -80
- package/scripts/test/update-rfc-commits-section.bats +0 -77
- package/scripts/test/verify-iter-summary.bats +0 -196
- package/scripts/test/working-the-problem-traversal.bats +0 -116
- package/skills/capture-problem/test/capture-problem-step-1-5b-jtbd-trace.bats +0 -398
- package/skills/capture-problem/test/capture-problem.bats +0 -389
- package/skills/capture-story/test/capture-story-behavioural.bats +0 -317
- package/skills/capture-story-map/test/capture-story-map-behavioural.bats +0 -98
- package/skills/close-incident/test/close-incident-contract.bats +0 -146
- package/skills/link-incident/test/link-incident-contract.bats +0 -125
- package/skills/list-incidents/test/list-incidents-contract.bats +0 -115
- package/skills/list-problems/test/list-problems-contract.bats +0 -100
- package/skills/list-stories/test/list-stories-contract.bats +0 -127
- package/skills/list-story-maps/test/list-story-maps-contract.bats +0 -46
- package/skills/manage-incident/test/manage-incident-adr-044-contract.bats +0 -206
- package/skills/manage-incident/test/manage-incident-close-forwarder.bats +0 -67
- package/skills/manage-incident/test/manage-incident-link-forwarder.bats +0 -67
- package/skills/manage-incident/test/manage-incident-list-forwarder.bats +0 -68
- package/skills/manage-incident/test/manage-incident-mitigate-forwarder.bats +0 -66
- package/skills/manage-incident/test/manage-incident-restore-forwarder.bats +0 -66
- package/skills/manage-incident/test/manage-incident.bats +0 -171
- package/skills/manage-problem/test/manage-problem-adr-044-step4-derive-first.bats +0 -151
- package/skills/manage-problem/test/manage-problem-auto-migrate-step.bats +0 -53
- package/skills/manage-problem/test/manage-problem-concern-boundary.bats +0 -64
- package/skills/manage-problem/test/manage-problem-effort-buckets.bats +0 -56
- package/skills/manage-problem/test/manage-problem-external-root-cause-detection.bats +0 -119
- package/skills/manage-problem/test/manage-problem-first-run-intake-prompt.bats +0 -43
- package/skills/manage-problem/test/manage-problem-git-mv-restage-reminder.bats +0 -48
- package/skills/manage-problem/test/manage-problem-id-collision-guard.bats +0 -39
- package/skills/manage-problem/test/manage-problem-list-forwarder.bats +0 -66
- package/skills/manage-problem/test/manage-problem-next-id-origin-lookup.bats +0 -50
- package/skills/manage-problem/test/manage-problem-no-prose-options.bats +0 -74
- package/skills/manage-problem/test/manage-problem-output-formatting.bats +0 -30
- package/skills/manage-problem/test/manage-problem-parked-and-cache.bats +0 -73
- package/skills/manage-problem/test/manage-problem-readme-refresh-on-transition.bats +0 -62
- package/skills/manage-problem/test/manage-problem-readme-tie-break-order.bats +0 -318
- package/skills/manage-problem/test/manage-problem-readme-vq-sort-order.bats +0 -206
- package/skills/manage-problem/test/manage-problem-release-vehicle-seed.bats +0 -83
- package/skills/manage-problem/test/manage-problem-review-forwarder.bats +0 -71
- package/skills/manage-problem/test/manage-problem-step-9d-recovery-path.bats +0 -97
- package/skills/manage-problem/test/manage-problem-transition-forwarder.bats +0 -96
- package/skills/manage-problem/test/manage-problem-transitive-dependencies.bats +0 -365
- package/skills/manage-problem/test/manage-problem-verification-detection.bats +0 -64
- package/skills/manage-problem/test/manage-problem-verification-pending.bats +0 -114
- package/skills/manage-problem/test/manage-problem-work-forwarder.bats +0 -88
- package/skills/manage-story/test/manage-story-contract.bats +0 -174
- package/skills/manage-story-map/test/manage-story-map-contract.bats +0 -63
- package/skills/mitigate-incident/test/mitigate-incident-contract.bats +0 -258
- package/skills/reconcile-readme/test/reconcile-readme-contract.bats +0 -201
- package/skills/report-upstream/test/report-upstream-contract.bats +0 -394
- package/skills/restore-incident/test/restore-incident-contract.bats +0 -170
- package/skills/review-problems/test/inbound-channels-cache-shape.bats +0 -127
- package/skills/review-problems/test/inbound-discovery-contract.bats +0 -383
- package/skills/review-problems/test/jtbd-301-verdict-shape-contract.bats +0 -225
- package/skills/review-problems/test/review-problems-contract.bats +0 -235
- package/skills/review-problems/test/review-problems-likely-verified-cell-shape.bats +0 -229
- package/skills/scaffold-intake/test/scaffold-intake-contract.bats +0 -126
- package/skills/scaffold-intake/test/scaffold-intake-fixture.bats +0 -164
- package/skills/scaffold-intake/test/scaffold-intake-secrets-absent.bats +0 -87
- package/skills/transition-problem/test/transition-problem-contract.bats +0 -285
- package/skills/transition-problems/test/transition-problems-contract.bats +0 -331
- package/skills/update-upstream/test/update-upstream-contract.bats +0 -375
- package/skills/work-problem/test/work-problem-contract.bats +0 -294
- package/skills/work-problems/test/work-problems-above-appetite-remediation.bats +0 -139
- package/skills/work-problems/test/work-problems-adr-013-rule-6-p352-amendment.bats +0 -166
- package/skills/work-problems/test/work-problems-auto-migrate-step.bats +0 -57
- package/skills/work-problems/test/work-problems-cost-logging.bats +0 -109
- package/skills/work-problems/test/work-problems-deviation-candidate-shape.bats +0 -121
- package/skills/work-problems/test/work-problems-first-run-intake-prompt.bats +0 -36
- package/skills/work-problems/test/work-problems-inter-iteration-verify.bats +0 -59
- package/skills/work-problems/test/work-problems-mid-loop-userpromptsubmit-handler.bats +0 -69
- package/skills/work-problems/test/work-problems-no-mid-loop-asking.bats +0 -192
- package/skills/work-problems/test/work-problems-p341-pre-all-done-gate.bats +0 -122
- package/skills/work-problems/test/work-problems-p342-r007-derive-then-pass-flags.bats +0 -170
- package/skills/work-problems/test/work-problems-p342-retro-auto-ticket-carveout.bats +0 -120
- package/skills/work-problems/test/work-problems-preflight-failure-handling.bats +0 -248
- package/skills/work-problems/test/work-problems-preflight-session-continuity.bats +0 -139
- package/skills/work-problems/test/work-problems-preflight.bats +0 -69
- package/skills/work-problems/test/work-problems-release-cadence.bats +0 -63
- package/skills/work-problems/test/work-problems-step-0-iter-error-staleness.bats +0 -93
- package/skills/work-problems/test/work-problems-step-0b-cache-staleness-behavioural.bats +0 -138
- package/skills/work-problems/test/work-problems-step-0c-deferred-placeholder-staleness-behavioural.bats +0 -238
- package/skills/work-problems/test/work-problems-step-0d-outbound-responses-staleness-behavioural.bats +0 -174
- package/skills/work-problems/test/work-problems-step-2-5-routing.bats +0 -80
- package/skills/work-problems/test/work-problems-step-2-5b-cross-halt-routing.bats +0 -149
- package/skills/work-problems/test/work-problems-step-3-5-jtbd-ratification-predicate.bats +0 -191
- package/skills/work-problems/test/work-problems-step-5-bats-polling-discipline.bats +0 -91
- package/skills/work-problems/test/work-problems-step-5-delegation.bats +0 -333
- package/skills/work-problems/test/work-problems-step-5-idle-timeout-sigterm.bats +0 -421
- package/skills/work-problems/test/work-problems-step-5-is-error-transient-halt.bats +0 -278
- package/skills/work-problems/test/work-problems-step-5-iter-changeset-required.bats +0 -95
- package/skills/work-problems/test/work-problems-step-5-prompt-body-re-grounding.bats +0 -128
- package/skills/work-problems/test/work-problems-step-5-stream-timeout-salvage.bats +0 -251
- package/skills/work-problems/test/work-problems-step-6-5-always-drain.bats +0 -203
- package/skills/work-problems/test/work-problems-step-6-5-cache-refresh-chain.bats +0 -174
- package/skills/work-problems/test/work-problems-step-6-5-fix-and-continue.bats +0 -254
- package/skills/work-problems/test/work-problems-step-6-5-postrelease-kv-callback.bats +0 -209
- package/skills/work-problems/test/work-problems-stop-condition-questions.bats +0 -85
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
# Contract assertions for /wr-itil:review-problems Step 4.5d + Step 4.5e
|
|
3
|
-
# verdict-shape ack-comment templates (P229 / JTBD-301).
|
|
4
|
-
#
|
|
5
|
-
# Structural assertions — Permitted Exception to the source-grep ban
|
|
6
|
-
# per ADR-005 / P011 / ADR-037 / ADR-052 § Surface 2. SKILL.md prose
|
|
7
|
-
# governs LLM-driven runtime behaviour; behavioural-replay testing
|
|
8
|
-
# requires a synthetic agent harness (P012 master ticket; P176 follow-up
|
|
9
|
-
# for the SKILL.md surface; P324 review-problems agent-prose harness gap).
|
|
10
|
-
# Until that harness lands, contract bats assert the load-bearing
|
|
11
|
-
# template elements are present so future edits don't silently strip
|
|
12
|
-
# the JTBD-301 verdict vocabulary and re-introduce framework-vocab leakage.
|
|
13
|
-
#
|
|
14
|
-
# @problem P229
|
|
15
|
-
# @problem P012 (master harness ticket — justification for structural exception)
|
|
16
|
-
# @problem P176 (SKILL.md surface follow-up)
|
|
17
|
-
# @problem P324 (review-problems agent-prose harness gap)
|
|
18
|
-
# @jtbd JTBD-301 (verdict-shape acknowledgement contract — non-negotiable)
|
|
19
|
-
# @adr ADR-024 (report-upstream contract — symmetry mirror)
|
|
20
|
-
# @adr ADR-036 (downstream-scaffold contract — adopter inheritance)
|
|
21
|
-
# @adr ADR-052 (behavioural-tests default + Permitted Exception)
|
|
22
|
-
# @adr ADR-062 (inbound-discovery + assessment pipeline)
|
|
23
|
-
|
|
24
|
-
setup() {
|
|
25
|
-
SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
|
|
26
|
-
SKILL_FILE="${SKILL_DIR}/SKILL.md"
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
30
|
-
# Verdict-shape contract subsection exists at the head of Step 4.5e
|
|
31
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
32
|
-
|
|
33
|
-
@test "4.5e-comment-shape subsection exists (briefs JTBD-301 contract upstream of branch templates)" {
|
|
34
|
-
run grep -nE '^#### 4\.5e-comment-shape' "$SKILL_FILE"
|
|
35
|
-
[ "$status" -eq 0 ]
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@test "verdict-shape subsection names all four JTBD-301 verdict words verbatim" {
|
|
39
|
-
# JTBD-301 Desired Outcome row 6 names exactly four verdicts.
|
|
40
|
-
# The subsection MUST name all four so a reader sees the vocabulary
|
|
41
|
-
# before reading the per-branch templates that implement it.
|
|
42
|
-
run grep -nE 'fix released' "$SKILL_FILE"
|
|
43
|
-
[ "$status" -eq 0 ]
|
|
44
|
-
run grep -nE 'won.t-fix|won\\.t fix' "$SKILL_FILE"
|
|
45
|
-
[ "$status" -eq 0 ]
|
|
46
|
-
run grep -nE 'duplicate' "$SKILL_FILE"
|
|
47
|
-
[ "$status" -eq 0 ]
|
|
48
|
-
run grep -nE 'parked' "$SKILL_FILE"
|
|
49
|
-
[ "$status" -eq 0 ]
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
@test "verdict-shape subsection explicitly forbids framework-vocab leakage in ack-comment bodies" {
|
|
53
|
-
# Load-bearing rule: maintainer-internal jargon (Step IDs, branch
|
|
54
|
-
# names, classification tokens) MUST NOT appear in reporter-facing
|
|
55
|
-
# comment bodies. Audit-log at 4.5f keeps the tokens.
|
|
56
|
-
run grep -inE 'framework.vocab|maintainer.internal|reporter.facing' "$SKILL_FILE"
|
|
57
|
-
[ "$status" -eq 0 ]
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@test "verdict-shape subsection cites the report-upstream symmetry (ADR-024 / ADR-036)" {
|
|
61
|
-
# JTBD-301 line 23 + ADR-024 / ADR-036 establish the inbound/outbound
|
|
62
|
-
# symmetry: outbound `/wr-itil:report-upstream` posts structured
|
|
63
|
-
# human-language; inbound ack mirrors that shape.
|
|
64
|
-
run grep -nE 'symmetry|mirror' "$SKILL_FILE"
|
|
65
|
-
[ "$status" -eq 0 ]
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
@test "verdict-shape subsection documents the C2 gate-substitution caveat (architect condition C2)" {
|
|
69
|
-
# The external-comms gate (ADR-028) fires on the SUBSTITUTED body,
|
|
70
|
-
# not the template — template authors must ensure no maintainer
|
|
71
|
-
# jargon leaks via P<NNN> title substitution or <reason> expansion.
|
|
72
|
-
run grep -inE 'substituted body|gate.fires.on.the.*substituted|template.author' "$SKILL_FILE"
|
|
73
|
-
[ "$status" -eq 0 ]
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
77
|
-
# Step 4.5d — matched-local-ticket cross-reference uses verdict-shape
|
|
78
|
-
# (duplicate verdict)
|
|
79
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
80
|
-
|
|
81
|
-
@test "Step 4.5d cross-reference comment uses 'duplicate' verdict language" {
|
|
82
|
-
# Replaces the bureaucratic "Tracked locally as docs/problems/..." boilerplate
|
|
83
|
-
# with verdict-shape "we're tracking this as a duplicate of P<NNN>".
|
|
84
|
-
run grep -inE 'duplicate of P.NNN.|tracking.*duplicate' "$SKILL_FILE"
|
|
85
|
-
[ "$status" -eq 0 ]
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
@test "Step 4.5d cross-reference comment template is documented inline (not just referenced)" {
|
|
89
|
-
# SKILL prose must carry the actual template body so a single-pass
|
|
90
|
-
# reader sees the shape, not just a cross-reference to JTBD-301.
|
|
91
|
-
run grep -nE '4\.5d.*[Cc]omment template|matched-local-ticket.*template' "$SKILL_FILE"
|
|
92
|
-
[ "$status" -eq 0 ]
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
96
|
-
# Step 4.5e Step 4 — above-threshold-pushback verdict template (won't-fix)
|
|
97
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
98
|
-
|
|
99
|
-
@test "Step 4.5e Step 4 pushback template uses 'we don't plan to fix this' verdict language" {
|
|
100
|
-
run grep -inE "we don.t plan to fix|don.t plan to fix this" "$SKILL_FILE"
|
|
101
|
-
[ "$status" -eq 0 ]
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
105
|
-
# Step 4.5e Step 5 — clear-malicious verdict template (policy-violation close)
|
|
106
|
-
# Architect condition C4: name this as fifth implicit verdict, not conflated
|
|
107
|
-
# with won't-fix
|
|
108
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
109
|
-
|
|
110
|
-
@test "Step 4.5e Step 5 clear-malicious template uses 'we're closing this report' verdict language" {
|
|
111
|
-
run grep -inE "we.re closing this|closing this report" "$SKILL_FILE"
|
|
112
|
-
[ "$status" -eq 0 ]
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
@test "verdict-shape subsection names clear-malicious as fifth implicit verdict (architect C4)" {
|
|
116
|
-
# The four documented JTBD-301 verdicts are fix-released / parked /
|
|
117
|
-
# duplicate / won't-fix. clear-malicious is a stronger close
|
|
118
|
-
# (policy-violation) — name it precisely in the subsection prose
|
|
119
|
-
# rather than conflating with won't-fix.
|
|
120
|
-
run grep -inE 'policy.violation close|fifth.*verdict|implicit.*verdict' "$SKILL_FILE"
|
|
121
|
-
[ "$status" -eq 0 ]
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
@test "clear-malicious classification gloss is plain-language (JTBD non-blocking advisory)" {
|
|
125
|
-
# JTBD advisory: <classification> in the clear-malicious template
|
|
126
|
-
# MUST be a plain-language gloss, NOT the raw wr-risk-scorer verdict
|
|
127
|
-
# token. SKILL prose must specify this so the reporter sees
|
|
128
|
-
# human language, not "out-of-scope-for-documented-personas".
|
|
129
|
-
run grep -inE 'plain.language gloss|plain-language.*classification' "$SKILL_FILE"
|
|
130
|
-
[ "$status" -eq 0 ]
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
134
|
-
# Step 4.5e Step 6 — safe-and-valid verdict template (accepted-into-backlog)
|
|
135
|
-
# Architect condition C3: name as "accepted into backlog", not fix-released
|
|
136
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
137
|
-
|
|
138
|
-
@test "Step 4.5e Step 6 safe-and-valid template uses 'we're tracking this as a real bug' verdict language" {
|
|
139
|
-
run grep -inE "tracking this as a real|tracking.*real bug" "$SKILL_FILE"
|
|
140
|
-
[ "$status" -eq 0 ]
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
@test "Step 4.5e Step 6 template does NOT include framework vocab 'safe-and-valid branch' in comment body" {
|
|
144
|
-
# The 31-comment leak: "classified via /wr-itil:review-problems Step
|
|
145
|
-
# 4.5e safe-and-valid branch with safe-low-fix-risk" appeared in
|
|
146
|
-
# comment bodies. The new template prose must show the reporter-facing
|
|
147
|
-
# body and not include the framework-vocab phrasing inside a comment-body block.
|
|
148
|
-
# Note: the steps section header itself names "Safe-and-valid branch" —
|
|
149
|
-
# that's the maintainer prose and fine. This test checks the COMMENT-BODY
|
|
150
|
-
# template (which lives in a fenced code block under Step 6) does not include
|
|
151
|
-
# the leak phrase "safe-low-fix-risk".
|
|
152
|
-
run grep -nE 'safe-low-fix-risk' "$SKILL_FILE"
|
|
153
|
-
# Token may appear in maintainer prose / classifier docs — but MUST NOT
|
|
154
|
-
# appear inside a fenced comment-body template block. We assert the token
|
|
155
|
-
# appears AT MOST in step-3 dual-axis-risk-classifier prose and the audit-log
|
|
156
|
-
# surface; not in a quoted comment template body. We use a structural proxy:
|
|
157
|
-
# the new 4.5e-comment-shape subsection MUST explicitly call out that the
|
|
158
|
-
# token belongs in maintainer-side audit-log only, not in the user-facing comment.
|
|
159
|
-
run grep -inE "safe-low-fix-risk.*audit.log only|safe.low.fix.risk.*maintainer.side" "$SKILL_FILE"
|
|
160
|
-
[ "$status" -eq 0 ]
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
@test "verdict-shape subsection names Step 6 verdict as 'accepted into backlog' (architect C3)" {
|
|
164
|
-
# JTBD-301 'fix released' is the post-release verdict — the Step 6
|
|
165
|
-
# ack fires at accept-into-backlog time. Name the verdict precisely
|
|
166
|
-
# in the subsection prose.
|
|
167
|
-
run grep -inE 'accepted into backlog|accept.into.backlog' "$SKILL_FILE"
|
|
168
|
-
[ "$status" -eq 0 ]
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
@test "Step 4.5e Step 6 template references release-notes / status surface for future updates" {
|
|
172
|
-
# JTBD-301 desired outcome: reporter knows where to watch for updates.
|
|
173
|
-
# The template must point to a stable surface (release notes / status
|
|
174
|
-
# page / linked issue) so the reporter has actionable expectation.
|
|
175
|
-
run grep -inE 'release notes|release-notes|watch this issue' "$SKILL_FILE"
|
|
176
|
-
[ "$status" -eq 0 ]
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
180
|
-
# Architect condition A1 — gate-denial sub-branches preserved across all four
|
|
181
|
-
# verdict-shape templates (no silent-skip regression)
|
|
182
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
183
|
-
|
|
184
|
-
@test "All four ack-comment branches preserve gate-denial sub-branches (architect A1)" {
|
|
185
|
-
# Step 4 (pushback), Step 5 (clear-malicious), Step 6 (safe-and-valid)
|
|
186
|
-
# already have gate-denial sub-branches in the current SKILL. The
|
|
187
|
-
# P229 fix preserves them; this assertion catches a regression where
|
|
188
|
-
# a template rewrite accidentally drops the sub-branch.
|
|
189
|
-
run grep -nE 'gate-denied-pushback' "$SKILL_FILE"
|
|
190
|
-
[ "$status" -eq 0 ]
|
|
191
|
-
run grep -nE 'gate-denied-clear-malicious' "$SKILL_FILE"
|
|
192
|
-
[ "$status" -eq 0 ]
|
|
193
|
-
run grep -nE 'gate-denied-safe-and-valid' "$SKILL_FILE"
|
|
194
|
-
[ "$status" -eq 0 ]
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
198
|
-
# Architect condition A2 — audit-log preserves classification tokens verbatim
|
|
199
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
200
|
-
|
|
201
|
-
@test "Audit-log surface at 4.5f preserves classification tokens (architect A2)" {
|
|
202
|
-
# The user-side template change strips framework vocab from comment
|
|
203
|
-
# bodies; the audit-log surface (4.5f) MUST continue receiving the
|
|
204
|
-
# raw classification tokens for replay determinism per ADR-062.
|
|
205
|
-
run grep -nE '4\.5f.*[Aa]udit-log' "$SKILL_FILE"
|
|
206
|
-
[ "$status" -eq 0 ]
|
|
207
|
-
run grep -nE 'safe-and-valid-local-ticket-created|above-threshold-pushback|clear-malicious-closed' "$SKILL_FILE"
|
|
208
|
-
[ "$status" -eq 0 ]
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
212
|
-
# JTBD-301 vocabulary visibility — four-verdict words appear in branch templates
|
|
213
|
-
# ──────────────────────────────────────────────────────────────────────────────
|
|
214
|
-
|
|
215
|
-
@test "P229 root-cause ticket cross-referenced from verdict-shape subsection" {
|
|
216
|
-
# Audit-trail grounding per ADR-026: the SKILL prose change cites
|
|
217
|
-
# the originating ticket so the rationale stays discoverable.
|
|
218
|
-
run grep -nE 'P229' "$SKILL_FILE"
|
|
219
|
-
[ "$status" -eq 0 ]
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
@test "verdict-shape subsection cites JTBD-301 by ID" {
|
|
223
|
-
run grep -nE 'JTBD-301' "$SKILL_FILE"
|
|
224
|
-
[ "$status" -eq 0 ]
|
|
225
|
-
}
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
# Contract assertions for /wr-itil:review-problems (P071 split slice 2).
|
|
3
|
-
#
|
|
4
|
-
# This skill hosts the "re-assess every open / known-error problem,
|
|
5
|
-
# auto-transition, fire the verification prompt, and rewrite the README
|
|
6
|
-
# cache" user intent previously hidden behind /wr-itil:manage-problem
|
|
7
|
-
# review. Unlike list-problems (slice 1, pure read-only) this skill
|
|
8
|
-
# owns the README cache write and the auto-transition path, so it
|
|
9
|
-
# requires the full governance tool surface (Write, Edit, Bash,
|
|
10
|
-
# AskUserQuestion, Skill for the commit-gate fallback).
|
|
11
|
-
#
|
|
12
|
-
# Structural assertion — Permitted Exception to the source-grep ban
|
|
13
|
-
# (ADR-005 / P011 / ADR-037 contract-assertion pattern).
|
|
14
|
-
#
|
|
15
|
-
# @problem P071
|
|
16
|
-
# @jtbd JTBD-001 (enforce governance without slowing down — discoverable surface)
|
|
17
|
-
# @jtbd JTBD-101 (extend the suite with clear patterns — one skill per distinct user intent)
|
|
18
|
-
#
|
|
19
|
-
# Cross-reference:
|
|
20
|
-
# P071: docs/problems/071-argument-based-skill-subcommands-are-not-discoverable.open.md
|
|
21
|
-
# ADR-010 amended (Skill Granularity section) — split naming + forwarder contract
|
|
22
|
-
# ADR-022 — Verification Pending status conventions (review-problems owns the queue prompt)
|
|
23
|
-
# ADR-014 — governance skills commit their own work
|
|
24
|
-
# ADR-015 — commit-gate delegation pattern
|
|
25
|
-
# ADR-037 — contract-assertion bats pattern
|
|
26
|
-
|
|
27
|
-
setup() {
|
|
28
|
-
SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
|
|
29
|
-
SKILL_FILE="${SKILL_DIR}/SKILL.md"
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@test "SKILL.md exists and has frontmatter" {
|
|
33
|
-
[ -f "$SKILL_FILE" ]
|
|
34
|
-
run head -1 "$SKILL_FILE"
|
|
35
|
-
[ "$status" -eq 0 ]
|
|
36
|
-
[ "$output" = "---" ]
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@test "SKILL.md frontmatter name is wr-itil:review-problems (P071 + ADR-010 amended)" {
|
|
40
|
-
# Split naming convention per ADR-010 amendment: <verb>-<object> pair.
|
|
41
|
-
# The new skill's name must match the phased-landing plan pinned in P071.
|
|
42
|
-
run grep -n "^name: wr-itil:review-problems$" "$SKILL_FILE"
|
|
43
|
-
[ "$status" -eq 0 ]
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@test "SKILL.md frontmatter description names the review intent (P071)" {
|
|
47
|
-
# Description must name "re-assess" or "review" + "problem" so
|
|
48
|
-
# Claude Code autocomplete surfaces the user intent rather than a
|
|
49
|
-
# generic name.
|
|
50
|
-
run grep -inE "^description:.*(re-assess|review).*problem|^description:.*problem.*(re-assess|review)" "$SKILL_FILE"
|
|
51
|
-
[ "$status" -eq 0 ]
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@test "SKILL.md frontmatter allowed-tools includes Write + Edit (owns README refresh)" {
|
|
55
|
-
# Review owns the README cache write and auto-transition Edits.
|
|
56
|
-
# Unlike list-problems (pure read-only), this skill MUST carry Write
|
|
57
|
-
# and Edit so the commit gate contract from ADR-014 holds.
|
|
58
|
-
run grep -nE "^allowed-tools:.*Write" "$SKILL_FILE"
|
|
59
|
-
[ "$status" -eq 0 ]
|
|
60
|
-
run grep -nE "^allowed-tools:.*Edit" "$SKILL_FILE"
|
|
61
|
-
[ "$status" -eq 0 ]
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@test "SKILL.md frontmatter allowed-tools includes Skill (commit-gate fallback)" {
|
|
65
|
-
# Step 6 commit-gate fallback invokes /wr-risk-scorer:assess-release
|
|
66
|
-
# when the pipeline subagent is unavailable. That fallback requires
|
|
67
|
-
# the Skill tool per ADR-015.
|
|
68
|
-
run grep -nE "^allowed-tools:.*Skill" "$SKILL_FILE"
|
|
69
|
-
[ "$status" -eq 0 ]
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
@test "SKILL.md frontmatter allowed-tools includes AskUserQuestion (Verification prompt)" {
|
|
73
|
-
# Step 4 fires AskUserQuestion for every .verifying.md ticket per
|
|
74
|
-
# ADR-022. The AFK branch degrades gracefully (ADR-013 Rule 6) but
|
|
75
|
-
# the primary path requires the tool.
|
|
76
|
-
run grep -nE "^allowed-tools:.*AskUserQuestion" "$SKILL_FILE"
|
|
77
|
-
[ "$status" -eq 0 ]
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@test "SKILL.md documents the re-scoring scan scope (P071)" {
|
|
81
|
-
# The skill reads .open.md and .known-error.md files and writes back
|
|
82
|
-
# Priority + Effort + WSJF. .verifying.md and .parked.md are NOT
|
|
83
|
-
# re-scored (multiplier 0) but are shown in dedicated sections.
|
|
84
|
-
# The SKILL.md must name all four glob patterns so the contract is legible.
|
|
85
|
-
run grep -inE "\.open\.md" "$SKILL_FILE"
|
|
86
|
-
[ "$status" -eq 0 ]
|
|
87
|
-
run grep -inE "\.known-error\.md" "$SKILL_FILE"
|
|
88
|
-
[ "$status" -eq 0 ]
|
|
89
|
-
run grep -inE "\.verifying\.md" "$SKILL_FILE"
|
|
90
|
-
[ "$status" -eq 0 ]
|
|
91
|
-
run grep -inE "\.parked\.md" "$SKILL_FILE"
|
|
92
|
-
[ "$status" -eq 0 ]
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
@test "SKILL.md owns the README.md refresh write (P062 + ownership boundary)" {
|
|
96
|
-
# Review is the canonical writer of docs/problems/README.md. The
|
|
97
|
-
# sibling list-problems skill explicitly defers here. If this
|
|
98
|
-
# contract drifts (e.g. list-problems starts writing the README or
|
|
99
|
-
# review stops writing it), the fast-path cache goes stale.
|
|
100
|
-
run grep -inE "docs/problems/README\.md" "$SKILL_FILE"
|
|
101
|
-
[ "$status" -eq 0 ]
|
|
102
|
-
run grep -inE "(rewrite|write[ /]+overwrite|refresh|rewrites).*README\.md|README\.md.*(rewrite|refresh|overwrite|write)" "$SKILL_FILE"
|
|
103
|
-
[ "$status" -eq 0 ]
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
@test "SKILL.md fires the Verification Queue prompt per ADR-022 (Step 4)" {
|
|
107
|
-
# Step 4 is the structured path that transitions Verification Pending
|
|
108
|
-
# → Closed. Without it, verifyings accumulate forever. The prompt
|
|
109
|
-
# MUST include a fix summary per ADR-022 (not just ID + title +
|
|
110
|
-
# version).
|
|
111
|
-
run grep -inE "Verification (Queue|Pending)|verifying\.md" "$SKILL_FILE"
|
|
112
|
-
[ "$status" -eq 0 ]
|
|
113
|
-
run grep -inE "Fix Released|fix summary" "$SKILL_FILE"
|
|
114
|
-
[ "$status" -eq 0 ]
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
@test "SKILL.md declares the auto-transition path (Open → Known Error)" {
|
|
118
|
-
# Step 2.10 auto-transitions Open tickets with documented root cause
|
|
119
|
-
# + workaround to Known Error. This is a defining behaviour of the
|
|
120
|
-
# review skill; drift here means the backlog lingers in Open forever.
|
|
121
|
-
run grep -inE "Auto-transition|auto.transition|Open.+Known Error|known-error" "$SKILL_FILE"
|
|
122
|
-
[ "$status" -eq 0 ]
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
@test "SKILL.md satisfies the commit gate per ADR-014 + ADR-015" {
|
|
126
|
-
# Review is a governance skill per ADR-014: it commits its own work
|
|
127
|
-
# after satisfying the commit gate. Per ADR-015 the gate has two
|
|
128
|
-
# paths (primary subagent delegation + fallback assess-release
|
|
129
|
-
# skill). Both MUST be documented so P035 stays closed.
|
|
130
|
-
run grep -inE "wr-risk-scorer:pipeline|wr-risk-scorer:assess-release" "$SKILL_FILE"
|
|
131
|
-
[ "$status" -eq 0 ]
|
|
132
|
-
run grep -inE "ADR-014|ADR-015" "$SKILL_FILE"
|
|
133
|
-
[ "$status" -eq 0 ]
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
@test "SKILL.md cites the P057 staging trap on auto-transitions" {
|
|
137
|
-
# Any git mv + Edit combo in this skill (Step 2.10 auto-transition,
|
|
138
|
-
# Step 4 verification close) MUST re-stage explicitly. P057
|
|
139
|
-
# codifies this; drift here means content edits leak into later
|
|
140
|
-
# commits.
|
|
141
|
-
run grep -inE "staging trap|P057|re-stage" "$SKILL_FILE"
|
|
142
|
-
[ "$status" -eq 0 ]
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
@test "SKILL.md reuses the RISK-POLICY.md risk framework (no hardcoded scale)" {
|
|
146
|
-
# Step 1 reads RISK-POLICY.md for the current Impact/Likelihood
|
|
147
|
-
# scales and label bands. Hardcoding a scale causes drift when the
|
|
148
|
-
# policy is amended (ISO 31000 alignment axis).
|
|
149
|
-
run grep -inE "RISK-POLICY\.md" "$SKILL_FILE"
|
|
150
|
-
[ "$status" -eq 0 ]
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
@test "SKILL.md cites P071 and ADR-010 amended (P071 + ADR-025)" {
|
|
154
|
-
# ADR-025 inheritance per ADR-037: contract-assertion bats should
|
|
155
|
-
# reflect traceability cites on the skill spec document.
|
|
156
|
-
run grep -inE "P071|ADR-010" "$SKILL_FILE"
|
|
157
|
-
[ "$status" -eq 0 ]
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
@test "SKILL.md does not carry a deprecated-arguments frontmatter flag (clean-split skill)" {
|
|
161
|
-
# Architect advisory: review-problems is a clean-split skill with no
|
|
162
|
-
# argument-subcommands itself. ADR-010 amendment's
|
|
163
|
-
# `deprecated-arguments: true` flag is only valid on host skills with
|
|
164
|
-
# forwarder routes — review-problems is the forwarder TARGET, not the
|
|
165
|
-
# host.
|
|
166
|
-
run grep -E "^deprecated-arguments:" "$SKILL_FILE"
|
|
167
|
-
[ "$status" -ne 0 ]
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
@test "SKILL.md does not use word-argument subcommand branching (P071 regression guard)" {
|
|
171
|
-
# The whole point of P071: Claude Code autocomplete does not surface
|
|
172
|
-
# arguments. A clean-split skill must not reintroduce word-arg
|
|
173
|
-
# subcommand routing. The SKILL.md must not contain `If arguments
|
|
174
|
-
# start with "list"` / `If arguments contain "work"` / etc. patterns.
|
|
175
|
-
run grep -inE "If arguments start with|If arguments contain" "$SKILL_FILE"
|
|
176
|
-
[ "$status" -ne 0 ]
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
@test "SKILL.md has a dependency-graph-traversal pass for transitive effort (P076)" {
|
|
180
|
-
# P076: review-problems is the executor for the WSJF transitive-effort
|
|
181
|
-
# rule. Step 2 assigns marginal effort; a second pass must walk
|
|
182
|
-
# `## Dependencies` edges and propagate effort per the canonical rule
|
|
183
|
-
# in /wr-itil:manage-problem's WSJF Prioritisation section. Without
|
|
184
|
-
# this pass, the marginal-only ranking mis-ranks dependent tickets
|
|
185
|
-
# above their blockers (the exact failure P076 documents).
|
|
186
|
-
run grep -inE "transitive[[:space:]]?effort|graph traversal|propagate.*effort|dependency[[:space:]-]?graph" "$SKILL_FILE"
|
|
187
|
-
[ "$status" -eq 0 ]
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
@test "SKILL.md transitive-effort pass cites P076 and the canonical rule location (traceability)" {
|
|
191
|
-
# Audit trail: the Step 2.5 block must cite P076 (motivation) and
|
|
192
|
-
# point to /wr-itil:manage-problem's WSJF section as the canonical
|
|
193
|
-
# definition — duplication would fork the contract.
|
|
194
|
-
run grep -n "P076" "$SKILL_FILE"
|
|
195
|
-
[ "$status" -eq 0 ]
|
|
196
|
-
run grep -inE "manage-problem.*WSJF|WSJF.*manage-problem|canonical" "$SKILL_FILE"
|
|
197
|
-
[ "$status" -eq 0 ]
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
@test "SKILL.md transitive re-rate message format matches the canonical shape (P076)" {
|
|
201
|
-
# Architect correction 4: the re-rate message must be greppable and
|
|
202
|
-
# consistent across skills. Shape: `P<NNN>: Effort <OLD> → <NEW>
|
|
203
|
-
# (transitive via <UPSTREAM>)`. review-problems emits this in step 3's
|
|
204
|
-
# summary output so downstream audit tools can grep the review log.
|
|
205
|
-
run grep -inE "Effort.*→.*transitive via|transitive via.*P[0-9]" "$SKILL_FILE"
|
|
206
|
-
[ "$status" -eq 0 ]
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
# --- P136 ADR-044 alignment: Step 4 close-on-evidence bucket routing ---
|
|
210
|
-
# tdd-review: structural-permitted — P081 bridge per the P136 Fix Strategy.
|
|
211
|
-
# Pins the Step 4 lazy-ask removal (close the evidence-backed subset
|
|
212
|
-
# mechanically; ask only the unobserved subset) so a future reword cannot
|
|
213
|
-
# silently revert to a per-ticket AskUserQuestion (the exact P136 regression
|
|
214
|
-
# class). Behavioural retrofit owned by P081 Phase 2.
|
|
215
|
-
|
|
216
|
-
@test "SKILL.md Step 4 closes the yes-observed subset on evidence without AskUserQuestion (P136 / ADR-044 + run-retro Step 4a)" {
|
|
217
|
-
run grep -inE "close-on-evidence" "$SKILL_FILE"
|
|
218
|
-
[ "$status" -eq 0 ]
|
|
219
|
-
run grep -inE "Do NOT fire one .AskUserQuestion. per ticket" "$SKILL_FILE"
|
|
220
|
-
[ "$status" -eq 0 ]
|
|
221
|
-
run grep -inE "ADR-044" "$SKILL_FILE"
|
|
222
|
-
[ "$status" -eq 0 ]
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
@test "SKILL.md Step 4 keeps the three-way split — ask no-not-observed, flip-back regressions (P136)" {
|
|
226
|
-
# Bucket 2 (no — not observed) still asks; Bucket 3 (no — observed
|
|
227
|
-
# regression) still flips back and is never batch-closed. Do not collapse
|
|
228
|
-
# the three-way routing to a two-way one (JTBD-201 audit-trail invariant).
|
|
229
|
-
run grep -inE "no — not observed" "$SKILL_FILE"
|
|
230
|
-
[ "$status" -eq 0 ]
|
|
231
|
-
run grep -inE "no — observed regression" "$SKILL_FILE"
|
|
232
|
-
[ "$status" -eq 0 ]
|
|
233
|
-
run grep -inE "flip-back" "$SKILL_FILE"
|
|
234
|
-
[ "$status" -eq 0 ]
|
|
235
|
-
}
|