@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,171 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
# Functional tests for the manage-incident skill (Option A-lite per ADR-011).
|
|
3
|
-
#
|
|
4
|
-
# Scope: execute the bash fragments the SKILL.md instructs Claude to run
|
|
5
|
-
# (ID assignment, file-path construction, directory creation) and assert on
|
|
6
|
-
# the mocked Skill-tool handoff contract between manage-incident and
|
|
7
|
-
# manage-problem. Source-grep assertions on SKILL.md prose are NOT used
|
|
8
|
-
# (P011 ban). A single structural check asserts SKILL.md exists and has
|
|
9
|
-
# frontmatter — file-existence checks are a Permitted Exception per ADR-005.
|
|
10
|
-
|
|
11
|
-
setup() {
|
|
12
|
-
SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
|
|
13
|
-
SKILL_FILE="${SKILL_DIR}/SKILL.md"
|
|
14
|
-
|
|
15
|
-
TEST_ROOT="$(mktemp -d "${TMPDIR:-/tmp}/manage-incident-bats-XXXXXX")"
|
|
16
|
-
INCIDENTS_DIR="${TEST_ROOT}/docs/incidents"
|
|
17
|
-
PROBLEMS_DIR="${TEST_ROOT}/docs/problems"
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
teardown() {
|
|
21
|
-
rm -rf "$TEST_ROOT"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
# --- Fragment: next-ID computation (I###) ---
|
|
25
|
-
# SKILL.md instructs: scan docs/incidents/ for existing I<NNN> files, take the
|
|
26
|
-
# highest numeric ID, increment by 1, zero-pad to 3 digits.
|
|
27
|
-
next_incident_id() {
|
|
28
|
-
local dir="$1"
|
|
29
|
-
local last
|
|
30
|
-
last=$(ls "$dir"/I*.md 2>/dev/null | sed 's/.*\///' | grep -oE '^I[0-9]+' | sed 's/^I//' | sort -n | tail -1)
|
|
31
|
-
if [[ -z "$last" ]]; then
|
|
32
|
-
printf 'I001'
|
|
33
|
-
else
|
|
34
|
-
printf 'I%03d' $((10#$last + 1))
|
|
35
|
-
fi
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
# --- Fragment: file path construction ---
|
|
39
|
-
incident_path() {
|
|
40
|
-
local dir="$1" id="$2" slug="$3" status="$4"
|
|
41
|
-
printf '%s/%s-%s.%s.md' "$dir" "$id" "$slug" "$status"
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
# --- Mock: Skill-tool invocation contract ---
|
|
45
|
-
# The SKILL.md instructs Claude to invoke wr-itil:manage-problem via the
|
|
46
|
-
# Skill tool on restoration. The contract (skill name + argument shape) is
|
|
47
|
-
# asserted by a mock that writes the payload to a file the test reads back.
|
|
48
|
-
invoke_skill_mock() {
|
|
49
|
-
local tool="$1" skill="$2" args="$3"
|
|
50
|
-
printf '%s\n%s\n%s\n' "$tool" "$skill" "$args" > "${TEST_ROOT}/skill-invocation.log"
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
# ---- Tests ----
|
|
54
|
-
|
|
55
|
-
@test "SKILL.md exists and has frontmatter" {
|
|
56
|
-
[ -f "$SKILL_FILE" ]
|
|
57
|
-
run head -1 "$SKILL_FILE"
|
|
58
|
-
[ "$status" -eq 0 ]
|
|
59
|
-
[ "$output" = "---" ]
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
@test "next_incident_id returns I001 when docs/incidents is empty" {
|
|
63
|
-
mkdir -p "$INCIDENTS_DIR"
|
|
64
|
-
run next_incident_id "$INCIDENTS_DIR"
|
|
65
|
-
[ "$status" -eq 0 ]
|
|
66
|
-
[ "$output" = "I001" ]
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
@test "next_incident_id returns I001 when docs/incidents does not exist" {
|
|
70
|
-
run next_incident_id "$INCIDENTS_DIR"
|
|
71
|
-
[ "$status" -eq 0 ]
|
|
72
|
-
[ "$output" = "I001" ]
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@test "next_incident_id increments past the highest existing ID" {
|
|
76
|
-
mkdir -p "$INCIDENTS_DIR"
|
|
77
|
-
: > "$INCIDENTS_DIR/I001-foo.closed.md"
|
|
78
|
-
: > "$INCIDENTS_DIR/I002-bar.restored.md"
|
|
79
|
-
: > "$INCIDENTS_DIR/I005-baz.investigating.md"
|
|
80
|
-
run next_incident_id "$INCIDENTS_DIR"
|
|
81
|
-
[ "$status" -eq 0 ]
|
|
82
|
-
[ "$output" = "I006" ]
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@test "next_incident_id zero-pads three digits" {
|
|
86
|
-
mkdir -p "$INCIDENTS_DIR"
|
|
87
|
-
: > "$INCIDENTS_DIR/I098-foo.closed.md"
|
|
88
|
-
run next_incident_id "$INCIDENTS_DIR"
|
|
89
|
-
[ "$status" -eq 0 ]
|
|
90
|
-
[ "$output" = "I099" ]
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
@test "next_incident_id ignores non-incident files" {
|
|
94
|
-
mkdir -p "$INCIDENTS_DIR"
|
|
95
|
-
: > "$INCIDENTS_DIR/README.md"
|
|
96
|
-
: > "$INCIDENTS_DIR/notes.md"
|
|
97
|
-
run next_incident_id "$INCIDENTS_DIR"
|
|
98
|
-
[ "$status" -eq 0 ]
|
|
99
|
-
[ "$output" = "I001" ]
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
@test "incident_path builds investigating file path" {
|
|
103
|
-
run incident_path "$INCIDENTS_DIR" "I001" "login-500s" "investigating"
|
|
104
|
-
[ "$status" -eq 0 ]
|
|
105
|
-
[ "$output" = "${INCIDENTS_DIR}/I001-login-500s.investigating.md" ]
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
@test "incident_path supports all lifecycle suffixes" {
|
|
109
|
-
for suffix in investigating mitigating restored closed; do
|
|
110
|
-
run incident_path "$INCIDENTS_DIR" "I042" "x" "$suffix"
|
|
111
|
-
[ "$status" -eq 0 ]
|
|
112
|
-
[ "$output" = "${INCIDENTS_DIR}/I042-x.${suffix}.md" ]
|
|
113
|
-
done
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@test "docs/incidents is auto-created on first declaration" {
|
|
117
|
-
[ ! -d "$INCIDENTS_DIR" ]
|
|
118
|
-
mkdir -p "$INCIDENTS_DIR"
|
|
119
|
-
[ -d "$INCIDENTS_DIR" ]
|
|
120
|
-
id=$(next_incident_id "$INCIDENTS_DIR")
|
|
121
|
-
path=$(incident_path "$INCIDENTS_DIR" "$id" "test" "investigating")
|
|
122
|
-
: > "$path"
|
|
123
|
-
[ -f "$path" ]
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
@test "restore handoff invokes Skill tool with wr-itil:manage-problem and payload" {
|
|
127
|
-
invoke_skill_mock "Skill" "wr-itil:manage-problem" "incident I001 login-500s — rollback v1.4.3 restored service at 14:30 UTC"
|
|
128
|
-
[ -f "${TEST_ROOT}/skill-invocation.log" ]
|
|
129
|
-
run cat "${TEST_ROOT}/skill-invocation.log"
|
|
130
|
-
[ "$status" -eq 0 ]
|
|
131
|
-
[ "${lines[0]}" = "Skill" ]
|
|
132
|
-
[ "${lines[1]}" = "wr-itil:manage-problem" ]
|
|
133
|
-
[[ "${lines[2]}" == *"I001"* ]]
|
|
134
|
-
[[ "${lines[2]}" == *"rollback"* ]]
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
@test "restore handoff payload carries incident ID and mitigation" {
|
|
138
|
-
invoke_skill_mock "Skill" "wr-itil:manage-problem" "incident I042 — mitigation: feature flag off — verified via Datadog"
|
|
139
|
-
run cat "${TEST_ROOT}/skill-invocation.log"
|
|
140
|
-
[[ "${lines[2]}" == *"I042"* ]]
|
|
141
|
-
[[ "${lines[2]}" == *"feature flag off"* ]]
|
|
142
|
-
[[ "${lines[2]}" == *"Datadog"* ]]
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
@test "handoff contract rejects invocation with wrong skill name" {
|
|
146
|
-
invoke_skill_mock "Skill" "wr-itil:manage-change" "incident I001"
|
|
147
|
-
run grep -c '^wr-itil:manage-problem$' "${TEST_ROOT}/skill-invocation.log"
|
|
148
|
-
[ "$output" = "0" ]
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
@test "close is blocked when linked problem file is .open.md" {
|
|
152
|
-
mkdir -p "$PROBLEMS_DIR"
|
|
153
|
-
: > "$PROBLEMS_DIR/P050-root.open.md"
|
|
154
|
-
# close-gate: close only if linked P### is known-error or closed
|
|
155
|
-
linked=$(ls "$PROBLEMS_DIR"/P050-*.md 2>/dev/null | head -1)
|
|
156
|
-
[[ "$linked" != *".known-error.md" && "$linked" != *".closed.md" ]]
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
@test "close is allowed when linked problem file is .known-error.md" {
|
|
160
|
-
mkdir -p "$PROBLEMS_DIR"
|
|
161
|
-
: > "$PROBLEMS_DIR/P050-root.known-error.md"
|
|
162
|
-
linked=$(ls "$PROBLEMS_DIR"/P050-*.md 2>/dev/null | head -1)
|
|
163
|
-
[[ "$linked" == *".known-error.md" || "$linked" == *".closed.md" ]]
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
@test "close is allowed when linked problem file is .closed.md" {
|
|
167
|
-
mkdir -p "$PROBLEMS_DIR"
|
|
168
|
-
: > "$PROBLEMS_DIR/P050-root.closed.md"
|
|
169
|
-
linked=$(ls "$PROBLEMS_DIR"/P050-*.md 2>/dev/null | head -1)
|
|
170
|
-
[[ "$linked" == *".known-error.md" || "$linked" == *".closed.md" ]]
|
|
171
|
-
}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
# ADR-044 alignment contract assertions for manage-problem SKILL.md
|
|
3
|
-
# Step 4 (P132 Phase 2a-ii derive-first refactor, 2026-05-15).
|
|
4
|
-
#
|
|
5
|
-
# tdd-review: structural-permitted (justification: SKILL.md prose contract
|
|
6
|
-
# assertions; behavioural skill-runtime harness pending P012 + P081 Phase 2;
|
|
7
|
-
# expected to migrate to behavioural form once the harness exists. Added
|
|
8
|
-
# during P132 Phase 2a-ii per the inline plan's bridge-marker rule —
|
|
9
|
-
# isomorphic precedent at manage-incident-adr-044-contract.bats Surface 2.)
|
|
10
|
-
#
|
|
11
|
-
# This file is the dedicated structural-grep-permitted home for the ADR-044
|
|
12
|
-
# alignment contract during the bridge window. After P081 Phase 2 retrofits
|
|
13
|
-
# the project's structural-grep tests to behavioural form, this file's
|
|
14
|
-
# assertions migrate too.
|
|
15
|
-
#
|
|
16
|
-
# @problem P132 (agents over-ask in interactive sessions — Phase 2a-ii
|
|
17
|
-
# manage-problem create flow derive-first refactor)
|
|
18
|
-
# @problem P185 (capture-problem Step 1.5 worked-example precedent)
|
|
19
|
-
# @problem P136 (ADR-044 alignment audit master)
|
|
20
|
-
# @adr ADR-044 (Decision-Delegation Contract)
|
|
21
|
-
# @adr ADR-013 amended Rule 1 (structured user interaction)
|
|
22
|
-
# @adr ADR-026 (cost-source grounding — stderr advisory shape)
|
|
23
|
-
# @adr ADR-052 (behavioural-by-default with structural bridge window)
|
|
24
|
-
# @jtbd JTBD-001 (enforce governance without slowing down — primary)
|
|
25
|
-
# @jtbd JTBD-006 (work backlog AFK — queued for return, not guessed at)
|
|
26
|
-
# @jtbd JTBD-101 (extend the suite with consistent patterns)
|
|
27
|
-
|
|
28
|
-
setup() {
|
|
29
|
-
SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
|
|
30
|
-
SKILL_FILE="${SKILL_DIR}/SKILL.md"
|
|
31
|
-
[ -f "$SKILL_FILE" ]
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
# ----------------------------------------------------------------------
|
|
35
|
-
# Step 4 derive-first refactor (P132 Phase 2a-ii) — cat-4 silent-framework
|
|
36
|
-
# on Title + Priority-when-evidence-present; cat-1 direction-setting only
|
|
37
|
-
# on Description; cat-5 taste fallback only on Priority-when-ambiguous.
|
|
38
|
-
# ----------------------------------------------------------------------
|
|
39
|
-
|
|
40
|
-
@test "SKILL.md Step 4 cross-references ADR-044 category-4 (silent-framework) for derivable fields (P132 derive-first)" {
|
|
41
|
-
# P132 Phase 2a-ii: Title + Priority-when-evidence-present resolve via
|
|
42
|
-
# silent-framework per ADR-044 category 4. Only Description retains
|
|
43
|
-
# AskUserQuestion as genuine cat-1 direction-setting (no prose -> nothing
|
|
44
|
-
# to capture).
|
|
45
|
-
run awk '/^### 4\. /,/^### 4b\. /' "$SKILL_FILE"
|
|
46
|
-
[ "$status" -eq 0 ]
|
|
47
|
-
[[ "$output" == *"silent-framework"* ]] || [[ "$output" == *"category 4"* ]] || [[ "$output" == *"category-4"* ]]
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@test "SKILL.md Step 4 cross-references ADR-044 category-1 (direction-setting) for Description fallback" {
|
|
51
|
-
# Description is the genuine cat-1 surface — without prose there is
|
|
52
|
-
# literally nothing to capture. The refactor preserves the AskUserQuestion
|
|
53
|
-
# on Description.
|
|
54
|
-
run awk '/^### 4\. /,/^### 4b\. /' "$SKILL_FILE"
|
|
55
|
-
[ "$status" -eq 0 ]
|
|
56
|
-
[[ "$output" == *"direction-setting"* ]] || [[ "$output" == *"category 1"* ]] || [[ "$output" == *"category-1"* ]]
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@test "SKILL.md Step 4 derives Title from prose silently (P132 inverse-P078)" {
|
|
60
|
-
# The 2026-05-06 I001 declaration regression cited in P132 line 14 was the
|
|
61
|
-
# same agent failure mode on the manage-incident surface: agent asked
|
|
62
|
-
# "Title" with 3 candidate options when kebab-casing the description
|
|
63
|
-
# would have produced the slug directly. manage-problem Step 4 must ship
|
|
64
|
-
# the same derive-first pattern.
|
|
65
|
-
run awk '/^### 4\. /,/^### 4b\. /' "$SKILL_FILE"
|
|
66
|
-
[ "$status" -eq 0 ]
|
|
67
|
-
[[ "$output" == *"Title"* ]]
|
|
68
|
-
[[ "$output" == *"derive"* ]] || [[ "$output" == *"derived"* ]]
|
|
69
|
-
[[ "$output" == *"kebab"* ]] || [[ "$output" == *"prose"* ]]
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
@test "SKILL.md Step 4 derives Priority from RISK-POLICY matrix + evidence (P132 inverse-P078)" {
|
|
73
|
-
# The I001 regression cited in P132 line 15 was the analogous failure on
|
|
74
|
-
# Severity. manage-problem's Priority (Impact x Likelihood) derives from
|
|
75
|
-
# the same RISK-POLICY matrix lookup against description signals.
|
|
76
|
-
# Ambiguous-evidence falls back to AskUserQuestion as cat-5 (taste).
|
|
77
|
-
run awk '/^### 4\. /,/^### 4b\. /' "$SKILL_FILE"
|
|
78
|
-
[ "$status" -eq 0 ]
|
|
79
|
-
[[ "$output" == *"Priority"* ]]
|
|
80
|
-
[[ "$output" == *"RISK-POLICY"* ]]
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
@test "SKILL.md Step 4 retains Description as AskUserQuestion fallback (negative-of-negative guard)" {
|
|
84
|
-
# Regression-resistance: the refactor MUST preserve the genuine cat-1
|
|
85
|
-
# direction-setting surface on Description. Without user-supplied prose
|
|
86
|
-
# the SKILL has nothing to derive from — Description IS the input. Same
|
|
87
|
-
# reasoning as manage-incident Step 4 Scope retention.
|
|
88
|
-
run awk '/^### 4\. /,/^### 4b\. /' "$SKILL_FILE"
|
|
89
|
-
[ "$status" -eq 0 ]
|
|
90
|
-
[[ "$output" == *"Description"* ]]
|
|
91
|
-
[[ "$output" == *"AskUserQuestion"* ]]
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
@test "SKILL.md Step 4 cites P132 (inverse-P078 audit traceability)" {
|
|
95
|
-
# P132 + ADR-044 must appear in Step 4 or Related section so the audit
|
|
96
|
-
# trail for the Phase 2a-ii refactor is recoverable from the SKILL.md
|
|
97
|
-
# surface.
|
|
98
|
-
run grep -nE "P132" "$SKILL_FILE"
|
|
99
|
-
[ "$status" -eq 0 ]
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
@test "SKILL.md Step 4 documents stderr advisory shape for derived fields (ADR-026 grounding)" {
|
|
103
|
-
# ADR-026 cost-source grounding: each silent derivation emits a stderr
|
|
104
|
-
# advisory citing the source. Pattern parity with capture-problem Step
|
|
105
|
-
# 1.5 + manage-incident Step 4 (I2-isomorphic across the three
|
|
106
|
-
# declaration-skill surfaces per architect verdict 2026-05-15).
|
|
107
|
-
run awk '/^### 4\. /,/^### 4b\. /' "$SKILL_FILE"
|
|
108
|
-
[ "$status" -eq 0 ]
|
|
109
|
-
[[ "$output" == *"stderr"* ]] || [[ "$output" == *"advisory"* ]]
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
@test "SKILL.md Step 4 cross-references capture-problem Step 1.5 + manage-incident Step 4 (cross-skill consistency)" {
|
|
113
|
-
# The architect verdict 2026-05-15 P132 Phase 2a-ii flagged cross-skill
|
|
114
|
-
# consistency: three declaration-skill surfaces now ship the same
|
|
115
|
-
# dispatch shape. The Step 4 prose must explicitly cite both prior
|
|
116
|
-
# surfaces (P185 capture-problem + manage-incident b7cc645) as
|
|
117
|
-
# worked-example precedents so the I2-isomorphic stderr advisory format
|
|
118
|
-
# is locked-in by reference before a fourth surface (Phase 2a-iii
|
|
119
|
-
# create-adr) drifts.
|
|
120
|
-
run awk '/^### 4\. /,/^### 4b\. /' "$SKILL_FILE"
|
|
121
|
-
[ "$status" -eq 0 ]
|
|
122
|
-
[[ "$output" == *"P185"* ]] || [[ "$output" == *"capture-problem"* ]]
|
|
123
|
-
[[ "$output" == *"manage-incident"* ]] || [[ "$output" == *"b7cc645"* ]]
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
# ----------------------------------------------------------------------
|
|
127
|
-
# Negative-of-negative guards — Step 4b multi-concern + Step 2
|
|
128
|
-
# duplicate-check MUST remain cat-1 direction-setting AskUserQuestion
|
|
129
|
-
# surfaces (architect verdict 2026-05-15: not touched by Phase 2a-ii).
|
|
130
|
-
# ----------------------------------------------------------------------
|
|
131
|
-
|
|
132
|
-
@test "SKILL.md Step 4b multi-concern AskUserQuestion is preserved (cat-1 direction-setting, not touched by Phase 2a-ii)" {
|
|
133
|
-
# Architect verdict 2026-05-15: Step 4b is a separate cat-1
|
|
134
|
-
# direction-setting surface — only the user knows whether the concerns
|
|
135
|
-
# can be independently fixed. The Phase 2a-ii refactor MUST NOT touch
|
|
136
|
-
# Step 4b's AskUserQuestion gate.
|
|
137
|
-
run awk '/^### 4b\. /,/^### 5\. /' "$SKILL_FILE"
|
|
138
|
-
[ "$status" -eq 0 ]
|
|
139
|
-
[[ "$output" == *"AskUserQuestion"* ]]
|
|
140
|
-
[[ "$output" == *"concern"* ]] || [[ "$output" == *"split"* ]]
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
@test "SKILL.md Step 2 duplicate-check AskUserQuestion is preserved (cat-1 direction-setting, not touched by Phase 2a-ii)" {
|
|
144
|
-
# Architect verdict 2026-05-15: Step 2 is a separate cat-1
|
|
145
|
-
# direction-setting surface — only the user knows whether an existing
|
|
146
|
-
# ticket is the same root cause. The Phase 2a-ii refactor MUST NOT
|
|
147
|
-
# touch Step 2's AskUserQuestion gate.
|
|
148
|
-
run awk '/^### 2\. /,/^### 3\. /' "$SKILL_FILE"
|
|
149
|
-
[ "$status" -eq 0 ]
|
|
150
|
-
[[ "$output" == *"AskUserQuestion"* ]]
|
|
151
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
# P170 / RFC-002 / ADR-031 Open-Execution Q1 resolution: manage-problem
|
|
4
|
-
# SKILL.md wires the shared migration routine at Step 0a (before
|
|
5
|
-
# Step 0 README reconciliation preflight). Doc-lint structural test —
|
|
6
|
-
# the wiring is a SKILL.md preamble integration point; behavioural
|
|
7
|
-
# assertions for the routine itself live at
|
|
8
|
-
# packages/shared/test/sync-migrate-problems-layout.bats (T7) and the
|
|
9
|
-
# end-to-end behavioural fixture
|
|
10
|
-
# packages/itil/skills/manage-problem/test/manage-problem-auto-migrate.bats (T10).
|
|
11
|
-
|
|
12
|
-
setup() {
|
|
13
|
-
REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
|
|
14
|
-
SKILL_MD="$REPO_ROOT/packages/itil/skills/manage-problem/SKILL.md"
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@test "manage-problem: SKILL.md declares Step 0a auto-migrate (T8 wiring point)" {
|
|
18
|
-
run grep -E '^### 0a\.|^## Step 0a|Step 0a:' "$SKILL_MD"
|
|
19
|
-
[ "$status" -eq 0 ]
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@test "manage-problem: SKILL.md Step 0a cites P170 / RFC-002 / ADR-031" {
|
|
23
|
-
run grep -F 'P170' "$SKILL_MD"
|
|
24
|
-
[ "$status" -eq 0 ]
|
|
25
|
-
run grep -F 'ADR-031' "$SKILL_MD"
|
|
26
|
-
[ "$status" -eq 0 ]
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@test "manage-problem: SKILL.md Step 0a sources packages/itil/lib/migrate-problems-layout.sh" {
|
|
30
|
-
run grep -F 'packages/itil/lib/migrate-problems-layout.sh' "$SKILL_MD"
|
|
31
|
-
[ "$status" -eq 0 ]
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@test "manage-problem: SKILL.md Step 0a calls migrate_problems_to_per_state_layout entrypoint" {
|
|
35
|
-
run grep -F 'migrate_problems_to_per_state_layout' "$SKILL_MD"
|
|
36
|
-
[ "$status" -eq 0 ]
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@test "manage-problem: SKILL.md Step 0a fires before Step 0 README reconciliation" {
|
|
40
|
-
# Assert the literal line order in the file: Step 0a appears before
|
|
41
|
-
# the existing Step 0 README reconciliation heading.
|
|
42
|
-
local step_0a_line step_0_line
|
|
43
|
-
step_0a_line=$(grep -nE '^### 0a\.|^## Step 0a|Step 0a:' "$SKILL_MD" | head -1 | cut -d: -f1)
|
|
44
|
-
step_0_line=$(grep -nE '^### 0\. README' "$SKILL_MD" | head -1 | cut -d: -f1)
|
|
45
|
-
[ -n "$step_0a_line" ]
|
|
46
|
-
[ -n "$step_0_line" ]
|
|
47
|
-
[ "$step_0a_line" -lt "$step_0_line" ]
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@test "manage-problem: SKILL.md Step 0a cites ADR-013 Rule 6 (AFK auto-fire authorisation)" {
|
|
51
|
-
run grep -F 'ADR-013' "$SKILL_MD"
|
|
52
|
-
[ "$status" -eq 0 ]
|
|
53
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
# Doc-lint guard: manage-problem SKILL.md must include a concern-boundary
|
|
3
|
-
# analysis step for new problem creation.
|
|
4
|
-
#
|
|
5
|
-
# Structural assertion — Permitted Exception to the source-grep ban (ADR-005 / P011).
|
|
6
|
-
# These tests assert that the skill specification document conforms to the
|
|
7
|
-
# concern-boundary splitting contract introduced by P016.
|
|
8
|
-
#
|
|
9
|
-
# Cross-reference:
|
|
10
|
-
# P016: docs/problems/016-manage-problem-should-split-multi-concern-tickets.open.md
|
|
11
|
-
# ADR-013: docs/decisions/013-structured-user-interaction-for-governance-decisions.proposed.md
|
|
12
|
-
# @jtbd JTBD-001 (enforce governance without slowing down)
|
|
13
|
-
# @jtbd JTBD-101 (extend the suite with clear patterns)
|
|
14
|
-
|
|
15
|
-
setup() {
|
|
16
|
-
SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
|
|
17
|
-
SKILL_FILE="${SKILL_DIR}/SKILL.md"
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@test "SKILL.md includes a concern-boundary analysis step for new problem creation" {
|
|
21
|
-
# P016: Before writing a problem file (step 5), the skill must check whether
|
|
22
|
-
# the description contains multiple distinct root causes or concerns, and offer
|
|
23
|
-
# to split if it does. This guards against conflated tickets that make WSJF
|
|
24
|
-
# scoring meaningless.
|
|
25
|
-
run grep -in "concern.boundary\|concern-boundary\|concern boundary\|boundary.*concern\|split.*concern\|multi.concern\|single.*concern" "$SKILL_FILE"
|
|
26
|
-
[ "$status" -eq 0 ]
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@test "SKILL.md concern-boundary step uses AskUserQuestion, not prose (ADR-013)" {
|
|
30
|
-
# ADR-013 Rule 1: all branch points must use AskUserQuestion, not prose options.
|
|
31
|
-
# The concern-boundary split decision (split vs keep as one) is a branch point
|
|
32
|
-
# and must be handled with a structured AskUserQuestion call, not a
|
|
33
|
-
# '(a) split (b) keep' prose paragraph.
|
|
34
|
-
# This test verifies the split prompt references AskUserQuestion (not just that
|
|
35
|
-
# AskUserQuestion appears anywhere — the no-prose-options.bats test covers that).
|
|
36
|
-
run grep -n "concern.boundary\|concern-boundary\|concern boundary\|split.*concern\|multi.concern" "$SKILL_FILE"
|
|
37
|
-
[ "$status" -eq 0 ]
|
|
38
|
-
# The split decision must direct the skill to use AskUserQuestion
|
|
39
|
-
run grep -in "split.*AskUserQuestion\|AskUserQuestion.*split\|split.*question\|question.*split\|split.*ask\|concern.*AskUserQuestion\|AskUserQuestion.*concern" "$SKILL_FILE"
|
|
40
|
-
[ "$status" -eq 0 ]
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
@test "SKILL.md concern-boundary step is scoped to new problem creation (not updates)" {
|
|
44
|
-
# P016 fix must only fire during new problem creation (between steps 4 and 5),
|
|
45
|
-
# not during updates or transitions. Scope constraint prevents spurious split
|
|
46
|
-
# prompts on existing tickets being updated or transitioned.
|
|
47
|
-
# This checks that the concern-boundary step is placed in the 'new problems'
|
|
48
|
-
# section (steps 2-5), not in the update or transition sections.
|
|
49
|
-
run grep -n "For new problems\|new problem" "$SKILL_FILE"
|
|
50
|
-
[ "$status" -eq 0 ]
|
|
51
|
-
# The concern-boundary check must appear in the new-problems workflow context
|
|
52
|
-
run grep -A5 -i "concern.boundary\|concern-boundary\|concern boundary\|multi.concern\|split.*concern" "$SKILL_FILE"
|
|
53
|
-
[ "$status" -eq 0 ]
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@test "SKILL.md concern-boundary step specifies non-interactive fallback with auto-split" {
|
|
57
|
-
# ADR-013 Rule 6: non-interactive fail-safe — when AskUserQuestion is unavailable,
|
|
58
|
-
# the skill must auto-split rather than hanging or silently dropping the split.
|
|
59
|
-
# This specifically requires "auto-split" or "automatically split" language in
|
|
60
|
-
# the concern-boundary step, not just general "AskUserQuestion unavailable" text
|
|
61
|
-
# which already exists for the commit step (step 11).
|
|
62
|
-
run grep -in "auto.split\|automatically split" "$SKILL_FILE"
|
|
63
|
-
[ "$status" -eq 0 ]
|
|
64
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
# Doc-lint guard: manage-problem SKILL.md must define the XL effort bucket
|
|
3
|
-
# and require effort re-rating at lifecycle transitions.
|
|
4
|
-
#
|
|
5
|
-
# Structural assertion — Permitted Exception to the source-grep ban (ADR-005 / P011).
|
|
6
|
-
# These tests assert that the skill specification document conforms to the
|
|
7
|
-
# effort-bucket and re-rating contract introduced by P047.
|
|
8
|
-
#
|
|
9
|
-
# Cross-reference:
|
|
10
|
-
# P047: docs/problems/047-wsjf-effort-bucket-accuracy-gaps.open.md
|
|
11
|
-
# @jtbd JTBD-006 (Progress the Backlog While I'm Away — finer ranking signal)
|
|
12
|
-
# @jtbd JTBD-101 (Extend the Suite with Clear Patterns — consistent WSJF semantics)
|
|
13
|
-
# @jtbd JTBD-001 (Enforce Governance Without Slowing Down — explicit re-rate audit trail)
|
|
14
|
-
|
|
15
|
-
setup() {
|
|
16
|
-
SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
|
|
17
|
-
SKILL_FILE="${SKILL_DIR}/SKILL.md"
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@test "SKILL.md effort table includes an XL bucket with divisor 8" {
|
|
21
|
-
# P047 concern (2): the L bucket is open-ended (>4 hours, no upper bound),
|
|
22
|
-
# so multi-day / multi-week work ranks identically to a 4-hour L task.
|
|
23
|
-
# The XL bucket disambiguates the top end of the effort spectrum.
|
|
24
|
-
run grep -En "^\|\s*XL\s*\|\s*8\s*\|" "$SKILL_FILE"
|
|
25
|
-
[ "$status" -eq 0 ]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@test "SKILL.md step 7 pre-flight checks effort bucket re-rating" {
|
|
29
|
-
# P047 concern (1): effort is set at problem creation and never re-rated.
|
|
30
|
-
# Step 7 (Open → Known Error transition) must prompt the reviewer to
|
|
31
|
-
# re-evaluate the effort bucket against the now-documented fix strategy.
|
|
32
|
-
# Match tight phrasings that can only appear in the new pre-flight item,
|
|
33
|
-
# not incidental co-occurrences on a summary line.
|
|
34
|
-
run grep -inE "effort bucket (reviewed|re-?rated|re-?assessed|re-?estimated)|re-?(rate|estimate|assess)( the)? effort bucket" "$SKILL_FILE"
|
|
35
|
-
[ "$status" -eq 0 ]
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@test "SKILL.md step 9b requires explicit effort re-estimation with reason" {
|
|
39
|
-
# P047 candidate fix (2): step 9b's effort re-rate is implicit today
|
|
40
|
-
# ("Estimate Effort"). The explicit form ("Re-estimate Effort; if the
|
|
41
|
-
# bucket changed since last review, update the file and note the reason")
|
|
42
|
-
# makes the check unmissable and leaves an audit trail.
|
|
43
|
-
run grep -in "re-estimate effort\|re.estimate effort" "$SKILL_FILE"
|
|
44
|
-
[ "$status" -eq 0 ]
|
|
45
|
-
# The note-the-reason phrase must appear near the re-estimate instruction
|
|
46
|
-
run grep -inE "note.*reason|reason.*noted|note the reason" "$SKILL_FILE"
|
|
47
|
-
[ "$status" -eq 0 ]
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@test "SKILL.md XL bucket description names its scope as multi-day / cross-package" {
|
|
51
|
-
# P047 scoping: XL must be unambiguously wider than L. The description
|
|
52
|
-
# should reference multi-day or cross-package to distinguish it from L's
|
|
53
|
-
# "> 4 hours, multiple files, significant change".
|
|
54
|
-
run grep -inE "XL.*(multi.?day|multi-?week|cross-?package|multi-?package)" "$SKILL_FILE"
|
|
55
|
-
[ "$status" -eq 0 ]
|
|
56
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
# P063: manage-problem SKILL.md documents the external-root-cause
|
|
4
|
-
# detection block that triggers /wr-itil:report-upstream (ADR-024)
|
|
5
|
-
# when root cause is external.
|
|
6
|
-
#
|
|
7
|
-
# Doc-lint structural test (Permitted Exception per ADR-005) — asserts
|
|
8
|
-
# SKILL.md wording for detection tokens, AskUserQuestion three-option
|
|
9
|
-
# prompt, AFK fallback, and the stable `- **Upstream report pending** --`
|
|
10
|
-
# marker (canonical ASCII form per P210; the legacy em-dash variant is
|
|
11
|
-
# still matched by the SKILL's already-noted check for backward
|
|
12
|
-
# compatibility, but is not the canonical-write target). Mirrors
|
|
13
|
-
# work-problems-release-cadence.bats and report-upstream-contract.bats
|
|
14
|
-
# patterns.
|
|
15
|
-
|
|
16
|
-
setup() {
|
|
17
|
-
REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
|
|
18
|
-
MP_SKILL="$REPO_ROOT/packages/itil/skills/manage-problem/SKILL.md"
|
|
19
|
-
WP_SKILL="$REPO_ROOT/packages/itil/skills/work-problems/SKILL.md"
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@test "manage-problem: SKILL.md contains the External-root-cause detection block (P063)" {
|
|
23
|
-
run grep -F 'External-root-cause detection (P063)' "$MP_SKILL"
|
|
24
|
-
[ "$status" -eq 0 ]
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@test "manage-problem: SKILL.md documents strict detection tokens (upstream, third-party, external, vendor)" {
|
|
28
|
-
run grep -F '`upstream`, `third-party`, `external`, `vendor`' "$MP_SKILL"
|
|
29
|
-
[ "$status" -eq 0 ]
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@test "manage-problem: SKILL.md documents the scoped-npm detection pattern" {
|
|
33
|
-
run grep -F '@[\w-]+/[\w-]+' "$MP_SKILL"
|
|
34
|
-
[ "$status" -eq 0 ]
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@test "manage-problem: SKILL.md documents the three AskUserQuestion options (invoke / defer / false positive)" {
|
|
38
|
-
run grep -F 'Invoke /wr-itil:report-upstream now' "$MP_SKILL"
|
|
39
|
-
[ "$status" -eq 0 ]
|
|
40
|
-
run grep -F 'Defer and note in ticket' "$MP_SKILL"
|
|
41
|
-
[ "$status" -eq 0 ]
|
|
42
|
-
run grep -F 'Not actually upstream' "$MP_SKILL"
|
|
43
|
-
[ "$status" -eq 0 ]
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@test "manage-problem: SKILL.md defines the stable Upstream report pending marker with fixed wording (canonical ASCII per P210)" {
|
|
47
|
-
run grep -F -- '- **Upstream report pending** -- external dependency identified; invoke /wr-itil:report-upstream when ready' "$MP_SKILL"
|
|
48
|
-
[ "$status" -eq 0 ]
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@test "manage-problem: SKILL.md still references the legacy em-dash marker variant for backward compatibility (P210)" {
|
|
52
|
-
# P210: canonical write form is ASCII `--`, but the already-noted
|
|
53
|
-
# check MUST still match the legacy em-dash variant so tickets
|
|
54
|
-
# written in prior sessions are detected correctly. Asserts the
|
|
55
|
-
# legacy form remains documented in the SKILL prose.
|
|
56
|
-
run grep -F -- '- **Upstream report pending** —' "$MP_SKILL"
|
|
57
|
-
[ "$status" -eq 0 ]
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@test "manage-problem: SKILL.md documents the AFK non-interactive fallback (P270 — auto-invoke report-upstream via external-comms gate)" {
|
|
61
|
-
run grep -iE 'non-interactive.*afk|afk.*fallback|Non-interactive \(AFK\) branch' "$MP_SKILL"
|
|
62
|
-
[ "$status" -eq 0 ]
|
|
63
|
-
# P270 (ADR-024 2026-06-04 amendment): the AFK branch now auto-invokes
|
|
64
|
-
# report-upstream and routes the drafted prose through the
|
|
65
|
-
# wr-risk-scorer:external-comms gate, superseding the pre-2026-06-04
|
|
66
|
-
# "append marker, do NOT auto-invoke" default.
|
|
67
|
-
run grep -iE 'auto-invoke .*report-upstream' "$MP_SKILL"
|
|
68
|
-
[ "$status" -eq 0 ]
|
|
69
|
-
run grep -F 'external-comms' "$MP_SKILL"
|
|
70
|
-
[ "$status" -eq 0 ]
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
@test "manage-problem: SKILL.md documents the already-noted check to avoid duplicate prompts" {
|
|
74
|
-
run grep -F 'Already-noted check' "$MP_SKILL"
|
|
75
|
-
[ "$status" -eq 0 ]
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@test "manage-problem: SKILL.md documents both insertion points (Open → Known Error AND upstream-blocked park)" {
|
|
79
|
-
run grep -F 'Open → Known Error transition' "$MP_SKILL"
|
|
80
|
-
[ "$status" -eq 0 ]
|
|
81
|
-
run grep -F 'Parking path with `upstream-blocked` reason' "$MP_SKILL"
|
|
82
|
-
[ "$status" -eq 0 ]
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@test "manage-problem: Parked lifecycle entry cross-references the external-root-cause detection block" {
|
|
86
|
-
run grep -F 'If the park reason is `upstream-blocked`' "$MP_SKILL"
|
|
87
|
-
[ "$status" -eq 0 ]
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
@test "manage-problem: SKILL.md references ADR-024 and ADR-013 Rule 6 in the detection block" {
|
|
91
|
-
run grep -F 'ADR-024 Confirmation criterion 3a' "$MP_SKILL"
|
|
92
|
-
[ "$status" -eq 0 ]
|
|
93
|
-
run grep -F 'ADR-013 Rule 6' "$MP_SKILL"
|
|
94
|
-
[ "$status" -eq 0 ]
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
@test "work-problems: upstream-blocked skip row runs the AFK fallback before skipping (P270 — auto-invoke report-upstream)" {
|
|
98
|
-
# P270 (ADR-024 2026-06-04 amendment): the skip row auto-invokes
|
|
99
|
-
# report-upstream before skipping (superseding the old marker-only append).
|
|
100
|
-
run grep -iE 'Auto-invoke .*report-upstream' "$WP_SKILL"
|
|
101
|
-
[ "$status" -eq 0 ]
|
|
102
|
-
run grep -F 'Before skipping, run the manage-problem external-root-cause detection AFK fallback' "$WP_SKILL"
|
|
103
|
-
[ "$status" -eq 0 ]
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
@test "work-problems: upstream-blocked taxonomy entry documents the AFK fallback" {
|
|
107
|
-
run grep -F 'Before skipping, run the manage-problem external-root-cause detection AFK fallback' "$WP_SKILL"
|
|
108
|
-
[ "$status" -eq 0 ]
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
@test "work-problems: Non-Interactive Decision Making table has the external-root-cause row (P063)" {
|
|
112
|
-
run grep -F 'External root cause detected at Open → Known Error' "$WP_SKILL"
|
|
113
|
-
[ "$status" -eq 0 ]
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@test "work-problems: uses the same stable marker wording as manage-problem (canonical ASCII per P210)" {
|
|
117
|
-
run grep -F -- '- **Upstream report pending** -- external dependency identified; invoke /wr-itil:report-upstream when ready' "$WP_SKILL"
|
|
118
|
-
[ "$status" -eq 0 ]
|
|
119
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
# P065 / ADR-036 Confirmation line 198: manage-problem SKILL.md must
|
|
4
|
-
# wire the first-run intake-scaffold prompt — citing ADR-036 + the AFK
|
|
5
|
-
# fail-safe + the marker contract.
|
|
6
|
-
#
|
|
7
|
-
# Doc-lint structural test (Permitted Exception per ADR-005). The wiring
|
|
8
|
-
# itself is a SKILL.md preamble pointer (architect direction 2026-04-26),
|
|
9
|
-
# so behavioural assertions live at the contract layer of scaffold-intake;
|
|
10
|
-
# this bats fixes the wiring point so future maintainers cannot silently
|
|
11
|
-
# remove the cross-reference.
|
|
12
|
-
|
|
13
|
-
setup() {
|
|
14
|
-
REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
|
|
15
|
-
SKILL_MD="$REPO_ROOT/packages/itil/skills/manage-problem/SKILL.md"
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
@test "manage-problem: SKILL.md cites ADR-036 (first-run-prompt contract)" {
|
|
19
|
-
run grep -F 'ADR-036' "$SKILL_MD"
|
|
20
|
-
[ "$status" -eq 0 ]
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@test "manage-problem: SKILL.md cross-references the scaffold-intake skill" {
|
|
24
|
-
run grep -F 'wr-itil:scaffold-intake' "$SKILL_MD"
|
|
25
|
-
[ "$status" -eq 0 ]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@test "manage-problem: SKILL.md documents the first-run intake-scaffold detection clause" {
|
|
29
|
-
# Detection clause must reference at least one intake-file path AND the
|
|
30
|
-
# decline marker so future maintainers see how the trigger fires.
|
|
31
|
-
run grep -iE 'intake' "$SKILL_MD"
|
|
32
|
-
[ "$status" -eq 0 ]
|
|
33
|
-
run grep -F '.claude/.intake-scaffold-declined' "$SKILL_MD"
|
|
34
|
-
[ "$status" -eq 0 ]
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@test "manage-problem: SKILL.md documents the AFK fail-safe (no AskUserQuestion in AFK; iteration-report note)" {
|
|
38
|
-
# Per ADR-013 Rule 6, the AFK orchestrator branch must not fire
|
|
39
|
-
# AskUserQuestion. The SKILL.md preamble pointer must call out this
|
|
40
|
-
# fail-safe so adopters reading the skill understand the divergence.
|
|
41
|
-
run grep -iE 'afk|rule 6' "$SKILL_MD"
|
|
42
|
-
[ "$status" -eq 0 ]
|
|
43
|
-
}
|