@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,318 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
# P138: docs/problems/README.md WSJF Rankings table row order must match
|
|
4
|
-
# /wr-itil:work-problems SKILL.md Step 3's tie-break selection 1:1, and
|
|
5
|
-
# the table must include a Reported date column so the third tie-break
|
|
6
|
-
# input is visible to README readers.
|
|
7
|
-
#
|
|
8
|
-
# ADR-076: selection partitions into three tiers ABOVE the WSJF ladder —
|
|
9
|
-
# Tier 0 Critical-bypass (Severity >=17 OR security OR incident-linked)
|
|
10
|
-
# Tier 1 Inbound-reported (**Origin**: inbound-reported)
|
|
11
|
-
# Tier 2 Internal
|
|
12
|
-
# The tier dominates WSJF; within each tier the existing P138 ladder
|
|
13
|
-
# applies unchanged. Each render site carries a REPORTED-FIRST-TIER-SOURCE
|
|
14
|
-
# marker and an Origin column. Drift re-opens P138 / ADR-076.
|
|
15
|
-
#
|
|
16
|
-
# Hybrid coverage per ADR-005 + ADR-037:
|
|
17
|
-
# - Structural contract-assertions (Permitted Exception per ADR-005 /
|
|
18
|
-
# contract-assertion pattern per ADR-037): each of the five render-
|
|
19
|
-
# block sites carries the canonical TIE-BREAK-LADDER-SOURCE marker
|
|
20
|
-
# and the Reported column.
|
|
21
|
-
# - One behavioural fixture sort: 4 tickets with equal WSJF differing
|
|
22
|
-
# by Status / Effort / Reported. Apply the documented multi-key
|
|
23
|
-
# sort. Assert the output row order matches the tie-break ladder
|
|
24
|
-
# result derived from /wr-itil:work-problems Step 3 selection rules.
|
|
25
|
-
#
|
|
26
|
-
# @problem P138
|
|
27
|
-
# @jtbd JTBD-001 (enforce governance without slowing down — predictable
|
|
28
|
-
# orchestrator behaviour visible from rendered README)
|
|
29
|
-
# @jtbd JTBD-006 (progress backlog AFK — README and orchestrator agree
|
|
30
|
-
# on next ticket)
|
|
31
|
-
#
|
|
32
|
-
# Cross-reference:
|
|
33
|
-
# P138: docs/problems/138-readme-wsjf-row-order-doesnt-match-work-problems-tie-break.*.md
|
|
34
|
-
# ADR-005 — plugin testing strategy / Permitted Exception
|
|
35
|
-
# ADR-037 — contract-assertion bats pattern
|
|
36
|
-
# ADR-044 — decision delegation contract; tie-break ladder is framework-resolved
|
|
37
|
-
|
|
38
|
-
setup() {
|
|
39
|
-
REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
|
|
40
|
-
MANAGE_SKILL="$REPO_ROOT/packages/itil/skills/manage-problem/SKILL.md"
|
|
41
|
-
REVIEW_SKILL="$REPO_ROOT/packages/itil/skills/review-problems/SKILL.md"
|
|
42
|
-
WORK_SKILL="$REPO_ROOT/packages/itil/skills/work-problems/SKILL.md"
|
|
43
|
-
|
|
44
|
-
TEST_TMP="$(mktemp -d)"
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
teardown() {
|
|
48
|
-
if [ -n "${TEST_TMP:-}" ] && [ -d "$TEST_TMP" ]; then
|
|
49
|
-
rm -rf "$TEST_TMP"
|
|
50
|
-
fi
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
# ---------------------------------------------------------------------------
|
|
54
|
-
# Structural contract-assertions — TIE-BREAK-LADDER-SOURCE marker
|
|
55
|
-
# ---------------------------------------------------------------------------
|
|
56
|
-
|
|
57
|
-
@test "manage-problem Step 5 P094 (refresh on new ticket) carries the TIE-BREAK-LADDER-SOURCE marker" {
|
|
58
|
-
# P138 Phase 2: each render block must carry the canonical greppable
|
|
59
|
-
# marker pointing back to /wr-itil:work-problems Step 3 (the
|
|
60
|
-
# framework-resolved source of the tie-break ladder per ADR-044).
|
|
61
|
-
# Drift across the render sites re-opens P138.
|
|
62
|
-
run grep -F '<!-- TIE-BREAK-LADDER-SOURCE: /wr-itil:work-problems SKILL.md Step 3 -->' "$MANAGE_SKILL"
|
|
63
|
-
[ "$status" -eq 0 ]
|
|
64
|
-
# Marker must appear at multiple sites (Step 5 P094, Step 7 P062, Step 9e).
|
|
65
|
-
count=$(grep -c -F '<!-- TIE-BREAK-LADDER-SOURCE: /wr-itil:work-problems SKILL.md Step 3 -->' "$MANAGE_SKILL")
|
|
66
|
-
[ "$count" -ge 3 ]
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
@test "review-problems Step 3 (Present the refreshed ranking) carries the TIE-BREAK-LADDER-SOURCE marker" {
|
|
70
|
-
run grep -F '<!-- TIE-BREAK-LADDER-SOURCE: /wr-itil:work-problems SKILL.md Step 3 -->' "$REVIEW_SKILL"
|
|
71
|
-
[ "$status" -eq 0 ]
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@test "work-problems Step 1 (Scan the backlog) carries the TIE-BREAK-LADDER-SOURCE marker" {
|
|
75
|
-
run grep -F '<!-- TIE-BREAK-LADDER-SOURCE: /wr-itil:work-problems SKILL.md Step 3 -->' "$WORK_SKILL"
|
|
76
|
-
[ "$status" -eq 0 ]
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
# ---------------------------------------------------------------------------
|
|
80
|
-
# Structural contract-assertions — multi-key sort spec wording
|
|
81
|
-
# ---------------------------------------------------------------------------
|
|
82
|
-
|
|
83
|
-
@test "manage-problem render blocks document the multi-key sort spec verbatim" {
|
|
84
|
-
# The exact spec must appear so the agent applying the render produces
|
|
85
|
-
# the same row order as /wr-itil:work-problems Step 3.
|
|
86
|
-
run grep -F '(WSJF desc, Known-Error-first, Effort-divisor asc, Reported-date asc, ID asc)' "$MANAGE_SKILL"
|
|
87
|
-
[ "$status" -eq 0 ]
|
|
88
|
-
count=$(grep -c -F '(WSJF desc, Known-Error-first, Effort-divisor asc, Reported-date asc, ID asc)' "$MANAGE_SKILL")
|
|
89
|
-
[ "$count" -ge 3 ]
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
@test "review-problems documents the multi-key sort spec verbatim" {
|
|
93
|
-
run grep -F '(WSJF desc, Known-Error-first, Effort-divisor asc, Reported-date asc, ID asc)' "$REVIEW_SKILL"
|
|
94
|
-
[ "$status" -eq 0 ]
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
@test "work-problems Step 1 documents the multi-key sort spec verbatim" {
|
|
98
|
-
run grep -F '(WSJF desc, Known-Error-first, Effort-divisor asc, Reported-date asc, ID asc)' "$WORK_SKILL"
|
|
99
|
-
[ "$status" -eq 0 ]
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
# ---------------------------------------------------------------------------
|
|
103
|
-
# Structural contract-assertions — Reported column present in templates
|
|
104
|
-
# ---------------------------------------------------------------------------
|
|
105
|
-
|
|
106
|
-
@test "manage-problem Step 9e README template includes the Reported column" {
|
|
107
|
-
# The Step 9e block writes the README template that downstream renderings
|
|
108
|
-
# copy. Without the Reported column in the template, the third tie-break
|
|
109
|
-
# input remains invisible to README readers and P138 recurs.
|
|
110
|
-
run grep -F '| WSJF | ID | Title | Severity | Status | Effort | Reported |' "$MANAGE_SKILL"
|
|
111
|
-
[ "$status" -eq 0 ]
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
@test "review-problems Step 5 README template includes the Reported column" {
|
|
115
|
-
run grep -F '| WSJF | ID | Title | Severity | Status | Effort | Reported |' "$REVIEW_SKILL"
|
|
116
|
-
[ "$status" -eq 0 ]
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
# ---------------------------------------------------------------------------
|
|
120
|
-
# Structural contract-assertions — cross-coupling drift warning
|
|
121
|
-
# ---------------------------------------------------------------------------
|
|
122
|
-
|
|
123
|
-
@test "manage-problem render blocks warn that drift re-opens P138" {
|
|
124
|
-
# The cross-coupling note must explicitly name P138 so future agents
|
|
125
|
-
# who consider relaxing the multi-key sort see the regression risk.
|
|
126
|
-
count=$(grep -c -F 'drift here re-opens P138' "$MANAGE_SKILL")
|
|
127
|
-
[ "$count" -ge 3 ]
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
@test "review-problems renders the drift-re-opens-P138 warning" {
|
|
131
|
-
run grep -F 'drift re-opens P138' "$REVIEW_SKILL"
|
|
132
|
-
[ "$status" -eq 0 ]
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
# ---------------------------------------------------------------------------
|
|
136
|
-
# Behavioural fixture: multi-key sort produces tie-break-ladder order
|
|
137
|
-
# ---------------------------------------------------------------------------
|
|
138
|
-
|
|
139
|
-
@test "behavioural: multi-key sort on 4 same-WSJF tickets matches tie-break ladder order" {
|
|
140
|
-
# Fixture: 4 tickets all at WSJF 6.0, differing by Status / Effort /
|
|
141
|
-
# Reported date. Encode each as a tab-separated row whose columns are
|
|
142
|
-
# the multi-key sort axes (WSJF, KE_flag where 0=KE+1=Open, Effort
|
|
143
|
-
# divisor, Reported date, ID, Title). Apply the documented sort and
|
|
144
|
-
# assert the output row order matches the tie-break ladder result.
|
|
145
|
-
#
|
|
146
|
-
# Tickets:
|
|
147
|
-
# T1: Open, S, Reported 2026-04-27, severity 6, WSJF 6.0
|
|
148
|
-
# T2: Open, M, Reported 2026-04-26, severity 12, WSJF 6.0
|
|
149
|
-
# T3: KE, S, Reported 2026-04-25, severity 3, WSJF 6.0 (3*2/1=6.0)
|
|
150
|
-
# T4: KE, M, Reported 2026-04-24, severity 6, WSJF 6.0 (6*2/2=6.0)
|
|
151
|
-
#
|
|
152
|
-
# Tie-break ladder per /wr-itil:work-problems Step 3:
|
|
153
|
-
# 1. Known-Error first → T3, T4 before T1, T2
|
|
154
|
-
# 2. Smaller effort first → T3 (S) before T4 (M); T1 (S) before T2 (M)
|
|
155
|
-
# 3. Older reported date first → not exercised here because effort
|
|
156
|
-
# already distinguishes within Status (intentional: this is the
|
|
157
|
-
# same shape as a real backlog).
|
|
158
|
-
#
|
|
159
|
-
# Expected order: T3, T4, T1, T2
|
|
160
|
-
#
|
|
161
|
-
# NB: Reported-date field is included in the sort key but not exercised
|
|
162
|
-
# by this fixture (effort distinguishes pairs). The Reported-only test
|
|
163
|
-
# below adds explicit coverage of the third tie-break level.
|
|
164
|
-
|
|
165
|
-
fixture_in="$TEST_TMP/fixture.tsv"
|
|
166
|
-
cat >"$fixture_in" <<'EOF'
|
|
167
|
-
6.0 1 1 2026-04-27 201 T1: Open S
|
|
168
|
-
6.0 1 2 2026-04-26 202 T2: Open M
|
|
169
|
-
6.0 0 1 2026-04-25 203 T3: KE S
|
|
170
|
-
6.0 0 2 2026-04-24 204 T4: KE M
|
|
171
|
-
EOF
|
|
172
|
-
|
|
173
|
-
# Multi-key sort spec from SKILL.md:
|
|
174
|
-
# k1: WSJF desc -> -k1,1nr
|
|
175
|
-
# k2: KE_flag asc (0 KE) -> -k2,2n
|
|
176
|
-
# k3: Effort divisor asc -> -k3,3n
|
|
177
|
-
# k4: Reported asc -> -k4,4
|
|
178
|
-
# k5: ID asc -> -k5,5n
|
|
179
|
-
sorted=$(sort -t$'\t' -k1,1nr -k2,2n -k3,3n -k4,4 -k5,5n "$fixture_in" | cut -f6)
|
|
180
|
-
expected="T3: KE S
|
|
181
|
-
T4: KE M
|
|
182
|
-
T1: Open S
|
|
183
|
-
T2: Open M"
|
|
184
|
-
[ "$sorted" = "$expected" ]
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
@test "behavioural: multi-key sort exercises the third tie-break level (Reported date) when Status + Effort tie" {
|
|
188
|
-
# Fixture: 3 tickets all at WSJF 6.0, all KE, all Effort S, differing
|
|
189
|
-
# only by Reported date and ID. The first two tie-break levels do not
|
|
190
|
-
# distinguish them; only the Reported-date axis decides the order.
|
|
191
|
-
# This is the explicit regression guard for the third tie-break level
|
|
192
|
-
# being silently dropped — exactly the failure mode P138 documents.
|
|
193
|
-
#
|
|
194
|
-
# Expected order (older Reported first, then ID asc as final tiebreak):
|
|
195
|
-
# T_a (Reported 2026-04-22) → T_b (Reported 2026-04-25) → T_c (Reported 2026-04-27)
|
|
196
|
-
fixture_in="$TEST_TMP/fixture-reported.tsv"
|
|
197
|
-
cat >"$fixture_in" <<'EOF'
|
|
198
|
-
6.0 0 1 2026-04-25 302 T_b: KE S older
|
|
199
|
-
6.0 0 1 2026-04-27 303 T_c: KE S newest
|
|
200
|
-
6.0 0 1 2026-04-22 301 T_a: KE S oldest
|
|
201
|
-
EOF
|
|
202
|
-
|
|
203
|
-
sorted=$(sort -t$'\t' -k1,1nr -k2,2n -k3,3n -k4,4 -k5,5n "$fixture_in" | cut -f6)
|
|
204
|
-
expected="T_a: KE S oldest
|
|
205
|
-
T_b: KE S older
|
|
206
|
-
T_c: KE S newest"
|
|
207
|
-
[ "$sorted" = "$expected" ]
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
@test "behavioural: tie-break flips when WSJF differs (sort respects k1 first)" {
|
|
211
|
-
# Regression guard: ensure the multi-key sort doesn't reorder across
|
|
212
|
-
# WSJF tiers. A higher-WSJF Open ticket must outrank a lower-WSJF KE
|
|
213
|
-
# ticket — the WSJF axis dominates the Status axis.
|
|
214
|
-
fixture_in="$TEST_TMP/fixture-tiers.tsv"
|
|
215
|
-
cat >"$fixture_in" <<'EOF'
|
|
216
|
-
6.0 0 2 2026-04-20 401 T_low: KE M low-WSJF
|
|
217
|
-
12.0 1 1 2026-04-30 402 T_high: Open S high-WSJF
|
|
218
|
-
EOF
|
|
219
|
-
|
|
220
|
-
sorted=$(sort -t$'\t' -k1,1nr -k2,2n -k3,3n -k4,4 -k5,5n "$fixture_in" | cut -f6)
|
|
221
|
-
expected="T_high: Open S high-WSJF
|
|
222
|
-
T_low: KE M low-WSJF"
|
|
223
|
-
[ "$sorted" = "$expected" ]
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
# ---------------------------------------------------------------------------
|
|
227
|
-
# ADR-076 structural contract-assertions — reported-first tier
|
|
228
|
-
# ---------------------------------------------------------------------------
|
|
229
|
-
|
|
230
|
-
@test "manage-problem render blocks carry the REPORTED-FIRST-TIER-SOURCE marker (ADR-076)" {
|
|
231
|
-
# Each WSJF Rankings render block must carry the greppable tier marker
|
|
232
|
-
# pointing back to /wr-itil:work-problems Step 3 (the canonical tier
|
|
233
|
-
# source). Drift across render sites re-opens ADR-076.
|
|
234
|
-
run grep -F '<!-- REPORTED-FIRST-TIER-SOURCE: /wr-itil:work-problems SKILL.md Step 3 (ADR-076) -->' "$MANAGE_SKILL"
|
|
235
|
-
[ "$status" -eq 0 ]
|
|
236
|
-
# Step 5 P094, Step 7 P062, Step 9c presentation, Step 9e template.
|
|
237
|
-
count=$(grep -c -F '<!-- REPORTED-FIRST-TIER-SOURCE: /wr-itil:work-problems SKILL.md Step 3 (ADR-076) -->' "$MANAGE_SKILL")
|
|
238
|
-
[ "$count" -ge 3 ]
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
@test "review-problems carries the REPORTED-FIRST-TIER-SOURCE marker (ADR-076)" {
|
|
242
|
-
run grep -F '<!-- REPORTED-FIRST-TIER-SOURCE: /wr-itil:work-problems SKILL.md Step 3 (ADR-076) -->' "$REVIEW_SKILL"
|
|
243
|
-
[ "$status" -eq 0 ]
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
@test "work-problems carries the REPORTED-FIRST-TIER-SOURCE marker (ADR-076)" {
|
|
247
|
-
run grep -F '<!-- REPORTED-FIRST-TIER-SOURCE: /wr-itil:work-problems SKILL.md Step 3 (ADR-076) -->' "$WORK_SKILL"
|
|
248
|
-
[ "$status" -eq 0 ]
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
@test "manage-problem + review-problems README templates include the Origin column (ADR-076)" {
|
|
252
|
-
# Tier 1 (inbound-reported) membership must be visible to README readers,
|
|
253
|
-
# mirroring the Reported-column rationale for the third tie-break level.
|
|
254
|
-
run grep -F '| WSJF | ID | Title | Severity | Status | Effort | Reported | Origin |' "$MANAGE_SKILL"
|
|
255
|
-
[ "$status" -eq 0 ]
|
|
256
|
-
run grep -F '| WSJF | ID | Title | Severity | Status | Effort | Reported | Origin |' "$REVIEW_SKILL"
|
|
257
|
-
[ "$status" -eq 0 ]
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
@test "manage-problem ticket template defines the Origin field (ADR-076)" {
|
|
261
|
-
run grep -F '**Origin**: internal' "$MANAGE_SKILL"
|
|
262
|
-
[ "$status" -eq 0 ]
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
@test "render blocks warn that drift re-opens ADR-076" {
|
|
266
|
-
count=$(grep -c -F 're-opens P138 / ADR-076' "$MANAGE_SKILL")
|
|
267
|
-
[ "$count" -ge 3 ]
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
# ---------------------------------------------------------------------------
|
|
271
|
-
# ADR-076 behavioural fixture: tier partition dominates the WSJF ladder
|
|
272
|
-
# ---------------------------------------------------------------------------
|
|
273
|
-
|
|
274
|
-
@test "behavioural: tier partition outranks WSJF — critical-bypass + reported beat higher-WSJF internal" {
|
|
275
|
-
# Fixture columns: tier WSJF KE_flag Effort Reported ID Title
|
|
276
|
-
# tier: 0=critical-bypass, 1=inbound-reported, 2=internal
|
|
277
|
-
#
|
|
278
|
-
# The full selection key is tier ASC (k1) dominating, then the existing
|
|
279
|
-
# P138 ladder within tier: WSJF desc (k2), KE-first (k3), Effort asc (k4),
|
|
280
|
-
# Reported asc (k5), ID asc (k6).
|
|
281
|
-
#
|
|
282
|
-
# Tickets:
|
|
283
|
-
# C: critical-bypass, WSJF 2.0 (Severity 20 Open XL) — lowest WSJF
|
|
284
|
-
# R: inbound-reported, WSJF 3.0 (Severity 6 Open M)
|
|
285
|
-
# I: internal, WSJF 16.0 (Severity 8 KE S) — highest WSJF
|
|
286
|
-
#
|
|
287
|
-
# Without the tier, I (WSJF 16.0) would top the queue. With ADR-076 the
|
|
288
|
-
# tier dominates: C → R → I. This is the regression guard that the most
|
|
289
|
-
# critical issues come first and reported beats internal regardless of WSJF.
|
|
290
|
-
fixture_in="$TEST_TMP/fixture-tier.tsv"
|
|
291
|
-
cat >"$fixture_in" <<'EOF'
|
|
292
|
-
2 16.0 0 1 2026-05-20 502 I: internal high-WSJF
|
|
293
|
-
0 2.0 1 8 2026-05-10 501 C: critical low-WSJF
|
|
294
|
-
1 3.0 1 2 2026-05-15 503 R: reported mid-WSJF
|
|
295
|
-
EOF
|
|
296
|
-
|
|
297
|
-
# k1 tier asc; k2 WSJF desc; k3 KE_flag asc; k4 Effort asc; k5 Reported asc; k6 ID asc
|
|
298
|
-
sorted=$(sort -t$'\t' -k1,1n -k2,2nr -k3,3n -k4,4n -k5,5 -k6,6n "$fixture_in" | cut -f7)
|
|
299
|
-
expected="C: critical low-WSJF
|
|
300
|
-
R: reported mid-WSJF
|
|
301
|
-
I: internal high-WSJF"
|
|
302
|
-
[ "$sorted" = "$expected" ]
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
@test "behavioural: within a tier, the existing WSJF + tie-break ladder still applies (ADR-076)" {
|
|
306
|
-
# Two inbound-reported tickets in the same tier must order by the
|
|
307
|
-
# unchanged within-tier ladder: higher WSJF first, then KE-first.
|
|
308
|
-
fixture_in="$TEST_TMP/fixture-within-tier.tsv"
|
|
309
|
-
cat >"$fixture_in" <<'EOF'
|
|
310
|
-
1 6.0 1 1 2026-05-12 601 R_low: reported WSJF 6
|
|
311
|
-
1 12.0 0 2 2026-05-11 602 R_high: reported WSJF 12
|
|
312
|
-
EOF
|
|
313
|
-
|
|
314
|
-
sorted=$(sort -t$'\t' -k1,1n -k2,2nr -k3,3n -k4,4n -k5,5 -k6,6n "$fixture_in" | cut -f7)
|
|
315
|
-
expected="R_high: reported WSJF 12
|
|
316
|
-
R_low: reported WSJF 6"
|
|
317
|
-
[ "$sorted" = "$expected" ]
|
|
318
|
-
}
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
# P150: docs/problems/README.md Verification Queue must be rendered
|
|
4
|
-
# oldest-first (by Released date ASC, oldest at row 1) per ADR-022 +
|
|
5
|
-
# P048 user-task semantics. The header has long claimed "Ranked by
|
|
6
|
-
# release age, oldest first" while the rendered table drifted to
|
|
7
|
-
# newest-first across multiple SKILL.md render sites. This file
|
|
8
|
-
# encodes the canonical sort spec + greppable VQ-SORT-DIRECTION
|
|
9
|
-
# marker as a contract assertion across every render block, plus a
|
|
10
|
-
# behavioural fixture that asserts the actual sort outcome.
|
|
11
|
-
#
|
|
12
|
-
# Hybrid coverage per ADR-005 + ADR-037:
|
|
13
|
-
# - Structural contract-assertions (Permitted Exception per ADR-005 /
|
|
14
|
-
# contract-assertion pattern per ADR-037): each of the render-block
|
|
15
|
-
# sites carries the canonical VQ-SORT-DIRECTION marker.
|
|
16
|
-
# - One behavioural fixture sort: 4 .verifying.md tickets with known
|
|
17
|
-
# Released dates. Apply the documented ASC-by-date sort. Assert
|
|
18
|
-
# row 1 = the oldest entry; row N = the newest.
|
|
19
|
-
#
|
|
20
|
-
# @problem P150
|
|
21
|
-
# @jtbd JTBD-001 (enforce governance without slowing down — predictable
|
|
22
|
-
# render order visible across the README and from `list-problems`)
|
|
23
|
-
# @jtbd JTBD-006 (progress backlog AFK — verification candidates ready
|
|
24
|
-
# to close are at the top of the queue, not the bottom)
|
|
25
|
-
#
|
|
26
|
-
# Cross-reference:
|
|
27
|
-
# P150: docs/problems/150-readme-verification-queue-rendered-newest-first-contradicts-oldest-first-header.*.md
|
|
28
|
-
# P138: sibling fix on the WSJF Rankings table — same fix shape
|
|
29
|
-
# P048: introduced the Verification Queue + Likely verified column
|
|
30
|
-
# ADR-005 — plugin testing strategy / Permitted Exception
|
|
31
|
-
# ADR-022 — `.verifying.md` lifecycle; VQ rendering
|
|
32
|
-
# ADR-037 — contract-assertion bats pattern
|
|
33
|
-
|
|
34
|
-
setup() {
|
|
35
|
-
REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
|
|
36
|
-
MANAGE_SKILL="$REPO_ROOT/packages/itil/skills/manage-problem/SKILL.md"
|
|
37
|
-
REVIEW_SKILL="$REPO_ROOT/packages/itil/skills/review-problems/SKILL.md"
|
|
38
|
-
TRANSITION_SKILL="$REPO_ROOT/packages/itil/skills/transition-problem/SKILL.md"
|
|
39
|
-
TRANSITIONS_SKILL="$REPO_ROOT/packages/itil/skills/transition-problems/SKILL.md"
|
|
40
|
-
RECONCILE_SKILL="$REPO_ROOT/packages/itil/skills/reconcile-readme/SKILL.md"
|
|
41
|
-
LIST_SKILL="$REPO_ROOT/packages/itil/skills/list-problems/SKILL.md"
|
|
42
|
-
|
|
43
|
-
TEST_TMP="$(mktemp -d)"
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
teardown() {
|
|
47
|
-
if [ -n "${TEST_TMP:-}" ] && [ -d "$TEST_TMP" ]; then
|
|
48
|
-
rm -rf "$TEST_TMP"
|
|
49
|
-
fi
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
# ---------------------------------------------------------------------------
|
|
53
|
-
# Structural contract-assertions — VQ-SORT-DIRECTION marker
|
|
54
|
-
# ---------------------------------------------------------------------------
|
|
55
|
-
|
|
56
|
-
@test "manage-problem render blocks carry the VQ-SORT-DIRECTION marker" {
|
|
57
|
-
# Each render block writing the Verification Queue must carry the
|
|
58
|
-
# canonical greppable marker pointing back to ADR-022 (the
|
|
59
|
-
# framework-resolved source of the VQ ordering contract). Drift
|
|
60
|
-
# across render sites re-opens P150.
|
|
61
|
-
run grep -F '<!-- VQ-SORT-DIRECTION: oldest-first per ADR-022 -->' "$MANAGE_SKILL"
|
|
62
|
-
[ "$status" -eq 0 ]
|
|
63
|
-
# Marker must appear at the three manage-problem render sites:
|
|
64
|
-
# Step 5 P094 (refresh on new ticket), Step 7 P062 (refresh on
|
|
65
|
-
# transition), Step 9e (review-emit template).
|
|
66
|
-
count=$(grep -c -F '<!-- VQ-SORT-DIRECTION: oldest-first per ADR-022 -->' "$MANAGE_SKILL")
|
|
67
|
-
[ "$count" -ge 3 ]
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
@test "review-problems renders the VQ-SORT-DIRECTION marker" {
|
|
71
|
-
run grep -F '<!-- VQ-SORT-DIRECTION: oldest-first per ADR-022 -->' "$REVIEW_SKILL"
|
|
72
|
-
[ "$status" -eq 0 ]
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@test "transition-problem Step 7 README refresh carries the VQ-SORT-DIRECTION marker" {
|
|
76
|
-
run grep -F '<!-- VQ-SORT-DIRECTION: oldest-first per ADR-022 -->' "$TRANSITION_SKILL"
|
|
77
|
-
[ "$status" -eq 0 ]
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@test "transition-problems batch render carries the VQ-SORT-DIRECTION marker" {
|
|
81
|
-
run grep -F '<!-- VQ-SORT-DIRECTION: oldest-first per ADR-022 -->' "$TRANSITIONS_SKILL"
|
|
82
|
-
[ "$status" -eq 0 ]
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@test "reconcile-readme rendering carries the VQ-SORT-DIRECTION marker" {
|
|
86
|
-
run grep -F '<!-- VQ-SORT-DIRECTION: oldest-first per ADR-022 -->' "$RECONCILE_SKILL"
|
|
87
|
-
[ "$status" -eq 0 ]
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
@test "list-problems VQ rendering carries the VQ-SORT-DIRECTION marker" {
|
|
91
|
-
run grep -F '<!-- VQ-SORT-DIRECTION: oldest-first per ADR-022 -->' "$LIST_SKILL"
|
|
92
|
-
[ "$status" -eq 0 ]
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
# ---------------------------------------------------------------------------
|
|
96
|
-
# Structural contract-assertions — sort-direction phrase consistency
|
|
97
|
-
# ---------------------------------------------------------------------------
|
|
98
|
-
|
|
99
|
-
@test "manage-problem render blocks document the Released-date ASC direction" {
|
|
100
|
-
# Free-form explanation of the sort key + direction must accompany
|
|
101
|
-
# the marker so a reader doesn't have to chase the ADR to understand
|
|
102
|
-
# what the marker authorises.
|
|
103
|
-
run grep -F 'Released date ASC' "$MANAGE_SKILL"
|
|
104
|
-
[ "$status" -eq 0 ]
|
|
105
|
-
count=$(grep -c -F 'Released date ASC' "$MANAGE_SKILL")
|
|
106
|
-
[ "$count" -ge 3 ]
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
@test "review-problems documents the Released-date ASC direction" {
|
|
110
|
-
run grep -F 'Released date ASC' "$REVIEW_SKILL"
|
|
111
|
-
[ "$status" -eq 0 ]
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
# ---------------------------------------------------------------------------
|
|
115
|
-
# Structural contract-assertions — drift-warning prose
|
|
116
|
-
# ---------------------------------------------------------------------------
|
|
117
|
-
|
|
118
|
-
@test "manage-problem render blocks warn that drift re-opens P150" {
|
|
119
|
-
# The cross-coupling note must explicitly name P150 so future agents
|
|
120
|
-
# who consider relaxing the VQ sort direction see the regression risk.
|
|
121
|
-
count=$(grep -c -F 'drift here re-opens P150' "$MANAGE_SKILL")
|
|
122
|
-
[ "$count" -ge 3 ]
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
@test "review-problems renders the drift-re-opens-P150 warning" {
|
|
126
|
-
run grep -F 'drift re-opens P150' "$REVIEW_SKILL"
|
|
127
|
-
[ "$status" -eq 0 ]
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
# ---------------------------------------------------------------------------
|
|
131
|
-
# Behavioural fixture: ASC-by-Released-date puts oldest at row 1
|
|
132
|
-
# ---------------------------------------------------------------------------
|
|
133
|
-
|
|
134
|
-
@test "behavioural: VQ sort by Released date ASC puts oldest entry at row 1" {
|
|
135
|
-
# Fixture: 4 .verifying.md tickets with known Released dates spanning
|
|
136
|
-
# 2026-04-22 to 2026-05-02. Encode each as a tab-separated row whose
|
|
137
|
-
# columns are the sort axes (Released date, ID, Title). Apply the
|
|
138
|
-
# documented ASC-by-Released sort and assert the output row order
|
|
139
|
-
# places the oldest entry at row 1 and the newest at row N.
|
|
140
|
-
#
|
|
141
|
-
# This is the regression guard against the drift documented in P150 —
|
|
142
|
-
# before the fix, render sites iterated newest-first and pushed the
|
|
143
|
-
# actionable closure candidates (oldest entries) below the fold.
|
|
144
|
-
|
|
145
|
-
fixture_in="$TEST_TMP/fixture-vq.tsv"
|
|
146
|
-
cat >"$fixture_in" <<'EOF'
|
|
147
|
-
2026-05-02 148 P148: youngest released
|
|
148
|
-
2026-04-29 144 P144: 3 days old
|
|
149
|
-
2026-04-25 120 P120: week-old
|
|
150
|
-
2026-04-22 093 P093: oldest released
|
|
151
|
-
EOF
|
|
152
|
-
|
|
153
|
-
# Canonical sort: Released date ASC (oldest first), ID ASC as final
|
|
154
|
-
# tiebreaker for same-day releases.
|
|
155
|
-
sorted=$(sort -t$'\t' -k1,1 -k2,2n "$fixture_in" | cut -f3)
|
|
156
|
-
expected="P093: oldest released
|
|
157
|
-
P120: week-old
|
|
158
|
-
P144: 3 days old
|
|
159
|
-
P148: youngest released"
|
|
160
|
-
[ "$sorted" = "$expected" ]
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
@test "behavioural: same-day Released uses ID ASC as the final tiebreaker" {
|
|
164
|
-
# Regression guard: when two tickets share a Released date, the ID
|
|
165
|
-
# ASC tiebreaker must produce a deterministic order. Without an
|
|
166
|
-
# explicit final tiebreaker, render-time row order can shift on
|
|
167
|
-
# every refresh and look like content drift in git diff.
|
|
168
|
-
fixture_in="$TEST_TMP/fixture-vq-sameday.tsv"
|
|
169
|
-
cat >"$fixture_in" <<'EOF'
|
|
170
|
-
2026-05-02 148 P148: same day high
|
|
171
|
-
2026-05-02 147 P147: same day mid
|
|
172
|
-
2026-05-02 146 P146: same day low
|
|
173
|
-
EOF
|
|
174
|
-
|
|
175
|
-
sorted=$(sort -t$'\t' -k1,1 -k2,2n "$fixture_in" | cut -f3)
|
|
176
|
-
expected="P146: same day low
|
|
177
|
-
P147: same day mid
|
|
178
|
-
P148: same day high"
|
|
179
|
-
[ "$sorted" = "$expected" ]
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
@test "behavioural: oldest-first ordering surfaces likely-verified candidates first" {
|
|
183
|
-
# P048 user-task semantics: the Verification Queue exists so the user
|
|
184
|
-
# can close pending verifications. Older entries are more likely
|
|
185
|
-
# ready to close (less chance of revert). Oldest-first ordering puts
|
|
186
|
-
# those candidates at the top so the user lands on actionable rows
|
|
187
|
-
# without scrolling past fresh-release entries still in dwell-time.
|
|
188
|
-
#
|
|
189
|
-
# Fixture spans ages 0d, 1d, 14d, 30d. Assert that after sort, the
|
|
190
|
-
# 30-day entry is at row 1 (highest "likely verified" probability)
|
|
191
|
-
# and the 0-day entry is at row N (lowest probability).
|
|
192
|
-
today="2026-05-02"
|
|
193
|
-
fixture_in="$TEST_TMP/fixture-vq-ages.tsv"
|
|
194
|
-
cat >"$fixture_in" <<'EOF'
|
|
195
|
-
2026-05-02 150 P150: 0 days no
|
|
196
|
-
2026-05-01 149 P149: 1 day no
|
|
197
|
-
2026-04-18 048 P048: 14 days yes
|
|
198
|
-
2026-04-02 030 P030: 30 days yes
|
|
199
|
-
EOF
|
|
200
|
-
|
|
201
|
-
sorted=$(sort -t$'\t' -k1,1 -k2,2n "$fixture_in" | cut -f3)
|
|
202
|
-
first=$(printf "%s\n" "$sorted" | head -1)
|
|
203
|
-
last=$(printf "%s\n" "$sorted" | tail -1)
|
|
204
|
-
[ "$first" = "P030: 30 days yes" ]
|
|
205
|
-
[ "$last" = "P150: 0 days no" ]
|
|
206
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
# tdd-review: structural-permitted (justification: deferred-retrofit per P330 Investigation Task #3 — behavioural K→V-mock test deferred to follow-up commit; this structural backstop guards the SKILL prose carrying the Release-vehicle seed instruction in the meantime per ADR-052 § Surface 2 marker)
|
|
3
|
-
#
|
|
4
|
-
# Doc-lint guard: manage-problem SKILL.md Step 7 Known Error → Verification Pending block
|
|
5
|
-
# must document the P330 Option B seed step that appends a `**Release vehicle**: .changeset/<name>.md`
|
|
6
|
-
# paragraph to the ticket's Fix Strategy section BEFORE the `git mv` to `.verifying.md`.
|
|
7
|
-
# The same instruction must be mirrored in `transition-problem` SKILL.md Step 6 per ADR-010 amended
|
|
8
|
-
# (copy-not-move; P093 split-skill execution ownership).
|
|
9
|
-
#
|
|
10
|
-
# Cross-reference:
|
|
11
|
-
# P330: docs/problems/known-error/330-derive-release-vehicle-helper-requires-pre-edit-of-ticket-changeset-reference-three-touch-when-one-touch-would-suffice.md
|
|
12
|
-
# ADR-010: docs/decisions/010-rename-wr-problem-to-wr-itil.proposed.md (P093 amendment — copy-not-move)
|
|
13
|
-
# ADR-014: docs/decisions/014-governance-skills-commit-their-own-work.proposed.md (single-commit grain)
|
|
14
|
-
# ADR-022: docs/decisions/022-problem-lifecycle-verification-pending-status.proposed.md (Verifying status)
|
|
15
|
-
# ADR-052: docs/decisions/052-behavioural-tests-default-for-skill-testing.proposed.md (Surface 2 marker)
|
|
16
|
-
# @jtbd JTBD-002 (ship with confidence — audit trail self-documents the release vehicle)
|
|
17
|
-
# @jtbd JTBD-006 (progress backlog AFK — eliminates the 3-of-4-dogfoods exit-2 routing friction)
|
|
18
|
-
|
|
19
|
-
setup() {
|
|
20
|
-
TEST_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")" && pwd)"
|
|
21
|
-
REPO_ROOT="$(cd "${TEST_DIR}/../../../../.." && pwd)"
|
|
22
|
-
MANAGE_PROBLEM_SKILL="${REPO_ROOT}/packages/itil/skills/manage-problem/SKILL.md"
|
|
23
|
-
TRANSITION_PROBLEM_SKILL="${REPO_ROOT}/packages/itil/skills/transition-problem/SKILL.md"
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@test "manage-problem SKILL.md exists (P330 precondition)" {
|
|
27
|
-
[ -f "$MANAGE_PROBLEM_SKILL" ]
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@test "transition-problem SKILL.md exists (P330 precondition)" {
|
|
31
|
-
[ -f "$TRANSITION_PROBLEM_SKILL" ]
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@test "manage-problem SKILL.md Step 7 documents the Release vehicle seed step (P330)" {
|
|
35
|
-
# The K→V transition block must instruct authors to seed a `**Release vehicle**: .changeset/<name>.md`
|
|
36
|
-
# paragraph in the ticket's `## Fix Strategy` section BEFORE the `git mv` to `.verifying.md`.
|
|
37
|
-
run grep -inE 'Release vehicle.*\.changeset/' "$MANAGE_PROBLEM_SKILL"
|
|
38
|
-
[ "$status" -eq 0 ]
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@test "manage-problem SKILL.md Step 7 seed instruction precedes the K→V git mv (P330)" {
|
|
42
|
-
# Verify ordering: the "Seed `Release vehicle`" instruction must appear BEFORE the
|
|
43
|
-
# `git mv ... .known-error.md ... .verifying.md` block in Step 7. If the seed instruction
|
|
44
|
-
# lands AFTER the rename in the prose, the agent reading top-to-bottom would do the
|
|
45
|
-
# rename first and the seed-on-known-error-path would target a non-existent file.
|
|
46
|
-
seed_line=$(grep -nE 'Seed `Release vehicle` reference BEFORE the rename' "$MANAGE_PROBLEM_SKILL" | head -1 | cut -d: -f1)
|
|
47
|
-
rename_line=$(grep -nE 'git mv docs/problems/known-error/<NNN>-<title>\.md docs/problems/verifying/<NNN>-<title>\.md' "$MANAGE_PROBLEM_SKILL" | head -1 | cut -d: -f1)
|
|
48
|
-
[ -n "$seed_line" ]
|
|
49
|
-
[ -n "$rename_line" ]
|
|
50
|
-
[ "$seed_line" -lt "$rename_line" ]
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@test "manage-problem SKILL.md Step 7 cites P330 on the seed instruction (P330 traceability)" {
|
|
54
|
-
# The seed instruction must cite P330 so reviewers can chase the rationale.
|
|
55
|
-
run grep -nE 'P330' "$MANAGE_PROBLEM_SKILL"
|
|
56
|
-
[ "$status" -eq 0 ]
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@test "manage-problem SKILL.md Step 7 documents the two P057 staging-trap windows (seed + rename)" {
|
|
60
|
-
# The amendment introduces a second Edit-tool window (seed Edit on .known-error.md).
|
|
61
|
-
# The SKILL prose must explicitly call out that the existing single-`git add` shape covers
|
|
62
|
-
# BOTH windows by riding the rename's index entry.
|
|
63
|
-
run grep -inE 'Two P057 staging-trap windows|two .* Edit windows|seed Edit.*FIRST.*P057' "$MANAGE_PROBLEM_SKILL"
|
|
64
|
-
[ "$status" -eq 0 ]
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
@test "transition-problem SKILL.md Step 6 mirrors the Release vehicle seed step (ADR-010 copy-not-move)" {
|
|
68
|
-
# Per ADR-010 amended (P093 split-skill execution ownership), the manage-problem Step 7
|
|
69
|
-
# block and the transition-problem Step 6 block must stay in sync. Both surfaces are user-
|
|
70
|
-
# initiated K→V entry points (manage-problem fold-fix path + transition-problem standalone path).
|
|
71
|
-
run grep -inE 'Release vehicle.*\.changeset/' "$TRANSITION_PROBLEM_SKILL"
|
|
72
|
-
[ "$status" -eq 0 ]
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@test "transition-problem SKILL.md Step 6 cites P330 on the seed instruction (ADR-010 copy-not-move)" {
|
|
76
|
-
run grep -nE 'P330' "$TRANSITION_PROBLEM_SKILL"
|
|
77
|
-
[ "$status" -eq 0 ]
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@test "transition-problem SKILL.md Step 6 documents the two P057 staging-trap windows (seed + rename)" {
|
|
81
|
-
run grep -inE 'Two P057 staging-trap windows|two .* Edit windows|seed Edit.*FIRST.*P057' "$TRANSITION_PROBLEM_SKILL"
|
|
82
|
-
[ "$status" -eq 0 ]
|
|
83
|
-
}
|