@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,394 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
# tdd-review: structural-permitted (justification: P012 skill testing
|
|
4
|
-
# harness scope is open; no behavioural alternative for SKILL.md prose-
|
|
5
|
-
# template structural assertions today. ADR-052 Migration clause permits
|
|
6
|
-
# structural retrofit-via-justification when the linked harness-gap ticket
|
|
7
|
-
# has not yet shipped the primitives. The whole-file annotation covers all
|
|
8
|
-
# assertions in this fixture, including the P128 `## Versions` schema
|
|
9
|
-
# assertions added 2026-05-03.)
|
|
10
|
-
#
|
|
11
|
-
# Doc-lint structural test (Permitted Exception per ADR-005 — structural
|
|
12
|
-
# SKILL.md content checks, not behavioural). Mirrors the doc-lint pattern
|
|
13
|
-
# established in ADR-011 and ADR-027 Confirmation tests.
|
|
14
|
-
#
|
|
15
|
-
# Asserts the report-upstream skill's SKILL.md encodes the contract
|
|
16
|
-
# documented in ADR-024 Confirmation criterion 2:
|
|
17
|
-
# - template discovery step
|
|
18
|
-
# - security-path routing with SECURITY.md fallback
|
|
19
|
-
# - explicit ban on auto-public-issue for security-classified tickets
|
|
20
|
-
# - cross-reference back-write step
|
|
21
|
-
# - ADR-024 cross-reference
|
|
22
|
-
#
|
|
23
|
-
# Plus two architect-required additions surfaced during P055 Part B
|
|
24
|
-
# implementation review:
|
|
25
|
-
# - ADR-027 Step-0 deferral rationale present
|
|
26
|
-
# - ADR-028 voice-tone gate interaction documented
|
|
27
|
-
|
|
28
|
-
setup() {
|
|
29
|
-
REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
|
|
30
|
-
SKILL_MD="$REPO_ROOT/packages/itil/skills/report-upstream/SKILL.md"
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@test "report-upstream: SKILL.md exists" {
|
|
34
|
-
[ -f "$SKILL_MD" ]
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@test "report-upstream: SKILL.md documents template discovery via ISSUE_TEMPLATE (ADR-024 Confirmation 2.1)" {
|
|
38
|
-
run grep -F 'ISSUE_TEMPLATE' "$SKILL_MD"
|
|
39
|
-
[ "$status" -eq 0 ]
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@test "report-upstream: SKILL.md routes via SECURITY.md with explicit fallback (ADR-024 Confirmation 2.2)" {
|
|
43
|
-
run grep -ic 'SECURITY.md' "$SKILL_MD"
|
|
44
|
-
[ "$status" -eq 0 ]
|
|
45
|
-
[ "$output" -ge 2 ]
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@test "report-upstream: SKILL.md explicitly bans auto-opening a public issue for security-classified tickets (ADR-024 Confirmation 2.3)" {
|
|
49
|
-
run grep -iE 'never .*auto-open .*public issue' "$SKILL_MD"
|
|
50
|
-
[ "$status" -eq 0 ]
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@test "report-upstream: SKILL.md contains the cross-reference back-write step (ADR-024 Confirmation 2.4)" {
|
|
54
|
-
run grep -F '## Reported Upstream' "$SKILL_MD"
|
|
55
|
-
[ "$status" -eq 0 ]
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
@test "report-upstream: SKILL.md cross-references ADR-024 (ADR-024 Confirmation 2.5)" {
|
|
59
|
-
run grep -F 'ADR-024' "$SKILL_MD"
|
|
60
|
-
[ "$status" -eq 0 ]
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@test "report-upstream: SKILL.md documents the ADR-027 Step-0 deferral rationale (architect review)" {
|
|
64
|
-
run grep -F 'ADR-027' "$SKILL_MD"
|
|
65
|
-
[ "$status" -eq 0 ]
|
|
66
|
-
run grep -iE 'step.?0 deferral|step.?0' "$SKILL_MD"
|
|
67
|
-
[ "$status" -eq 0 ]
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
@test "report-upstream: SKILL.md documents the ADR-028 voice-tone gate interaction (architect review)" {
|
|
71
|
-
run grep -F 'ADR-028' "$SKILL_MD"
|
|
72
|
-
[ "$status" -eq 0 ]
|
|
73
|
-
run grep -iE 'voice-tone gate' "$SKILL_MD"
|
|
74
|
-
[ "$status" -eq 0 ]
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
@test "report-upstream: SKILL.md encodes three distinct AFK branches (architect review)" {
|
|
78
|
-
# Public-issue path / Security path with declared channel / Security path
|
|
79
|
-
# halt-and-surface / Above-appetite commit. The "AFK behaviour summary"
|
|
80
|
-
# table is the canonical place; assert its presence.
|
|
81
|
-
run grep -F 'AFK behaviour summary' "$SKILL_MD"
|
|
82
|
-
[ "$status" -eq 0 ]
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
# ─── ADR-024 2026-06-04 (P270) amendment: external-comms-gated AFK auto-fire ──
|
|
86
|
-
#
|
|
87
|
-
# The 2026-06-04 amendment reverses the pre-amendment blanket-defer in AFK
|
|
88
|
-
# (line 137 "AFK orchestrators should never auto-report a security-classified
|
|
89
|
-
# ticket") to a per-classification external-comms gated branching. Below-
|
|
90
|
-
# appetite proceeds; above-appetite risk-reduces then queues per P352.
|
|
91
|
-
|
|
92
|
-
@test "report-upstream: SKILL.md AFK behaviour summary cites external-comms gate as authority (ADR-024 2026-06-04 P270 amendment)" {
|
|
93
|
-
# The external-comms gate must appear in the AFK summary table as the
|
|
94
|
-
# per-classification routing authority — at minimum on the public-issue,
|
|
95
|
-
# dedup, security-with-channel, and security-without-channel rows.
|
|
96
|
-
run grep -iE 'wr-risk-scorer:external-comms' "$SKILL_MD"
|
|
97
|
-
[ "$status" -eq 0 ]
|
|
98
|
-
# At least 4 occurrences in SKILL.md (one per AFK row in the summary plus
|
|
99
|
-
# at least one prose occurrence in Step 6 prose).
|
|
100
|
-
hits=$(grep -ic 'wr-risk-scorer:external-comms' "$SKILL_MD")
|
|
101
|
-
[ "$hits" -ge 4 ]
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@test "report-upstream: SKILL.md AFK summary cites P270 amendment as authority (ADR-024 2026-06-04)" {
|
|
105
|
-
run grep -iE '2026-06-04.*P270|P270.*2026-06-04' "$SKILL_MD"
|
|
106
|
-
[ "$status" -eq 0 ]
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
@test "report-upstream: SKILL.md AFK above-appetite branch queues per P352 queue-and-continue (P270 amendment)" {
|
|
110
|
-
# The above-appetite branch on ANY AFK row must reference queue-and-continue
|
|
111
|
-
# (P352) rather than halt-the-orchestrator semantics for the pre-amendment
|
|
112
|
-
# blanket-defer rule.
|
|
113
|
-
run grep -iE 'P352|queue-and-continue' "$SKILL_MD"
|
|
114
|
-
[ "$status" -eq 0 ]
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
@test "report-upstream: SKILL.md marks the pre-amendment never-auto-public ban as superseded (P270 amendment)" {
|
|
118
|
-
# The legacy "Never auto-open a public issue for a security-classified
|
|
119
|
-
# ticket" prose is retained for traceability but must be marked as
|
|
120
|
-
# superseded by the 2026-06-04 amendment so readers do not act on the
|
|
121
|
-
# superseded rule.
|
|
122
|
-
run grep -iE 'superseded.*2026-06-04|2026-06-04.*supersed' "$SKILL_MD"
|
|
123
|
-
[ "$status" -eq 0 ]
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
@test "report-upstream: SKILL.md drops the 'interim static heuristic' deferral on the dedup branch (P070 lift-condition met per P270 amendment)" {
|
|
127
|
-
# The 2026-04-25 (P070) amendment named the dedup-AFK as an "interim static
|
|
128
|
-
# heuristic in force until wr-risk-scorer:external-comms ships". The agent
|
|
129
|
-
# has shipped; the 2026-06-04 (P270) amendment lifts the deferral. The
|
|
130
|
-
# AFK summary's dedup-path row must cite the LIFT, not the deferral.
|
|
131
|
-
run grep -iE 'interim static heuristic.*lifted|deferral.*lifted|LIFTED' "$SKILL_MD"
|
|
132
|
-
[ "$status" -eq 0 ]
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
# ─── ADR-033 problem-first classifier contract (P067) ──────────────────────────
|
|
136
|
-
#
|
|
137
|
-
# ADR-033 partially supersedes ADR-024 Decision Outcome Steps 3 + 5 with a
|
|
138
|
-
# problem-first classifier and a problem-shaped structured default body. The
|
|
139
|
-
# following assertions pin the SKILL.md to ADR-033's Confirmation clauses
|
|
140
|
-
# (lines 157-164 of the ADR).
|
|
141
|
-
|
|
142
|
-
@test "report-upstream: SKILL.md cross-references ADR-033 (ADR-033 Confirmation)" {
|
|
143
|
-
run grep -F 'ADR-033' "$SKILL_MD"
|
|
144
|
-
[ "$status" -eq 0 ]
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
@test "report-upstream: SKILL.md Step 3 classifier lists problem-first tokens (ADR-033 Step 3)" {
|
|
148
|
-
# Primary classifier tokens per ADR-033: problem / issue / concern / defect / gap.
|
|
149
|
-
# All five must appear in the SKILL.md classifier narrative.
|
|
150
|
-
for token in problem issue concern defect gap; do
|
|
151
|
-
run grep -iE "\`${token}\`|\"${token}\"|'${token}'|${token} shape|${token}," "$SKILL_MD"
|
|
152
|
-
[ "$status" -eq 0 ] || {
|
|
153
|
-
echo "missing classifier token: $token"
|
|
154
|
-
return 1
|
|
155
|
-
}
|
|
156
|
-
done
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
@test "report-upstream: SKILL.md template-discovery cites problem-report.yml first (ADR-033 Step 3)" {
|
|
160
|
-
# Preference order: problem-report.yml / problem.yml BEFORE bug-report.yml.
|
|
161
|
-
run grep -n 'problem-report.yml' "$SKILL_MD"
|
|
162
|
-
[ "$status" -eq 0 ]
|
|
163
|
-
problem_line=$(grep -n 'problem-report.yml' "$SKILL_MD" | head -1 | cut -d: -f1)
|
|
164
|
-
bug_line=$(grep -n 'bug-report.yml' "$SKILL_MD" | head -1 | cut -d: -f1)
|
|
165
|
-
[ -n "$problem_line" ] && [ -n "$bug_line" ]
|
|
166
|
-
[ "$problem_line" -lt "$bug_line" ]
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
@test "report-upstream: SKILL.md retains bug/feature/question fallbacks (ADR-033 Step 3 backward compat)" {
|
|
170
|
-
# Backward-compat fallbacks must still be documented for upstreams that
|
|
171
|
-
# have not adopted problem-first templates.
|
|
172
|
-
run grep -F 'bug-report.yml' "$SKILL_MD"
|
|
173
|
-
[ "$status" -eq 0 ]
|
|
174
|
-
run grep -F 'feature-request.yml' "$SKILL_MD"
|
|
175
|
-
[ "$status" -eq 0 ]
|
|
176
|
-
run grep -F 'question.yml' "$SKILL_MD"
|
|
177
|
-
[ "$status" -eq 0 ]
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
@test "report-upstream: SKILL.md structured default uses problem-shaped section order (ADR-033 Step 5, amended 2026-05-03 P128)" {
|
|
181
|
-
# Problem-shaped default body per ADR-033 (amended 2026-05-03 by P128):
|
|
182
|
-
# Description -> Symptoms -> Workaround -> Affected plugin / component ->
|
|
183
|
-
# Frequency -> Versions (was Environment pre-amendment) -> Evidence ->
|
|
184
|
-
# Cross-reference. Assert section order in the primary default block.
|
|
185
|
-
#
|
|
186
|
-
# P140 fix-and-continue (Step 6.5 closed allow-list, P081-class stale-grep):
|
|
187
|
-
# iter 16's P128 amendment added a `## Versions` section to the structured
|
|
188
|
-
# default block (~line 293) but TWO other `## Versions` sections coexist —
|
|
189
|
-
# the "Drafted Upstream Report" block (~line 247) and the issue-shaped
|
|
190
|
-
# example block (~line 335). A bare `head -1` picks the earliest match
|
|
191
|
-
# (line 247) and breaks the order assertion `freq_line < versions_line`.
|
|
192
|
-
# Scope the `versions_line` lookup to between `freq_line` and `evidence_line`
|
|
193
|
-
# via awk range so we pick the structured-default block's Versions header.
|
|
194
|
-
# Architect note 2026-05-03: if a second section-name-collides-across-blocks
|
|
195
|
-
# test ever needs the same awk-range scoping, factor a
|
|
196
|
-
# `bats_helpers/section_in_block.bash` helper (P012 / ADR-052 amendment).
|
|
197
|
-
desc_line=$(grep -n '^## Description$' "$SKILL_MD" | head -1 | cut -d: -f1)
|
|
198
|
-
symptoms_line=$(grep -n '^## Symptoms$' "$SKILL_MD" | head -1 | cut -d: -f1)
|
|
199
|
-
workaround_line=$(grep -n '^## Workaround$' "$SKILL_MD" | head -1 | cut -d: -f1)
|
|
200
|
-
affected_line=$(grep -nE '^## Affected plugin' "$SKILL_MD" | head -1 | cut -d: -f1)
|
|
201
|
-
freq_line=$(grep -n '^## Frequency$' "$SKILL_MD" | head -1 | cut -d: -f1)
|
|
202
|
-
evidence_line=$(grep -n '^## Evidence$' "$SKILL_MD" | head -1 | cut -d: -f1)
|
|
203
|
-
xref_line=$(grep -n '^## Cross-reference$' "$SKILL_MD" | head -1 | cut -d: -f1)
|
|
204
|
-
versions_line=$(awk -v lo="${freq_line:-${desc_line:-1}}" -v hi="${evidence_line:-9999}" 'NR>lo && NR<hi && /^## Versions$/{print NR; exit}' "$SKILL_MD")
|
|
205
|
-
|
|
206
|
-
[ -n "$desc_line" ] || { echo "missing ## Description"; return 1; }
|
|
207
|
-
[ -n "$symptoms_line" ] || { echo "missing ## Symptoms"; return 1; }
|
|
208
|
-
[ -n "$workaround_line" ] || { echo "missing ## Workaround"; return 1; }
|
|
209
|
-
[ -n "$affected_line" ] || { echo "missing ## Affected plugin / component"; return 1; }
|
|
210
|
-
[ -n "$freq_line" ] || { echo "missing ## Frequency"; return 1; }
|
|
211
|
-
[ -n "$versions_line" ] || { echo "missing ## Versions"; return 1; }
|
|
212
|
-
[ -n "$evidence_line" ] || { echo "missing ## Evidence"; return 1; }
|
|
213
|
-
[ -n "$xref_line" ] || { echo "missing ## Cross-reference"; return 1; }
|
|
214
|
-
|
|
215
|
-
[ "$desc_line" -lt "$symptoms_line" ]
|
|
216
|
-
[ "$symptoms_line" -lt "$workaround_line" ]
|
|
217
|
-
[ "$workaround_line" -lt "$affected_line" ]
|
|
218
|
-
[ "$affected_line" -lt "$freq_line" ]
|
|
219
|
-
[ "$freq_line" -lt "$versions_line" ]
|
|
220
|
-
[ "$versions_line" -lt "$evidence_line" ]
|
|
221
|
-
[ "$evidence_line" -lt "$xref_line" ]
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
@test "report-upstream: SKILL.md cites ADR-033 as authority for Steps 3 + 5 (ADR-033 Confirmation)" {
|
|
225
|
-
# ADR-033 must be cited near the Step 3 / Step 5 headings, not only in the
|
|
226
|
-
# References section, so future maintainers see the authority inline.
|
|
227
|
-
run grep -niE 'adr-033|033.*problem-first' "$SKILL_MD"
|
|
228
|
-
[ "$status" -eq 0 ]
|
|
229
|
-
[ "${#lines[@]}" -ge 2 ]
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
# ─── P070 dedup contract (Step 4b + Step 5c + AFK static heuristic) ────────────
|
|
233
|
-
#
|
|
234
|
-
# P070 inserts a dedup check between security-path routing (Step 4) and the
|
|
235
|
-
# outbound `gh` call (Steps 5 / 6). Two duplication windows close at the same
|
|
236
|
-
# insertion point: own re-run (local ticket already has `## Reported Upstream`)
|
|
237
|
-
# and third-party search (different reporter filed similar). Step 5c adds a
|
|
238
|
-
# comment-on-existing-issue path used when the dedup branch finds a match.
|
|
239
|
-
#
|
|
240
|
-
# Per architect verdict on P070: the maintainer-annoyance risk evaluator is
|
|
241
|
-
# deferred until ADR-028 / P064's `wr-risk-scorer:external-comms` subagent
|
|
242
|
-
# ships (ADR-028 line 117 anticipates third evaluators). The interim AFK
|
|
243
|
-
# branch uses a static heuristic — no subagent dispatch — that defaults to
|
|
244
|
-
# halt-and-save.
|
|
245
|
-
|
|
246
|
-
@test "report-upstream: SKILL.md contains a Step 4b dedup check (P070)" {
|
|
247
|
-
run grep -nE '^### 4b\.' "$SKILL_MD"
|
|
248
|
-
[ "$status" -eq 0 ]
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
@test "report-upstream: SKILL.md Step 4b.1 detects own-re-run via ## Reported Upstream (P070)" {
|
|
252
|
-
# Own-re-run branch: grep the local ticket for an existing `## Reported
|
|
253
|
-
# Upstream` URL before firing a second upstream report.
|
|
254
|
-
run grep -nE 'Reported Upstream.*(grep|already|existing|previous)' "$SKILL_MD"
|
|
255
|
-
[ "$status" -eq 0 ]
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
@test "report-upstream: SKILL.md Step 4b.2 third-party search uses gh issue list --search (P070)" {
|
|
259
|
-
# Third-party branch: `gh issue list --repo ... --search ...` against the
|
|
260
|
-
# upstream's existing issues. Required tokens.
|
|
261
|
-
run grep -F 'gh issue list' "$SKILL_MD"
|
|
262
|
-
[ "$status" -eq 0 ]
|
|
263
|
-
# `--` before the pattern stops grep from treating `--search` as a flag.
|
|
264
|
-
run grep -F -- '--search' "$SKILL_MD"
|
|
265
|
-
[ "$status" -eq 0 ]
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
@test "report-upstream: SKILL.md Step 4b.2 uses inline LLM judge, not subagent dispatch (P070 Direction decision 2026-04-21)" {
|
|
269
|
-
# Direction decision pins inline LLM check inside the skill's own session.
|
|
270
|
-
# No `wr-itil:dedup-check` subagent dispatch; future promotion is a separate
|
|
271
|
-
# ADR amendment.
|
|
272
|
-
run grep -iE 'inline.*llm|inline semantic|inline.*judge|inline classification' "$SKILL_MD"
|
|
273
|
-
[ "$status" -eq 0 ]
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
@test "report-upstream: SKILL.md contains Step 5c comment path with gh issue comment (P070)" {
|
|
277
|
-
# Step 5c: when dedup match found AND user picks "comment instead", run
|
|
278
|
-
# `gh issue comment <number>` rather than `gh issue create`.
|
|
279
|
-
run grep -nE '^### 5c\.' "$SKILL_MD"
|
|
280
|
-
[ "$status" -eq 0 ]
|
|
281
|
-
run grep -F 'gh issue comment' "$SKILL_MD"
|
|
282
|
-
[ "$status" -eq 0 ]
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
@test "report-upstream: SKILL.md Step 5c records commented-on-existing-issue disclosure path (P070 + ADR-024 amendment)" {
|
|
286
|
-
# ADR-024 amendment extends the disclosure-path enumeration. The literal
|
|
287
|
-
# string MUST appear in the SKILL.md so the ## Reported Upstream back-write
|
|
288
|
-
# records the new path.
|
|
289
|
-
run grep -F 'commented-on-existing-issue' "$SKILL_MD"
|
|
290
|
-
[ "$status" -eq 0 ]
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
@test "report-upstream: SKILL.md AFK branch uses static heuristic, defers maintainer-annoyance evaluator (P070 interim per ADR-028 line 117)" {
|
|
294
|
-
# Architect verdict: maintainer-annoyance evaluator deferred. AFK branch
|
|
295
|
-
# uses a static heuristic and defaults to halt-and-save. The SKILL.md must
|
|
296
|
-
# name the deferral explicitly so future readers know why the static-heuristic
|
|
297
|
-
# path exists; once `wr-risk-scorer:external-comms` lands, this branch
|
|
298
|
-
# gets re-wired.
|
|
299
|
-
run grep -iE 'static heuristic|interim.*heuristic|heuristic.*interim' "$SKILL_MD"
|
|
300
|
-
[ "$status" -eq 0 ]
|
|
301
|
-
run grep -iE 'wr-risk-scorer:external-comms|external-comms.*evaluator' "$SKILL_MD"
|
|
302
|
-
[ "$status" -eq 0 ]
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
@test "report-upstream: SKILL.md AFK halt-and-save writes Drafted Upstream Report section (P070 + ADR-024 Consequences)" {
|
|
306
|
-
# AFK halt branch saves the drafted report to the local ticket's
|
|
307
|
-
# `## Drafted Upstream Report` section — same pattern as the security-path
|
|
308
|
-
# halt per ADR-024 Consequences (lines 116, 123).
|
|
309
|
-
run grep -F '## Drafted Upstream Report' "$SKILL_MD"
|
|
310
|
-
[ "$status" -eq 0 ]
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
@test "report-upstream: SKILL.md AFK behaviour summary table includes the dedup branch (P070)" {
|
|
314
|
-
# The "AFK behaviour summary" table at the bottom of the skill must list
|
|
315
|
-
# the new dedup-halt branch alongside the existing public-issue / security
|
|
316
|
-
# / above-appetite branches.
|
|
317
|
-
run grep -iE 'dedup.*halt|step 4b.*halt|halt.*dedup|halt-and-save.*dedup' "$SKILL_MD"
|
|
318
|
-
[ "$status" -eq 0 ]
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
# ─── P128 consolidated Versions schema (ADR-033 amendment 2026-05-03) ─────────
|
|
322
|
-
#
|
|
323
|
-
# P128 reshapes Step 5's structured default body: the freeform `## Environment`
|
|
324
|
-
# section becomes a labelled `## Versions` section carrying a fixed five-field
|
|
325
|
-
# schema. Missing fields render as `not detected` (normative MUST per the
|
|
326
|
-
# ADR-033 amendment 2026-05-03). The reshape applies to the problem-shaped
|
|
327
|
-
# default AND the bug-shaped fallback default.
|
|
328
|
-
|
|
329
|
-
@test "report-upstream: SKILL.md problem-shaped default body includes ## Versions section (P128)" {
|
|
330
|
-
# The labelled `## Versions` section MUST appear in the SKILL.md so the
|
|
331
|
-
# structured default emits it. Two occurrences expected: one in the
|
|
332
|
-
# field-mapping table's Versions-schema block, one in the problem-shaped
|
|
333
|
-
# default body, and one in the bug-shaped fallback default body — but the
|
|
334
|
-
# minimum invariant is that the section header exists.
|
|
335
|
-
run grep -F '## Versions' "$SKILL_MD"
|
|
336
|
-
[ "$status" -eq 0 ]
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
@test "report-upstream: SKILL.md ## Versions schema lists all five fields (P128)" {
|
|
340
|
-
# Five-field schema per the ADR-033 amendment 2026-05-03: Local plugin,
|
|
341
|
-
# Upstream package, Claude Code CLI, Node, OS. All five labels must appear
|
|
342
|
-
# in the SKILL.md so the structured default's Versions block emits them.
|
|
343
|
-
run grep -iE '^- Local plugin:' "$SKILL_MD"
|
|
344
|
-
[ "$status" -eq 0 ]
|
|
345
|
-
run grep -iE '^- Upstream package:' "$SKILL_MD"
|
|
346
|
-
[ "$status" -eq 0 ]
|
|
347
|
-
run grep -iE '^- Claude Code CLI:' "$SKILL_MD"
|
|
348
|
-
[ "$status" -eq 0 ]
|
|
349
|
-
run grep -iE '^- Node:' "$SKILL_MD"
|
|
350
|
-
[ "$status" -eq 0 ]
|
|
351
|
-
run grep -iE '^- OS:' "$SKILL_MD"
|
|
352
|
-
[ "$status" -eq 0 ]
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
@test "report-upstream: SKILL.md documents not-detected rendering rule for missing version fields (P128)" {
|
|
356
|
-
# Normative rendering rule: missing fields render as "not detected".
|
|
357
|
-
# The literal string MUST appear in the SKILL.md so triage distinguishes
|
|
358
|
-
# field-not-applicable from detection-failed.
|
|
359
|
-
run grep -iE '"not detected"|`not detected`' "$SKILL_MD"
|
|
360
|
-
[ "$status" -eq 0 ]
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
@test "report-upstream: SKILL.md cites ADR-033 amendment authority for the Versions schema (P128)" {
|
|
364
|
-
# The Versions schema authority sits in ADR-033's `## Amendments` section
|
|
365
|
-
# dated 2026-05-03. The SKILL.md must cite the amendment so future readers
|
|
366
|
-
# see the authority inline alongside the schema.
|
|
367
|
-
run grep -iE 'ADR-033 amendment|amendment 2026-05-03' "$SKILL_MD"
|
|
368
|
-
[ "$status" -eq 0 ]
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
@test "report-upstream: SKILL.md documents auto-population sources for each Versions field (P128)" {
|
|
372
|
-
# Auto-population sources: package.json / claude plugin list, gh api releases
|
|
373
|
-
# or npm view, claude --version, node --version, uname -srm. The SKILL.md
|
|
374
|
-
# must enumerate the sources so the LLM-driven skill knows where to look.
|
|
375
|
-
run grep -F 'claude --version' "$SKILL_MD"
|
|
376
|
-
[ "$status" -eq 0 ]
|
|
377
|
-
run grep -F 'node --version' "$SKILL_MD"
|
|
378
|
-
[ "$status" -eq 0 ]
|
|
379
|
-
run grep -F 'uname -srm' "$SKILL_MD"
|
|
380
|
-
[ "$status" -eq 0 ]
|
|
381
|
-
run grep -F 'npm view' "$SKILL_MD"
|
|
382
|
-
[ "$status" -eq 0 ]
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
@test "report-upstream: SKILL.md problem-shaped default body no longer uses freeform ## Environment section (P128)" {
|
|
386
|
-
# The problem-shaped default body (lines under "#### Structured default body
|
|
387
|
-
# — problem-shaped (primary, per ADR-033)") MUST NOT contain a `## Environment`
|
|
388
|
-
# section header per the ADR-033 amendment 2026-05-03. The bug-shaped fallback
|
|
389
|
-
# also retired its `## Environment` section. We assert the headers are absent
|
|
390
|
-
# from the SKILL.md (the field-mapping table's reference to `os` field as a
|
|
391
|
-
# template-slot remains, but the top-level section header should be gone).
|
|
392
|
-
run grep -nE '^## Environment$' "$SKILL_MD"
|
|
393
|
-
[ "$status" -ne 0 ]
|
|
394
|
-
}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
# Contract assertions for /wr-itil:restore-incident (P071 split slice 6b).
|
|
3
|
-
#
|
|
4
|
-
# This skill hosts the "mark an incident as restored" user intent previously
|
|
5
|
-
# hidden behind /wr-itil:manage-incident <I> restored. It transitions an
|
|
6
|
-
# incident from .mitigating.md to .restored.md, updates the Status field,
|
|
7
|
-
# appends a "Service restored" timeline entry, and invokes the Skill tool
|
|
8
|
-
# to hand off to /wr-itil:manage-problem for linked-problem creation /
|
|
9
|
-
# update per ADR-011's Decision Outcome point 4.
|
|
10
|
-
#
|
|
11
|
-
# Structural assertion — Permitted Exception to the source-grep ban
|
|
12
|
-
# (ADR-005 / P011 / ADR-037 contract-assertion pattern).
|
|
13
|
-
#
|
|
14
|
-
# @problem P071
|
|
15
|
-
# @jtbd JTBD-001 (enforce governance without slowing down — discoverable surface)
|
|
16
|
-
# @jtbd JTBD-101 (extend the suite with clear patterns — one skill per distinct user intent)
|
|
17
|
-
# @jtbd JTBD-201 (restore service fast with an audit trail — this skill IS the active-restoration path)
|
|
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-011 — manage-incident skill-wrapping precedent (cross-skill Skill-tool invocation to manage-problem)
|
|
23
|
-
# ADR-037 — contract-assertion bats pattern
|
|
24
|
-
|
|
25
|
-
setup() {
|
|
26
|
-
SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
|
|
27
|
-
SKILL_FILE="${SKILL_DIR}/SKILL.md"
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@test "SKILL.md exists and has frontmatter" {
|
|
31
|
-
[ -f "$SKILL_FILE" ]
|
|
32
|
-
run head -1 "$SKILL_FILE"
|
|
33
|
-
[ "$status" -eq 0 ]
|
|
34
|
-
[ "$output" = "---" ]
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@test "SKILL.md frontmatter name is wr-itil:restore-incident (P071 + ADR-010 amended)" {
|
|
38
|
-
# Split naming convention per ADR-010 amendment: <verb>-<object> pair.
|
|
39
|
-
# The new skill's name must match the phased-landing plan pinned in P071.
|
|
40
|
-
run grep -n "^name: wr-itil:restore-incident$" "$SKILL_FILE"
|
|
41
|
-
[ "$status" -eq 0 ]
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@test "SKILL.md frontmatter description names the restore intent (P071)" {
|
|
45
|
-
# Description must name "restore" and "incident" so Claude Code autocomplete
|
|
46
|
-
# surfaces the user intent rather than a generic name.
|
|
47
|
-
run grep -inE "^description:.*restor.*incident|^description:.*incident.*restor|^description:.*service restored" "$SKILL_FILE"
|
|
48
|
-
[ "$status" -eq 0 ]
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@test "SKILL.md frontmatter allowed-tools grants file-mutation + Skill surface (P071 — restore requires rename + handoff)" {
|
|
52
|
-
# restore-incident renames .mitigating.md → .restored.md, updates the
|
|
53
|
-
# Status field, and invokes /wr-itil:manage-problem via the Skill tool.
|
|
54
|
-
# AskUserQuestion is required for the problem-handoff prompt (yes /
|
|
55
|
-
# no-with-justification) per ADR-011 Decision Outcome point 4.
|
|
56
|
-
run grep -nE "^allowed-tools:" "$SKILL_FILE"
|
|
57
|
-
[ "$status" -eq 0 ]
|
|
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
|
-
run grep -nE "^allowed-tools:.*Bash" "$SKILL_FILE"
|
|
63
|
-
[ "$status" -eq 0 ]
|
|
64
|
-
run grep -nE "^allowed-tools:.*AskUserQuestion" "$SKILL_FILE"
|
|
65
|
-
[ "$status" -eq 0 ]
|
|
66
|
-
run grep -nE "^allowed-tools:.*Skill" "$SKILL_FILE"
|
|
67
|
-
[ "$status" -eq 0 ]
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
@test "SKILL.md documents the .mitigating.md → .restored.md rename (P071 + ADR-011)" {
|
|
71
|
-
# The restore transition renames the incident file from .mitigating.md
|
|
72
|
-
# to .restored.md. The SKILL.md must name both suffixes explicitly so
|
|
73
|
-
# the file-suffix contract is legible.
|
|
74
|
-
run grep -inE "\.mitigating\.md" "$SKILL_FILE"
|
|
75
|
-
[ "$status" -eq 0 ]
|
|
76
|
-
run grep -inE "\.restored\.md" "$SKILL_FILE"
|
|
77
|
-
[ "$status" -eq 0 ]
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@test "SKILL.md documents the verification-signal pre-flight (P071 + ADR-011)" {
|
|
81
|
-
# Per ADR-011, restore requires at least one recorded mitigation attempt
|
|
82
|
-
# AND a captured verification signal (e.g. "error rate back to baseline
|
|
83
|
-
# per Datadog", "user reports normal", "synthetic probe passing").
|
|
84
|
-
# The SKILL.md must name the verification-signal check explicitly.
|
|
85
|
-
run grep -inE "verification signal|verify|verification" "$SKILL_FILE"
|
|
86
|
-
[ "$status" -eq 0 ]
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
@test "SKILL.md documents the manage-problem handoff via the Skill tool (P071 + ADR-011 Decision Outcome 4)" {
|
|
90
|
-
# The restore transition hands off to /wr-itil:manage-problem via the
|
|
91
|
-
# Skill tool so a problem record is created or updated with the timeline
|
|
92
|
-
# summary + top-ranked hypothesis + mitigation + verification signal.
|
|
93
|
-
# The SKILL.md must name the handoff target so the cross-skill
|
|
94
|
-
# invocation is legible.
|
|
95
|
-
run grep -inE "wr-itil:manage-problem|manage-problem" "$SKILL_FILE"
|
|
96
|
-
[ "$status" -eq 0 ]
|
|
97
|
-
run grep -inE "Skill tool|via the Skill" "$SKILL_FILE"
|
|
98
|
-
[ "$status" -eq 0 ]
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@test "SKILL.md documents the 'no problem required' justification path (P071 + ADR-011)" {
|
|
102
|
-
# Per ADR-011, the user may decline problem creation with a documented
|
|
103
|
-
# justification (e.g. "one-off cosmic-bit-flip; not reproducible"). The
|
|
104
|
-
# SKILL.md must document the No Problem section write so the audit
|
|
105
|
-
# trail invariant (JTBD-201) is preserved post-split.
|
|
106
|
-
run grep -inE "No Problem|no problem required|no-problem" "$SKILL_FILE"
|
|
107
|
-
[ "$status" -eq 0 ]
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
@test "SKILL.md cites P071 and ADR-010 amended (P071 + ADR-025)" {
|
|
111
|
-
# ADR-025 inheritance per ADR-037: contract-assertion bats should reflect
|
|
112
|
-
# traceability cites on the skill spec document.
|
|
113
|
-
run grep -inE "P071|ADR-010" "$SKILL_FILE"
|
|
114
|
-
[ "$status" -eq 0 ]
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
@test "SKILL.md cites ADR-011 for the incident lifecycle conventions (P071 + ADR-011)" {
|
|
118
|
-
# restore-incident inherits file-suffix conventions and the handoff
|
|
119
|
-
# contract from ADR-011. The SKILL.md must cite ADR-011 so the
|
|
120
|
-
# precedent chain is legible.
|
|
121
|
-
run grep -inE "ADR-011" "$SKILL_FILE"
|
|
122
|
-
[ "$status" -eq 0 ]
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
@test "SKILL.md does not carry a deprecated-arguments frontmatter flag (clean-split skill)" {
|
|
126
|
-
# restore-incident is a clean-split skill with no argument-subcommands
|
|
127
|
-
# itself (its argument is a data parameter — incident ID only).
|
|
128
|
-
# ADR-010 amendment's `deprecated-arguments: true` flag is only valid
|
|
129
|
-
# on host skills with forwarder routes. restore-incident is a
|
|
130
|
-
# forwarder TARGET, not a host. It must NOT carry the flag.
|
|
131
|
-
run grep -E "^deprecated-arguments:" "$SKILL_FILE"
|
|
132
|
-
[ "$status" -ne 0 ]
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
@test "SKILL.md does not use word-argument subcommand branching (P071 regression guard)" {
|
|
136
|
-
# The whole point of P071: Claude Code autocomplete does not surface
|
|
137
|
-
# word-argument subcommands. A clean-split skill must not reintroduce
|
|
138
|
-
# word-arg subcommand routing (e.g. `list` / `mitigate` / `restore`).
|
|
139
|
-
# The data parameter <I> is a string, not a verb keyword.
|
|
140
|
-
run grep -inE "If arguments start with \"(list|mitigate|restore|close|link)\"|If arguments contain \"(list|mitigate|restore|close|link)\"" "$SKILL_FILE"
|
|
141
|
-
[ "$status" -ne 0 ]
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
# --- P136 ADR-044 alignment: argument-backfill fail-fast ---
|
|
145
|
-
# tdd-review: structural-permitted — P081 bridge per the P136 Fix Strategy.
|
|
146
|
-
# Pins the lazy-AskUserQuestion removal so a future reword cannot silently
|
|
147
|
-
# reintroduce the typo-class <I###> argument-backfill ask (the exact P136
|
|
148
|
-
# regression class). Behavioural retrofit owned by P081 Phase 2.
|
|
149
|
-
|
|
150
|
-
@test "SKILL.md fails fast on missing/malformed <I###> — no AskUserQuestion for ID backfill (P136 / ADR-044 Surface 1)" {
|
|
151
|
-
# ADR-044 framework-mediated: argument shape is a typo-class signal resolved
|
|
152
|
-
# by fail-fast + usage block, NOT a user decision. Mirrors mitigate-incident
|
|
153
|
-
# Surface 1. Regression guard: the old "ask via AskUserQuestion for the
|
|
154
|
-
# incident ID" backfill prose must NOT return.
|
|
155
|
-
run grep -inE "ask via .AskUserQuestion. for the incident ID" "$SKILL_FILE"
|
|
156
|
-
[ "$status" -ne 0 ]
|
|
157
|
-
run grep -inE "fail-fast|emit the usage block below and exit" "$SKILL_FILE"
|
|
158
|
-
[ "$status" -eq 0 ]
|
|
159
|
-
run grep -inE "fire .AskUserQuestion. for argument backfill" "$SKILL_FILE"
|
|
160
|
-
[ "$status" -eq 0 ]
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
@test "SKILL.md keeps the genuine user-authority asks after the fail-fast scope-down (P136 / ADR-044)" {
|
|
164
|
-
# The fail-fast scopes to the <I###> ID ONLY. The cat-2 evidence pre-flight
|
|
165
|
-
# and cat-1 problem-handoff asks remain interactive — do not over-remove.
|
|
166
|
-
run grep -inE "ADR-044" "$SKILL_FILE"
|
|
167
|
-
[ "$status" -eq 0 ]
|
|
168
|
-
run grep -nE "^allowed-tools:.*AskUserQuestion" "$SKILL_FILE"
|
|
169
|
-
[ "$status" -eq 0 ]
|
|
170
|
-
}
|