@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,454 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
# @problem P267 — Codify derive-release-vehicle.sh helper for K→V release-cycle
|
|
4
|
-
# citation. K→V transitions composed by hand from inline
|
|
5
|
-
# pre-flight evidence are fragile to wrong-release-cited errors
|
|
6
|
-
# (observed 2026-05-18 session 7 iter 1 — P250's K→V cited
|
|
7
|
-
# P247's release refs). Helper makes citation deterministic.
|
|
8
|
-
#
|
|
9
|
-
# Contract: `derive-release-vehicle.sh <ticket-id> [<problems-dir>]` reads the
|
|
10
|
-
# ticket file for a changeset filename reference, walks `git log
|
|
11
|
-
# --diff-filter=D` for the deletion commit (chore: version packages), then
|
|
12
|
-
# resolves the merge PR + merge commit. Emits a structured citation block on
|
|
13
|
-
# stdout.
|
|
14
|
-
#
|
|
15
|
-
# Output (stdout, multi-line key:value block):
|
|
16
|
-
# RELEASE_VEHICLE:
|
|
17
|
-
# changeset: .changeset/<name>.md
|
|
18
|
-
# version-packages-commit: <SHA>
|
|
19
|
-
# pr: #<N>
|
|
20
|
-
# merge-commit: <SHA>
|
|
21
|
-
# release-date: <YYYY-MM-DD>
|
|
22
|
-
#
|
|
23
|
-
# Exit codes:
|
|
24
|
-
# 0 = OK (full citation emitted)
|
|
25
|
-
# 1 = ticket file not found
|
|
26
|
-
# 2 = no changeset reference in ticket body
|
|
27
|
-
# 3 = changeset still present (unreleased)
|
|
28
|
-
# 4 = deletion commit found but no merge PR / merge commit resolvable
|
|
29
|
-
#
|
|
30
|
-
# @adr ADR-049 (bin/ on PATH shim — adopter-safe script resolution)
|
|
31
|
-
# @adr ADR-022 (Verifying lifecycle — citation supports K→V transition)
|
|
32
|
-
# @adr ADR-014 (single-commit grain — helper is read-only, no commit impact)
|
|
33
|
-
# @adr ADR-005 (Plugin testing strategy — behavioural bats per P081)
|
|
34
|
-
# @jtbd JTBD-001 (Enforce Governance — deterministic citation prevents
|
|
35
|
-
# cross-cite errors)
|
|
36
|
-
# @jtbd JTBD-006 (Progress Backlog AFK — orchestrator per-iter K→V audit
|
|
37
|
-
# trail trustworthy)
|
|
38
|
-
# @jtbd JTBD-101 (Extend the Suite — sibling shim naming grammar)
|
|
39
|
-
|
|
40
|
-
setup() {
|
|
41
|
-
SCRIPTS_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
|
|
42
|
-
SCRIPT="$SCRIPTS_DIR/derive-release-vehicle.sh"
|
|
43
|
-
FIXTURE_DIR="$(mktemp -d)"
|
|
44
|
-
cd "$FIXTURE_DIR"
|
|
45
|
-
git init -q -b main
|
|
46
|
-
git config user.email test@example.com
|
|
47
|
-
git config user.name "Test"
|
|
48
|
-
mkdir -p docs/problems/known-error docs/problems/verifying .changeset
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
teardown() {
|
|
52
|
-
cd /
|
|
53
|
-
rm -rf "$FIXTURE_DIR"
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
# ── Existence + executable ──────────────────────────────────────────────────
|
|
57
|
-
|
|
58
|
-
@test "derive-release-vehicle: script exists" {
|
|
59
|
-
[ -f "$SCRIPT" ]
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
@test "derive-release-vehicle: script is executable" {
|
|
63
|
-
[ -x "$SCRIPT" ]
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
# ── Usage / argument errors ─────────────────────────────────────────────────
|
|
67
|
-
|
|
68
|
-
@test "derive-release-vehicle: no arguments → exit non-zero with usage" {
|
|
69
|
-
run "$SCRIPT"
|
|
70
|
-
[ "$status" -ne 0 ]
|
|
71
|
-
echo "$output" | grep -qi "USAGE"
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@test "derive-release-vehicle: ticket file not found → exit 1" {
|
|
75
|
-
run "$SCRIPT" P999 docs/problems
|
|
76
|
-
[ "$status" -eq 1 ]
|
|
77
|
-
echo "$output" | grep -qi "not found"
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
# ── Exit 2: no changeset reference in body ──────────────────────────────────
|
|
81
|
-
|
|
82
|
-
@test "derive-release-vehicle: ticket body has no changeset reference → exit 2" {
|
|
83
|
-
cat > docs/problems/known-error/100-no-changeset.md <<'EOF'
|
|
84
|
-
# Problem 100: No Changeset
|
|
85
|
-
|
|
86
|
-
**Status**: Known Error
|
|
87
|
-
|
|
88
|
-
## Description
|
|
89
|
-
|
|
90
|
-
This ticket body does NOT reference any .changeset filename.
|
|
91
|
-
EOF
|
|
92
|
-
git add docs/problems/known-error/100-no-changeset.md
|
|
93
|
-
git commit -q -m "init"
|
|
94
|
-
|
|
95
|
-
run "$SCRIPT" P100 docs/problems
|
|
96
|
-
[ "$status" -eq 2 ]
|
|
97
|
-
echo "$output" | grep -qiE "no .?changeset|changeset.*reference"
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
@test "derive-release-vehicle: P389 fallback — body has no ref but a co-committed changeset in ticket history is recovered (not a false exit 2)" {
|
|
101
|
-
# An iter shipped the fix + changeset in ONE commit (ADR-014 grain) but omitted
|
|
102
|
-
# the P330 **Release vehicle** seed, so the ticket body has no .changeset ref.
|
|
103
|
-
# Pre-P389 this exited 2 and the K→V enumerator (P228) silently skipped the
|
|
104
|
-
# ticket. The fallback walks the ticket's own commits for a co-committed
|
|
105
|
-
# changeset. Here the changeset is still in the working tree (unreleased), so
|
|
106
|
-
# recovery lands on exit 3 (found-but-unreleased) — NOT exit 2 (not found).
|
|
107
|
-
cat > docs/problems/known-error/101-co-commit-no-seed.md <<'EOF'
|
|
108
|
-
# Problem 101: Fix shipped, seed omitted
|
|
109
|
-
|
|
110
|
-
**Status**: Known Error
|
|
111
|
-
|
|
112
|
-
## Description
|
|
113
|
-
|
|
114
|
-
The fix landed but the **Release vehicle** seed line was never written, so this
|
|
115
|
-
body references no .changeset filename.
|
|
116
|
-
EOF
|
|
117
|
-
mkdir -p .changeset
|
|
118
|
-
cat > .changeset/p101-co-commit-fix.md <<'EOF'
|
|
119
|
-
---
|
|
120
|
-
"@windyroad/itil": patch
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
P101 fix.
|
|
124
|
-
EOF
|
|
125
|
-
git add docs/problems/known-error/101-co-commit-no-seed.md .changeset/p101-co-commit-fix.md
|
|
126
|
-
git commit -q -m "fix(itil): P101 fix + changeset (co-committed, no seed)"
|
|
127
|
-
|
|
128
|
-
run "$SCRIPT" P101 docs/problems
|
|
129
|
-
[ "$status" -eq 3 ]
|
|
130
|
-
echo "$output" | grep -qiE "p101-co-commit-fix|unreleased|working tree"
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
# ── Exit 3: changeset still present (unreleased) ────────────────────────────
|
|
134
|
-
|
|
135
|
-
@test "derive-release-vehicle: changeset still in working tree (unreleased) → exit 3" {
|
|
136
|
-
cat > .changeset/p101-unreleased.md <<'EOF'
|
|
137
|
-
---
|
|
138
|
-
'@windyroad/itil': patch
|
|
139
|
-
---
|
|
140
|
-
|
|
141
|
-
Stub for P101.
|
|
142
|
-
EOF
|
|
143
|
-
cat > docs/problems/known-error/101-unreleased.md <<'EOF'
|
|
144
|
-
# Problem 101: Unreleased
|
|
145
|
-
|
|
146
|
-
**Status**: Known Error
|
|
147
|
-
|
|
148
|
-
## Fix Strategy
|
|
149
|
-
|
|
150
|
-
Ship via `.changeset/p101-unreleased.md`.
|
|
151
|
-
EOF
|
|
152
|
-
git add .
|
|
153
|
-
git commit -q -m "init"
|
|
154
|
-
|
|
155
|
-
run "$SCRIPT" P101 docs/problems
|
|
156
|
-
[ "$status" -eq 3 ]
|
|
157
|
-
echo "$output" | grep -qi "unreleased\|not.*delet"
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
@test "ADR-099: present changeset remains unreleased after a sibling version bump" {
|
|
161
|
-
cat > .changeset/p211-present.md <<'EOF'
|
|
162
|
-
---
|
|
163
|
-
'@windyroad/itil': patch
|
|
164
|
-
---
|
|
165
|
-
|
|
166
|
-
P211 fix.
|
|
167
|
-
EOF
|
|
168
|
-
cat > docs/problems/known-error/211-present.md <<'EOF'
|
|
169
|
-
# Problem 211: Present Changeset
|
|
170
|
-
|
|
171
|
-
**Status**: Known Error
|
|
172
|
-
|
|
173
|
-
## Fix Strategy
|
|
174
|
-
|
|
175
|
-
Ship via `.changeset/p211-present.md`.
|
|
176
|
-
EOF
|
|
177
|
-
git add .
|
|
178
|
-
git commit -q -m "feat(itil): P211 fix"
|
|
179
|
-
|
|
180
|
-
cat > .changeset/p999-sibling.md <<'EOF'
|
|
181
|
-
---
|
|
182
|
-
'@windyroad/itil': patch
|
|
183
|
-
---
|
|
184
|
-
|
|
185
|
-
Sibling fix.
|
|
186
|
-
EOF
|
|
187
|
-
git add .changeset/p999-sibling.md
|
|
188
|
-
git commit -q -m "feat(itil): sibling fix"
|
|
189
|
-
git rm -q .changeset/p999-sibling.md
|
|
190
|
-
git commit -q -m "chore: version packages"
|
|
191
|
-
|
|
192
|
-
run "$SCRIPT" P211 docs/problems
|
|
193
|
-
[ "$status" -eq 3 ]
|
|
194
|
-
echo "$output" | grep -qi "unreleased"
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
@test "derive-release-vehicle: fresh changeset added AFTER the last release → still exit 3 (not a false de-facto-released)" {
|
|
198
|
-
# Guard: a prior release exists, but THIS changeset was added afterwards —
|
|
199
|
-
# its code has NOT shipped. Its add-commit is a DESCENDANT of the last
|
|
200
|
-
# version bump, so the is-ancestor discriminator must keep it at exit 3.
|
|
201
|
-
cat > .changeset/p888-old.md <<'EOF'
|
|
202
|
-
---
|
|
203
|
-
'@windyroad/itil': patch
|
|
204
|
-
---
|
|
205
|
-
|
|
206
|
-
Old fix that did ship.
|
|
207
|
-
EOF
|
|
208
|
-
git add .changeset/p888-old.md
|
|
209
|
-
git commit -q -m "feat(itil): old fix + changeset"
|
|
210
|
-
git rm -q .changeset/p888-old.md
|
|
211
|
-
git commit -q -m "chore: version packages" # prior release
|
|
212
|
-
|
|
213
|
-
# Now add a NEW changeset AFTER the release — genuinely unreleased.
|
|
214
|
-
mkdir -p .changeset
|
|
215
|
-
cat > .changeset/p889-fresh.md <<'EOF'
|
|
216
|
-
---
|
|
217
|
-
'@windyroad/itil': patch
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
Fresh fix, not yet released.
|
|
221
|
-
EOF
|
|
222
|
-
cat > docs/problems/known-error/889-fresh.md <<'EOF'
|
|
223
|
-
# Problem 889: Fresh
|
|
224
|
-
|
|
225
|
-
**Status**: Known Error
|
|
226
|
-
|
|
227
|
-
## Fix Strategy
|
|
228
|
-
|
|
229
|
-
Ship via `.changeset/p889-fresh.md`.
|
|
230
|
-
EOF
|
|
231
|
-
git add .
|
|
232
|
-
git commit -q -m "feat(itil): fresh fix + changeset"
|
|
233
|
-
|
|
234
|
-
run "$SCRIPT" P889 docs/problems
|
|
235
|
-
[ "$status" -eq 3 ]
|
|
236
|
-
echo "$output" | grep -qi "unreleased"
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
# ── Exit 0: happy path — full citation emitted ──────────────────────────────
|
|
240
|
-
|
|
241
|
-
@test "derive-release-vehicle: happy path — full citation block on stdout" {
|
|
242
|
-
# Set up the canonical release-cycle shape:
|
|
243
|
-
# commit A: ticket + changeset added
|
|
244
|
-
# commit B (on PR branch): chore: version packages — deletes changeset
|
|
245
|
-
# commit C (on main): merge commit referencing PR #42
|
|
246
|
-
cat > .changeset/p102-happy.md <<'EOF'
|
|
247
|
-
---
|
|
248
|
-
'@windyroad/itil': patch
|
|
249
|
-
---
|
|
250
|
-
|
|
251
|
-
P102 happy-path fix.
|
|
252
|
-
EOF
|
|
253
|
-
cat > docs/problems/known-error/102-happy.md <<'EOF'
|
|
254
|
-
# Problem 102: Happy
|
|
255
|
-
|
|
256
|
-
**Status**: Known Error
|
|
257
|
-
|
|
258
|
-
## Fix Strategy
|
|
259
|
-
|
|
260
|
-
Ship via `.changeset/p102-happy.md`.
|
|
261
|
-
EOF
|
|
262
|
-
git add .
|
|
263
|
-
git commit -q -m "feat(itil): P102 fix + changeset"
|
|
264
|
-
|
|
265
|
-
# Simulate the changeset-release/main PR branch: version-packages commit
|
|
266
|
-
# deletes the changeset; merge commit lands on main with a "#<N>" reference.
|
|
267
|
-
git checkout -q -b changeset-release/main
|
|
268
|
-
git rm -q .changeset/p102-happy.md
|
|
269
|
-
git commit -q -m "chore: version packages"
|
|
270
|
-
git checkout -q main
|
|
271
|
-
git merge --no-ff -q changeset-release/main -m "Merge pull request #42 from windyroad/changeset-release/main"
|
|
272
|
-
|
|
273
|
-
run "$SCRIPT" P102 docs/problems
|
|
274
|
-
[ "$status" -eq 0 ]
|
|
275
|
-
echo "$output" | grep -q "RELEASE_VEHICLE:"
|
|
276
|
-
echo "$output" | grep -q "changeset: .changeset/p102-happy.md"
|
|
277
|
-
echo "$output" | grep -qE "version-packages-commit: [0-9a-f]{7,40}"
|
|
278
|
-
echo "$output" | grep -qE "pr: #42"
|
|
279
|
-
echo "$output" | grep -qE "merge-commit: [0-9a-f]{7,40}"
|
|
280
|
-
echo "$output" | grep -qE "release-date: [0-9]{4}-[0-9]{2}-[0-9]{2}"
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
@test "derive-release-vehicle: per-state subdir layout (verifying/) is reachable" {
|
|
284
|
-
# ADR-031 per-state subdir — ticket may live in docs/problems/verifying/
|
|
285
|
-
# post-K→V. Helper must dual-tolerantly find it.
|
|
286
|
-
cat > .changeset/p103-subdir.md <<'EOF'
|
|
287
|
-
---
|
|
288
|
-
'@windyroad/itil': patch
|
|
289
|
-
---
|
|
290
|
-
|
|
291
|
-
P103.
|
|
292
|
-
EOF
|
|
293
|
-
cat > docs/problems/verifying/103-subdir.md <<'EOF'
|
|
294
|
-
# Problem 103: Subdir
|
|
295
|
-
|
|
296
|
-
**Status**: Verification Pending
|
|
297
|
-
|
|
298
|
-
## Fix Strategy
|
|
299
|
-
|
|
300
|
-
Ship via `.changeset/p103-subdir.md`.
|
|
301
|
-
EOF
|
|
302
|
-
git add .
|
|
303
|
-
git commit -q -m "init"
|
|
304
|
-
|
|
305
|
-
git checkout -q -b changeset-release/main
|
|
306
|
-
git rm -q .changeset/p103-subdir.md
|
|
307
|
-
git commit -q -m "chore: version packages"
|
|
308
|
-
git checkout -q main
|
|
309
|
-
git merge --no-ff -q changeset-release/main -m "Merge pull request #43 from windyroad/changeset-release/main"
|
|
310
|
-
|
|
311
|
-
run "$SCRIPT" P103 docs/problems
|
|
312
|
-
[ "$status" -eq 0 ]
|
|
313
|
-
echo "$output" | grep -q "changeset: .changeset/p103-subdir.md"
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
@test "derive-release-vehicle: accepts bare numeric ID (no P prefix)" {
|
|
317
|
-
cat > .changeset/p104-bare.md <<'EOF'
|
|
318
|
-
---
|
|
319
|
-
'@windyroad/itil': patch
|
|
320
|
-
---
|
|
321
|
-
|
|
322
|
-
P104.
|
|
323
|
-
EOF
|
|
324
|
-
cat > docs/problems/known-error/104-bare.md <<'EOF'
|
|
325
|
-
# Problem 104: Bare
|
|
326
|
-
|
|
327
|
-
**Status**: Known Error
|
|
328
|
-
|
|
329
|
-
## Fix Strategy
|
|
330
|
-
|
|
331
|
-
Ship via `.changeset/p104-bare.md`.
|
|
332
|
-
EOF
|
|
333
|
-
git add .
|
|
334
|
-
git commit -q -m "init"
|
|
335
|
-
|
|
336
|
-
git checkout -q -b changeset-release/main
|
|
337
|
-
git rm -q .changeset/p104-bare.md
|
|
338
|
-
git commit -q -m "chore: version packages"
|
|
339
|
-
git checkout -q main
|
|
340
|
-
git merge --no-ff -q changeset-release/main -m "Merge pull request #44 from windyroad/changeset-release/main"
|
|
341
|
-
|
|
342
|
-
# Plain "104" — no P prefix.
|
|
343
|
-
run "$SCRIPT" 104 docs/problems
|
|
344
|
-
[ "$status" -eq 0 ]
|
|
345
|
-
echo "$output" | grep -q "RELEASE_VEHICLE:"
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
# ── Exit 4: deletion commit found but no merge PR resolvable ────────────────
|
|
349
|
-
|
|
350
|
-
@test "derive-release-vehicle: deletion on main branch, no merge PR → exit 4" {
|
|
351
|
-
# Direct commit to main (no PR merge) — helper finds the deletion commit
|
|
352
|
-
# but cannot resolve a #<N> merge PR. Exit 4.
|
|
353
|
-
cat > .changeset/p105-no-pr.md <<'EOF'
|
|
354
|
-
---
|
|
355
|
-
'@windyroad/itil': patch
|
|
356
|
-
---
|
|
357
|
-
|
|
358
|
-
P105.
|
|
359
|
-
EOF
|
|
360
|
-
cat > docs/problems/known-error/105-no-pr.md <<'EOF'
|
|
361
|
-
# Problem 105: No PR
|
|
362
|
-
|
|
363
|
-
**Status**: Known Error
|
|
364
|
-
|
|
365
|
-
## Fix Strategy
|
|
366
|
-
|
|
367
|
-
Ship via `.changeset/p105-no-pr.md`.
|
|
368
|
-
EOF
|
|
369
|
-
git add .
|
|
370
|
-
git commit -q -m "init"
|
|
371
|
-
|
|
372
|
-
# Delete on main directly (no merge commit, no PR reference).
|
|
373
|
-
git rm -q .changeset/p105-no-pr.md
|
|
374
|
-
git commit -q -m "chore: version packages (direct)"
|
|
375
|
-
|
|
376
|
-
run "$SCRIPT" P105 docs/problems
|
|
377
|
-
[ "$status" -eq 4 ]
|
|
378
|
-
echo "$output" | grep -qiE "no.*(merge|pr)|cannot resolve"
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
# ── Default problems-dir resolution ─────────────────────────────────────────
|
|
382
|
-
|
|
383
|
-
@test "derive-release-vehicle: defaults to ./docs/problems when problems-dir omitted" {
|
|
384
|
-
cat > .changeset/p106-default.md <<'EOF'
|
|
385
|
-
---
|
|
386
|
-
'@windyroad/itil': patch
|
|
387
|
-
---
|
|
388
|
-
|
|
389
|
-
P106.
|
|
390
|
-
EOF
|
|
391
|
-
cat > docs/problems/known-error/106-default.md <<'EOF'
|
|
392
|
-
# Problem 106: Default
|
|
393
|
-
|
|
394
|
-
**Status**: Known Error
|
|
395
|
-
|
|
396
|
-
## Fix Strategy
|
|
397
|
-
|
|
398
|
-
Ship via `.changeset/p106-default.md`.
|
|
399
|
-
EOF
|
|
400
|
-
git add .
|
|
401
|
-
git commit -q -m "init"
|
|
402
|
-
|
|
403
|
-
git checkout -q -b changeset-release/main
|
|
404
|
-
git rm -q .changeset/p106-default.md
|
|
405
|
-
git commit -q -m "chore: version packages"
|
|
406
|
-
git checkout -q main
|
|
407
|
-
git merge --no-ff -q changeset-release/main -m "Merge pull request #46 from windyroad/changeset-release/main"
|
|
408
|
-
|
|
409
|
-
# Omit problems-dir.
|
|
410
|
-
run "$SCRIPT" P106
|
|
411
|
-
[ "$status" -eq 0 ]
|
|
412
|
-
echo "$output" | grep -q "changeset: .changeset/p106-default.md"
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
# ── Bin shim parity ─────────────────────────────────────────────────────────
|
|
416
|
-
|
|
417
|
-
@test "derive-release-vehicle: bin shim wr-itil-derive-release-vehicle exists and is executable" {
|
|
418
|
-
BIN="$(cd "$SCRIPTS_DIR/../bin" && pwd)/wr-itil-derive-release-vehicle"
|
|
419
|
-
[ -f "$BIN" ]
|
|
420
|
-
[ -x "$BIN" ]
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
@test "derive-release-vehicle: bin shim dispatches to the canonical script" {
|
|
424
|
-
BIN="$(cd "$SCRIPTS_DIR/../bin" && pwd)/wr-itil-derive-release-vehicle"
|
|
425
|
-
cat > .changeset/p107-shim.md <<'EOF'
|
|
426
|
-
---
|
|
427
|
-
'@windyroad/itil': patch
|
|
428
|
-
---
|
|
429
|
-
|
|
430
|
-
P107.
|
|
431
|
-
EOF
|
|
432
|
-
cat > docs/problems/known-error/107-shim.md <<'EOF'
|
|
433
|
-
# Problem 107: Shim
|
|
434
|
-
|
|
435
|
-
**Status**: Known Error
|
|
436
|
-
|
|
437
|
-
## Fix Strategy
|
|
438
|
-
|
|
439
|
-
Ship via `.changeset/p107-shim.md`.
|
|
440
|
-
EOF
|
|
441
|
-
git add .
|
|
442
|
-
git commit -q -m "init"
|
|
443
|
-
|
|
444
|
-
git checkout -q -b changeset-release/main
|
|
445
|
-
git rm -q .changeset/p107-shim.md
|
|
446
|
-
git commit -q -m "chore: version packages"
|
|
447
|
-
git checkout -q main
|
|
448
|
-
git merge --no-ff -q changeset-release/main -m "Merge pull request #47 from windyroad/changeset-release/main"
|
|
449
|
-
|
|
450
|
-
run "$BIN" P107 docs/problems
|
|
451
|
-
[ "$status" -eq 0 ]
|
|
452
|
-
echo "$output" | grep -q "RELEASE_VEHICLE:"
|
|
453
|
-
echo "$output" | grep -q "pr: #47"
|
|
454
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
# Behavioural test for detect-unratified-stories-maps.sh (ADR-090 detector).
|
|
3
|
-
# DRIFT-AWARE via the shared lazy-fingerprint lib: an artefact counts as ratified
|
|
4
|
-
# only when it is `confirmed` AND its stored oversight-hash matches current
|
|
5
|
-
# content. Surfaces never-ratified, unconfirmed, and drift-reopened (confirmed
|
|
6
|
-
# then edited) cases; omits genuinely-ratified ones. Always exit 0.
|
|
7
|
-
#
|
|
8
|
-
# @adr ADR-090
|
|
9
|
-
# @problem P404 (Phase 2)
|
|
10
|
-
|
|
11
|
-
setup() {
|
|
12
|
-
REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../.." && pwd)"
|
|
13
|
-
SCRIPT="${REPO_ROOT}/packages/itil/scripts/detect-unratified-stories-maps.sh"
|
|
14
|
-
MARK="${REPO_ROOT}/packages/itil/scripts/mark-story-oversight-confirmed.sh"
|
|
15
|
-
TMPD="$(mktemp -d)"
|
|
16
|
-
mkdir -p "$TMPD/stories/accepted" "$TMPD/story-maps/draft"
|
|
17
|
-
|
|
18
|
-
# Genuinely ratified (via the mark write-path) — should NOT be listed.
|
|
19
|
-
printf -- '---\nstatus: accepted\n---\n# ok\n' > "$TMPD/stories/accepted/STORY-1-ok.md"
|
|
20
|
-
bash "$MARK" "$TMPD/stories/accepted/STORY-1-ok.md"
|
|
21
|
-
printf -- '<head></head>\n<h1>ok map</h1>\n' > "$TMPD/story-maps/draft/STORY-MAP-1-ok.html"
|
|
22
|
-
bash "$MARK" "$TMPD/story-maps/draft/STORY-MAP-1-ok.html"
|
|
23
|
-
|
|
24
|
-
# Unconfirmed + unmarked — listed.
|
|
25
|
-
printf -- '---\nstatus: accepted\nhuman-oversight: unconfirmed\n---\n# no\n' > "$TMPD/stories/accepted/STORY-2-unconf.md"
|
|
26
|
-
printf -- '---\nstatus: accepted\n---\n# nomarker\n' > "$TMPD/stories/accepted/STORY-3-none.md"
|
|
27
|
-
|
|
28
|
-
# Drifted: ratified, then content edited afterward — listed.
|
|
29
|
-
printf -- '---\nstatus: accepted\n---\n# body\n' > "$TMPD/stories/accepted/STORY-4-drift.md"
|
|
30
|
-
bash "$MARK" "$TMPD/stories/accepted/STORY-4-drift.md"
|
|
31
|
-
printf '\nAn edit made after ratification.\n' >> "$TMPD/stories/accepted/STORY-4-drift.md"
|
|
32
|
-
|
|
33
|
-
# HTML map with no marker — listed.
|
|
34
|
-
printf -- '<h1>no meta</h1>\n' > "$TMPD/story-maps/draft/STORY-MAP-3-none.html"
|
|
35
|
-
}
|
|
36
|
-
teardown() { rm -rf "$TMPD"; }
|
|
37
|
-
|
|
38
|
-
@test "detect: lists unconfirmed + unmarked + DRIFTED, omits genuinely-ratified; exit 0" {
|
|
39
|
-
run bash "$SCRIPT" "$TMPD/stories" "$TMPD/story-maps"
|
|
40
|
-
[ "$status" -eq 0 ]
|
|
41
|
-
[[ "$output" == *"STORY-2-unconf.md"* ]]
|
|
42
|
-
[[ "$output" == *"STORY-3-none.md"* ]]
|
|
43
|
-
[[ "$output" == *"STORY-4-drift.md"* ]]
|
|
44
|
-
[[ "$output" == *"STORY-MAP-3-none.html"* ]]
|
|
45
|
-
[[ "$output" != *"STORY-1-ok.md"* ]]
|
|
46
|
-
[[ "$output" != *"STORY-MAP-1-ok.html"* ]]
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@test "detect: all-ratified set yields empty output, exit 0" {
|
|
50
|
-
rm "$TMPD/stories/accepted/STORY-2-unconf.md" "$TMPD/stories/accepted/STORY-3-none.md" \
|
|
51
|
-
"$TMPD/stories/accepted/STORY-4-drift.md" "$TMPD/story-maps/draft/STORY-MAP-3-none.html"
|
|
52
|
-
run bash "$SCRIPT" "$TMPD/stories" "$TMPD/story-maps"
|
|
53
|
-
[ "$status" -eq 0 ]
|
|
54
|
-
[ -z "$output" ]
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@test "detect: missing dirs are tolerated (exit 0, no crash)" {
|
|
58
|
-
run bash "$SCRIPT" "$TMPD/nope-stories" "$TMPD/nope-maps"
|
|
59
|
-
[ "$status" -eq 0 ]
|
|
60
|
-
}
|