@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,773 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
# @problem P346 — `/wr-itil:review-problems` has no path to close tickets that
|
|
4
|
-
# are no longer relevant (evidence-based, NOT age-based) —
|
|
5
|
-
# structural outflow gap drives monotonic backlog growth.
|
|
6
|
-
# Phase 1 ships the auto-close on "file no longer exists in
|
|
7
|
-
# codebase" evidence shape.
|
|
8
|
-
#
|
|
9
|
-
# Contract: `evaluate-relevance.sh <ticket-file> [<min-age-days>]` reads the
|
|
10
|
-
# ticket frontmatter for **Reported**:, applies an age gate, extracts file
|
|
11
|
-
# paths matching well-known repo subdirs from the ticket body (excluding
|
|
12
|
-
# self-references to docs/problems/*), runs `git ls-files --error-unmatch`
|
|
13
|
-
# on each, and emits a structured verdict.
|
|
14
|
-
#
|
|
15
|
-
# Output (stdout, one line):
|
|
16
|
-
# CLOSE-CANDIDATE <basename> — all <N> file paths absent: <semicolon list>
|
|
17
|
-
# KEEP <basename> — <M>/<N> paths still present
|
|
18
|
-
# SKIP <basename> — <reason>
|
|
19
|
-
#
|
|
20
|
-
# Exit codes:
|
|
21
|
-
# 0 = CLOSE-CANDIDATE
|
|
22
|
-
# 1 = KEEP
|
|
23
|
-
# 2 = SKIP
|
|
24
|
-
# 3 = error
|
|
25
|
-
#
|
|
26
|
-
# @adr ADR-079 (Evidence-based relevance-close pass — Phase 1)
|
|
27
|
-
# @adr ADR-049 (bin/ on PATH shim — adopter-safe script resolution)
|
|
28
|
-
# @adr ADR-022 (Lifecycle extension — Open|Known Error → Closed-with-reason)
|
|
29
|
-
# @adr ADR-026 (Agent output grounding — cite + persist + uncertainty)
|
|
30
|
-
# @adr ADR-052 (Behavioural bats default)
|
|
31
|
-
# @jtbd JTBD-001 (Enforce Governance — under-60s review-flow served by smaller queue)
|
|
32
|
-
# @jtbd JTBD-006 (AFK — mechanical evidence not judgment-call)
|
|
33
|
-
# @jtbd JTBD-101 (Extend the Suite — extensible pattern per evidence shape)
|
|
34
|
-
# @jtbd JTBD-201 (Audit trail — closed-ticket section preserves close reason)
|
|
35
|
-
|
|
36
|
-
setup() {
|
|
37
|
-
SCRIPTS_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
|
|
38
|
-
SCRIPT="$SCRIPTS_DIR/evaluate-relevance.sh"
|
|
39
|
-
FIXTURE_DIR="$(mktemp -d)"
|
|
40
|
-
cd "$FIXTURE_DIR"
|
|
41
|
-
git init -q -b main
|
|
42
|
-
git config user.email test@example.com
|
|
43
|
-
git config user.name "Test"
|
|
44
|
-
mkdir -p docs/problems/open docs/problems/known-error docs/problems/closed packages/itil/scripts docs/decisions
|
|
45
|
-
|
|
46
|
-
# An "old" Reported date: 60 days before today. ISO date arithmetic
|
|
47
|
-
# portable across BSD + GNU date.
|
|
48
|
-
OLD_DATE=$(date -u -v-60d "+%Y-%m-%d" 2>/dev/null || date -u -d '60 days ago' "+%Y-%m-%d")
|
|
49
|
-
# A "fresh" Reported date: 1 day before today.
|
|
50
|
-
FRESH_DATE=$(date -u -v-1d "+%Y-%m-%d" 2>/dev/null || date -u -d '1 day ago' "+%Y-%m-%d")
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
teardown() {
|
|
54
|
-
cd /
|
|
55
|
-
rm -rf "$FIXTURE_DIR"
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
# ── Existence + executable ──────────────────────────────────────────────────
|
|
59
|
-
|
|
60
|
-
@test "evaluate-relevance: script exists" {
|
|
61
|
-
[ -f "$SCRIPT" ]
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@test "evaluate-relevance: script is executable" {
|
|
65
|
-
[ -x "$SCRIPT" ]
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
@test "evaluate-relevance: PATH shim exists and dispatches" {
|
|
69
|
-
SHIM="$SCRIPTS_DIR/../bin/wr-itil-evaluate-relevance"
|
|
70
|
-
[ -f "$SHIM" ]
|
|
71
|
-
[ -x "$SHIM" ]
|
|
72
|
-
# Shim exec's the canonical script body.
|
|
73
|
-
grep -q "evaluate-relevance.sh" "$SHIM"
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
# ── Usage / error path ──────────────────────────────────────────────────────
|
|
77
|
-
|
|
78
|
-
@test "evaluate-relevance: no args → exit 3 with usage stderr" {
|
|
79
|
-
run "$SCRIPT"
|
|
80
|
-
[ "$status" -eq 3 ]
|
|
81
|
-
[[ "$output" == *"usage"* ]]
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@test "evaluate-relevance: nonexistent ticket file → exit 3" {
|
|
85
|
-
run "$SCRIPT" /nonexistent/ticket.md
|
|
86
|
-
[ "$status" -eq 3 ]
|
|
87
|
-
[[ "$output" == *"not found"* ]]
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
# ── Age gate (SKIP exit 2) ──────────────────────────────────────────────────
|
|
91
|
-
|
|
92
|
-
@test "evaluate-relevance: fresh ticket (< 7 days) → SKIP exit 2" {
|
|
93
|
-
cat > docs/problems/open/100-foo.md <<EOF
|
|
94
|
-
# Problem 100: foo
|
|
95
|
-
|
|
96
|
-
**Status**: Open
|
|
97
|
-
**Reported**: $FRESH_DATE
|
|
98
|
-
|
|
99
|
-
## Description
|
|
100
|
-
|
|
101
|
-
Bug in packages/itil/scripts/imaginary.sh
|
|
102
|
-
EOF
|
|
103
|
-
run "$SCRIPT" docs/problems/open/100-foo.md
|
|
104
|
-
[ "$status" -eq 2 ]
|
|
105
|
-
[[ "$output" == "SKIP "*"age gate"* ]]
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
@test "evaluate-relevance: no Reported date → SKIP exit 2" {
|
|
109
|
-
cat > docs/problems/open/101-bar.md <<EOF
|
|
110
|
-
# Problem 101: bar
|
|
111
|
-
|
|
112
|
-
**Status**: Open
|
|
113
|
-
|
|
114
|
-
## Description
|
|
115
|
-
|
|
116
|
-
packages/itil/scripts/missing.sh
|
|
117
|
-
EOF
|
|
118
|
-
run "$SCRIPT" docs/problems/open/101-bar.md
|
|
119
|
-
[ "$status" -eq 2 ]
|
|
120
|
-
[[ "$output" == *"no Reported date"* ]]
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
# ── No extractable paths (SKIP exit 2) ──────────────────────────────────────
|
|
124
|
-
|
|
125
|
-
@test "evaluate-relevance: no extractable file paths → SKIP exit 2" {
|
|
126
|
-
cat > docs/problems/open/102-baz.md <<EOF
|
|
127
|
-
# Problem 102: baz
|
|
128
|
-
|
|
129
|
-
**Status**: Open
|
|
130
|
-
**Reported**: $OLD_DATE
|
|
131
|
-
|
|
132
|
-
## Description
|
|
133
|
-
|
|
134
|
-
A general complaint about agent behaviour with no file references.
|
|
135
|
-
EOF
|
|
136
|
-
run "$SCRIPT" docs/problems/open/102-baz.md
|
|
137
|
-
[ "$status" -eq 2 ]
|
|
138
|
-
[[ "$output" == *"no extractable file paths"* ]]
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
@test "evaluate-relevance: only self-references to docs/problems/* → SKIP exit 2" {
|
|
142
|
-
cat > docs/problems/open/103-qux.md <<EOF
|
|
143
|
-
# Problem 103: qux
|
|
144
|
-
|
|
145
|
-
**Status**: Open
|
|
146
|
-
**Reported**: $OLD_DATE
|
|
147
|
-
|
|
148
|
-
## Description
|
|
149
|
-
|
|
150
|
-
Duplicate concern with docs/problems/open/099-other.md and docs/problems/known-error/088-third.md.
|
|
151
|
-
EOF
|
|
152
|
-
run "$SCRIPT" docs/problems/open/103-qux.md
|
|
153
|
-
[ "$status" -eq 2 ]
|
|
154
|
-
[[ "$output" == *"no extractable file paths"* ]]
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
# ── CLOSE-CANDIDATE path (exit 0) ───────────────────────────────────────────
|
|
158
|
-
|
|
159
|
-
@test "evaluate-relevance: old ticket + all paths absent → CLOSE-CANDIDATE exit 0" {
|
|
160
|
-
cat > docs/problems/open/104-stale.md <<EOF
|
|
161
|
-
# Problem 104: stale
|
|
162
|
-
|
|
163
|
-
**Status**: Open
|
|
164
|
-
**Reported**: $OLD_DATE
|
|
165
|
-
|
|
166
|
-
## Description
|
|
167
|
-
|
|
168
|
-
Bug in packages/itil/scripts/imaginary-helper.sh that no longer exists.
|
|
169
|
-
Related: docs/decisions/999-imaginary-adr.proposed.md.
|
|
170
|
-
EOF
|
|
171
|
-
run "$SCRIPT" docs/problems/open/104-stale.md
|
|
172
|
-
[ "$status" -eq 0 ]
|
|
173
|
-
[[ "$output" == "CLOSE-CANDIDATE "*"104-stale.md"*"all 2 file paths absent"* ]]
|
|
174
|
-
[[ "$output" == *"packages/itil/scripts/imaginary-helper.sh"* ]]
|
|
175
|
-
[[ "$output" == *"docs/decisions/999-imaginary-adr.proposed.md"* ]]
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
@test "evaluate-relevance: old ticket + single absent path → CLOSE-CANDIDATE exit 0" {
|
|
179
|
-
cat > docs/problems/open/105-single.md <<EOF
|
|
180
|
-
# Problem 105: single
|
|
181
|
-
|
|
182
|
-
**Status**: Open
|
|
183
|
-
**Reported**: $OLD_DATE
|
|
184
|
-
|
|
185
|
-
## Description
|
|
186
|
-
|
|
187
|
-
The script at packages/itil/scripts/dead-helper.sh fails.
|
|
188
|
-
EOF
|
|
189
|
-
run "$SCRIPT" docs/problems/open/105-single.md
|
|
190
|
-
[ "$status" -eq 0 ]
|
|
191
|
-
[[ "$output" == "CLOSE-CANDIDATE "*"all 1 file paths absent"* ]]
|
|
192
|
-
[[ "$output" == *"packages/itil/scripts/dead-helper.sh"* ]]
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
# ── KEEP path (exit 1) ──────────────────────────────────────────────────────
|
|
196
|
-
|
|
197
|
-
@test "evaluate-relevance: old ticket + all paths present → KEEP exit 1" {
|
|
198
|
-
# Create + stage the file so git ls-files sees it
|
|
199
|
-
echo "live" > packages/itil/scripts/live-helper.sh
|
|
200
|
-
git add packages/itil/scripts/live-helper.sh
|
|
201
|
-
|
|
202
|
-
cat > docs/problems/open/106-live.md <<EOF
|
|
203
|
-
# Problem 106: live
|
|
204
|
-
|
|
205
|
-
**Status**: Open
|
|
206
|
-
**Reported**: $OLD_DATE
|
|
207
|
-
|
|
208
|
-
## Description
|
|
209
|
-
|
|
210
|
-
Bug in packages/itil/scripts/live-helper.sh.
|
|
211
|
-
EOF
|
|
212
|
-
run "$SCRIPT" docs/problems/open/106-live.md
|
|
213
|
-
[ "$status" -eq 1 ]
|
|
214
|
-
[[ "$output" == "KEEP "*"1/1 paths still present"* ]]
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
@test "evaluate-relevance: old ticket + mixed paths (one present, one absent) → KEEP exit 1" {
|
|
218
|
-
echo "live" > packages/itil/scripts/exists.sh
|
|
219
|
-
git add packages/itil/scripts/exists.sh
|
|
220
|
-
|
|
221
|
-
cat > docs/problems/open/107-mixed.md <<EOF
|
|
222
|
-
# Problem 107: mixed
|
|
223
|
-
|
|
224
|
-
**Status**: Open
|
|
225
|
-
**Reported**: $OLD_DATE
|
|
226
|
-
|
|
227
|
-
## Description
|
|
228
|
-
|
|
229
|
-
Interaction between packages/itil/scripts/exists.sh and
|
|
230
|
-
packages/itil/scripts/gone.sh produces wrong result.
|
|
231
|
-
EOF
|
|
232
|
-
run "$SCRIPT" docs/problems/open/107-mixed.md
|
|
233
|
-
[ "$status" -eq 1 ]
|
|
234
|
-
[[ "$output" == "KEEP "*"1/2 paths still present"* ]]
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
# ── Known Error tickets (exit 0) ────────────────────────────────────────────
|
|
238
|
-
|
|
239
|
-
@test "evaluate-relevance: known-error ticket with all paths absent → CLOSE-CANDIDATE exit 0" {
|
|
240
|
-
cat > docs/problems/known-error/108-ke-stale.md <<EOF
|
|
241
|
-
# Problem 108: ke-stale
|
|
242
|
-
|
|
243
|
-
**Status**: Known Error
|
|
244
|
-
**Reported**: $OLD_DATE
|
|
245
|
-
|
|
246
|
-
## Description
|
|
247
|
-
|
|
248
|
-
Fix strategy referenced packages/itil/scripts/abandoned-fix.sh.
|
|
249
|
-
|
|
250
|
-
## Root Cause Analysis
|
|
251
|
-
|
|
252
|
-
Root cause was identified in packages/itil/scripts/abandoned-fix.sh.
|
|
253
|
-
EOF
|
|
254
|
-
run "$SCRIPT" docs/problems/known-error/108-ke-stale.md
|
|
255
|
-
[ "$status" -eq 0 ]
|
|
256
|
-
[[ "$output" == "CLOSE-CANDIDATE "*"108-ke-stale.md"* ]]
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
# ── Custom age gate ─────────────────────────────────────────────────────────
|
|
260
|
-
|
|
261
|
-
@test "evaluate-relevance: custom min-age-days=30 keeps a 15-day-old ticket as SKIP" {
|
|
262
|
-
MED_DATE=$(date -u -v-15d "+%Y-%m-%d" 2>/dev/null || date -u -d '15 days ago' "+%Y-%m-%d")
|
|
263
|
-
cat > docs/problems/open/109-medium.md <<EOF
|
|
264
|
-
# Problem 109: medium
|
|
265
|
-
|
|
266
|
-
**Status**: Open
|
|
267
|
-
**Reported**: $MED_DATE
|
|
268
|
-
|
|
269
|
-
## Description
|
|
270
|
-
|
|
271
|
-
packages/itil/scripts/missing.sh is broken.
|
|
272
|
-
EOF
|
|
273
|
-
run "$SCRIPT" docs/problems/open/109-medium.md 30
|
|
274
|
-
[ "$status" -eq 2 ]
|
|
275
|
-
[[ "$output" == *"age gate"* ]]
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
# ── Output contract: verdict starts with the keyword ────────────────────────
|
|
279
|
-
|
|
280
|
-
@test "evaluate-relevance: CLOSE-CANDIDATE verdict begins with the literal keyword" {
|
|
281
|
-
cat > docs/problems/open/110-verdict.md <<EOF
|
|
282
|
-
# Problem 110: verdict
|
|
283
|
-
|
|
284
|
-
**Status**: Open
|
|
285
|
-
**Reported**: $OLD_DATE
|
|
286
|
-
|
|
287
|
-
## Description
|
|
288
|
-
|
|
289
|
-
packages/itil/scripts/missing-x.sh
|
|
290
|
-
EOF
|
|
291
|
-
run "$SCRIPT" docs/problems/open/110-verdict.md
|
|
292
|
-
[ "$status" -eq 0 ]
|
|
293
|
-
[[ "${lines[0]}" == "CLOSE-CANDIDATE "* ]]
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
@test "evaluate-relevance: KEEP verdict begins with the literal keyword" {
|
|
297
|
-
echo "x" > packages/itil/scripts/present-x.sh
|
|
298
|
-
git add packages/itil/scripts/present-x.sh
|
|
299
|
-
|
|
300
|
-
cat > docs/problems/open/111-keep-verdict.md <<EOF
|
|
301
|
-
# Problem 111: keep-verdict
|
|
302
|
-
|
|
303
|
-
**Status**: Open
|
|
304
|
-
**Reported**: $OLD_DATE
|
|
305
|
-
|
|
306
|
-
## Description
|
|
307
|
-
|
|
308
|
-
packages/itil/scripts/present-x.sh
|
|
309
|
-
EOF
|
|
310
|
-
run "$SCRIPT" docs/problems/open/111-keep-verdict.md
|
|
311
|
-
[ "$status" -eq 1 ]
|
|
312
|
-
[[ "${lines[0]}" == "KEEP "* ]]
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
@test "evaluate-relevance: SKIP verdict begins with the literal keyword" {
|
|
316
|
-
cat > docs/problems/open/112-skip-verdict.md <<EOF
|
|
317
|
-
# Problem 112: skip-verdict
|
|
318
|
-
|
|
319
|
-
**Status**: Open
|
|
320
|
-
**Reported**: $FRESH_DATE
|
|
321
|
-
|
|
322
|
-
## Description
|
|
323
|
-
|
|
324
|
-
packages/itil/scripts/anything.sh
|
|
325
|
-
EOF
|
|
326
|
-
run "$SCRIPT" docs/problems/open/112-skip-verdict.md
|
|
327
|
-
[ "$status" -eq 2 ]
|
|
328
|
-
[[ "${lines[0]}" == "SKIP "* ]]
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
# ── Phase 2 Shape 2: ADR-shipped with `human-oversight: confirmed` ───────────
|
|
332
|
-
#
|
|
333
|
-
# @adr ADR-079 Phase 2 — shape 2 covers 8 of 14 closes in the 2026-05-31
|
|
334
|
-
# labeled fixture set (P012/P015/P018/P022/P033/P039/
|
|
335
|
-
# P194/P292). Mechanical check: grep ticket body for
|
|
336
|
-
# ADR-NNN refs; for each, verify
|
|
337
|
-
# docs/decisions/<NNN>-*.md exists AND frontmatter has
|
|
338
|
-
# `human-oversight: confirmed`.
|
|
339
|
-
|
|
340
|
-
@test "evaluate-relevance: Phase 2 shape 2 — ADR-shipped-confirmed → CLOSE-CANDIDATE exit 0" {
|
|
341
|
-
cat > docs/decisions/037-confirmed-adr.proposed.md <<EOF
|
|
342
|
-
---
|
|
343
|
-
status: "proposed"
|
|
344
|
-
human-oversight: confirmed
|
|
345
|
-
oversight-date: 2026-05-25
|
|
346
|
-
---
|
|
347
|
-
|
|
348
|
-
# ADR-037: Test confirmed ADR
|
|
349
|
-
EOF
|
|
350
|
-
git add docs/decisions/037-confirmed-adr.proposed.md
|
|
351
|
-
|
|
352
|
-
cat > docs/problems/open/120-adr-confirmed.md <<EOF
|
|
353
|
-
# Problem 120: adr-confirmed
|
|
354
|
-
|
|
355
|
-
**Status**: Open
|
|
356
|
-
**Reported**: $OLD_DATE
|
|
357
|
-
|
|
358
|
-
## Description
|
|
359
|
-
|
|
360
|
-
ADR-037 was the design decision; the implementation has landed and the
|
|
361
|
-
ADR is human-oversight: confirmed. Concern no longer concerning.
|
|
362
|
-
EOF
|
|
363
|
-
run "$SCRIPT" docs/problems/open/120-adr-confirmed.md
|
|
364
|
-
[ "$status" -eq 0 ]
|
|
365
|
-
[[ "$output" == "CLOSE-CANDIDATE "*"shapes: "*"ADR-shipped-confirmed"* ]]
|
|
366
|
-
[[ "$output" == *"ADR-037"* ]]
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
@test "evaluate-relevance: Phase 2 shape 2 — ADR exists but NOT confirmed → no shape 2 fire" {
|
|
370
|
-
cat > docs/decisions/038-proposed-but-unconfirmed.proposed.md <<EOF
|
|
371
|
-
---
|
|
372
|
-
status: "proposed"
|
|
373
|
-
---
|
|
374
|
-
|
|
375
|
-
# ADR-038: Not yet confirmed
|
|
376
|
-
EOF
|
|
377
|
-
git add docs/decisions/038-proposed-but-unconfirmed.proposed.md
|
|
378
|
-
|
|
379
|
-
cat > docs/problems/open/121-adr-unconfirmed.md <<EOF
|
|
380
|
-
# Problem 121: adr-unconfirmed
|
|
381
|
-
|
|
382
|
-
**Status**: Open
|
|
383
|
-
**Reported**: $OLD_DATE
|
|
384
|
-
|
|
385
|
-
## Description
|
|
386
|
-
|
|
387
|
-
ADR-038 captured the design but is not yet confirmed by human review.
|
|
388
|
-
EOF
|
|
389
|
-
run "$SCRIPT" docs/problems/open/121-adr-unconfirmed.md
|
|
390
|
-
# Without other shape matches, shape 2 alone (unconfirmed ADR) MUST NOT
|
|
391
|
-
# produce a CLOSE-CANDIDATE. Verdict routes to SKIP (no extractable
|
|
392
|
-
# paths to ground shape 1) or KEEP — never CLOSE-CANDIDATE.
|
|
393
|
-
[ "$status" -ne 0 ]
|
|
394
|
-
[[ "${lines[0]}" != "CLOSE-CANDIDATE "* ]]
|
|
395
|
-
[[ "${lines[0]}" != "CLOSE-CANDIDATE-WITH-CAVEAT "* ]]
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
# ── Phase 2 Shape 3: named-skill-or-feature-exists ───────────────────────────
|
|
399
|
-
#
|
|
400
|
-
# @adr ADR-079 Phase 2 — shape 3 covers 6 of 14 closes (P014/P034/P045/P079/
|
|
401
|
-
# P190/P289). Verifies the cited SKILL.md / hook /
|
|
402
|
-
# agent / slash-command surface exists.
|
|
403
|
-
|
|
404
|
-
@test "evaluate-relevance: Phase 2 shape 3 — SKILL.md exists → CLOSE-CANDIDATE exit 0" {
|
|
405
|
-
mkdir -p packages/itil/skills/some-feature
|
|
406
|
-
cat > packages/itil/skills/some-feature/SKILL.md <<EOF
|
|
407
|
-
---
|
|
408
|
-
name: wr-itil:some-feature
|
|
409
|
-
---
|
|
410
|
-
# Some Feature
|
|
411
|
-
EOF
|
|
412
|
-
git add packages/itil/skills/some-feature/SKILL.md
|
|
413
|
-
|
|
414
|
-
cat > docs/problems/open/130-feature-shipped.md <<EOF
|
|
415
|
-
# Problem 130: feature-shipped
|
|
416
|
-
|
|
417
|
-
**Status**: Open
|
|
418
|
-
**Reported**: $OLD_DATE
|
|
419
|
-
|
|
420
|
-
## Description
|
|
421
|
-
|
|
422
|
-
The feature this ticket asks for has shipped at
|
|
423
|
-
\`packages/itil/skills/some-feature/SKILL.md\`. Concern resolved.
|
|
424
|
-
EOF
|
|
425
|
-
run "$SCRIPT" docs/problems/open/130-feature-shipped.md
|
|
426
|
-
[ "$status" -eq 0 ]
|
|
427
|
-
[[ "$output" == "CLOSE-CANDIDATE "*"shapes: "*"named-skill-or-feature-exists"* ]]
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
@test "evaluate-relevance: Phase 2 shape 3 — slash-command ref + SKILL exists → CLOSE-CANDIDATE exit 0" {
|
|
431
|
-
mkdir -p packages/architect/skills/capture-adr
|
|
432
|
-
cat > packages/architect/skills/capture-adr/SKILL.md <<EOF
|
|
433
|
-
---
|
|
434
|
-
name: wr-architect:capture-adr
|
|
435
|
-
---
|
|
436
|
-
EOF
|
|
437
|
-
git add packages/architect/skills/capture-adr/SKILL.md
|
|
438
|
-
|
|
439
|
-
cat > docs/problems/open/131-slash-command.md <<EOF
|
|
440
|
-
# Problem 131: slash-command
|
|
441
|
-
|
|
442
|
-
**Status**: Open
|
|
443
|
-
**Reported**: $OLD_DATE
|
|
444
|
-
|
|
445
|
-
## Description
|
|
446
|
-
|
|
447
|
-
The aside-invocation surface /wr-architect:capture-adr now exists and
|
|
448
|
-
covers the original concern.
|
|
449
|
-
EOF
|
|
450
|
-
run "$SCRIPT" docs/problems/open/131-slash-command.md
|
|
451
|
-
[ "$status" -eq 0 ]
|
|
452
|
-
[[ "$output" == "CLOSE-CANDIDATE "*"named-skill-or-feature-exists"* ]]
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
# ── Phase 2 Shape 4: self-marker-in-body (line-anchored regex per A2) ────────
|
|
456
|
-
#
|
|
457
|
-
# @adr ADR-079 Phase 2 — shape 4 explicit in P289 ("Close to Verifying"),
|
|
458
|
-
# contributory in P033 ("## Fix Released"). Regex
|
|
459
|
-
# line-anchored per architect advisory A2 to avoid
|
|
460
|
-
# mid-prose false-positives.
|
|
461
|
-
|
|
462
|
-
@test "evaluate-relevance: Phase 2 shape 4 — 'Close to Verifying' line marker → CLOSE-CANDIDATE exit 0" {
|
|
463
|
-
cat > docs/problems/open/140-self-marker.md <<EOF
|
|
464
|
-
# Problem 140: self-marker
|
|
465
|
-
|
|
466
|
-
**Status**: Open
|
|
467
|
-
**Reported**: $OLD_DATE
|
|
468
|
-
|
|
469
|
-
## Description
|
|
470
|
-
|
|
471
|
-
Work has been done.
|
|
472
|
-
|
|
473
|
-
## Resolution
|
|
474
|
-
|
|
475
|
-
The fix shipped 2026-05-27. Close to Verifying.
|
|
476
|
-
EOF
|
|
477
|
-
run "$SCRIPT" docs/problems/open/140-self-marker.md
|
|
478
|
-
[ "$status" -eq 0 ]
|
|
479
|
-
[[ "$output" == "CLOSE-CANDIDATE "*"self-marker-in-body"* ]]
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
@test "evaluate-relevance: Phase 2 shape 4 — '## Fix Released' heading → CLOSE-CANDIDATE exit 0" {
|
|
483
|
-
cat > docs/problems/open/141-fix-released.md <<EOF
|
|
484
|
-
# Problem 141: fix-released
|
|
485
|
-
|
|
486
|
-
**Status**: Open
|
|
487
|
-
**Reported**: $OLD_DATE
|
|
488
|
-
|
|
489
|
-
## Description
|
|
490
|
-
|
|
491
|
-
Bug.
|
|
492
|
-
|
|
493
|
-
## Fix Released
|
|
494
|
-
|
|
495
|
-
Implemented 2026-04-17.
|
|
496
|
-
EOF
|
|
497
|
-
run "$SCRIPT" docs/problems/open/141-fix-released.md
|
|
498
|
-
[ "$status" -eq 0 ]
|
|
499
|
-
[[ "$output" == "CLOSE-CANDIDATE "*"self-marker-in-body"* ]]
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
@test "evaluate-relevance: Phase 2 shape 4 — 'DONE 2026-' line marker → CLOSE-CANDIDATE exit 0" {
|
|
503
|
-
cat > docs/problems/open/142-done-marker.md <<EOF
|
|
504
|
-
# Problem 142: done-marker
|
|
505
|
-
|
|
506
|
-
**Status**: Open
|
|
507
|
-
**Reported**: $OLD_DATE
|
|
508
|
-
|
|
509
|
-
## Description
|
|
510
|
-
|
|
511
|
-
Description.
|
|
512
|
-
|
|
513
|
-
### Investigation Tasks
|
|
514
|
-
|
|
515
|
-
- [x] DONE 2026-05-27 — Migration-strategy decision executed.
|
|
516
|
-
EOF
|
|
517
|
-
run "$SCRIPT" docs/problems/open/142-done-marker.md
|
|
518
|
-
[ "$status" -eq 0 ]
|
|
519
|
-
[[ "$output" == "CLOSE-CANDIDATE "*"self-marker-in-body"* ]]
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
@test "evaluate-relevance: Phase 2 shape 4 — mid-prose 'close to verifying' (lowercase, narrative) → KEEP exit 1 (negative fixture per advisory A2)" {
|
|
523
|
-
cat > docs/problems/open/143-mid-prose.md <<EOF
|
|
524
|
-
# Problem 143: mid-prose
|
|
525
|
-
|
|
526
|
-
**Status**: Open
|
|
527
|
-
**Reported**: $OLD_DATE
|
|
528
|
-
|
|
529
|
-
## Description
|
|
530
|
-
|
|
531
|
-
The team thinks this is close to verifying our hypothesis but no concrete
|
|
532
|
-
shipped evidence exists yet — still investigating.
|
|
533
|
-
EOF
|
|
534
|
-
run "$SCRIPT" docs/problems/open/143-mid-prose.md
|
|
535
|
-
# Without other shape matches, mid-prose narrative MUST NOT fire shape 4.
|
|
536
|
-
# Verdict should be SKIP (no extractable paths) or KEEP — never CLOSE-CANDIDATE.
|
|
537
|
-
[ "$status" -ne 0 ]
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
# ── Phase 2 Shape 5: driver-child-ticket-closed ──────────────────────────────
|
|
541
|
-
#
|
|
542
|
-
# @adr ADR-079 Phase 2 — shape 5 contributory in several closes (e.g. P014
|
|
543
|
-
# cites closed P155 driver). Parses ## Related for
|
|
544
|
-
# P<NNN> refs; checks if any are in
|
|
545
|
-
# docs/problems/closed/.
|
|
546
|
-
|
|
547
|
-
@test "evaluate-relevance: Phase 2 shape 5 — Related cites closed driver → CLOSE-CANDIDATE exit 0" {
|
|
548
|
-
cat > docs/problems/closed/155-driver-done.md <<EOF
|
|
549
|
-
# Problem 155: driver-done
|
|
550
|
-
|
|
551
|
-
**Status**: Closed
|
|
552
|
-
EOF
|
|
553
|
-
git add docs/problems/closed/155-driver-done.md
|
|
554
|
-
|
|
555
|
-
cat > docs/problems/open/150-child-of-closed.md <<EOF
|
|
556
|
-
# Problem 150: child-of-closed
|
|
557
|
-
|
|
558
|
-
**Status**: Open
|
|
559
|
-
**Reported**: $OLD_DATE
|
|
560
|
-
|
|
561
|
-
## Description
|
|
562
|
-
|
|
563
|
-
This is the umbrella for several driver tickets.
|
|
564
|
-
|
|
565
|
-
## Related
|
|
566
|
-
|
|
567
|
-
- **P155** — implementation driver.
|
|
568
|
-
EOF
|
|
569
|
-
run "$SCRIPT" docs/problems/open/150-child-of-closed.md
|
|
570
|
-
[ "$status" -eq 0 ]
|
|
571
|
-
[[ "$output" == "CLOSE-CANDIDATE "*"driver-child-ticket-closed"* ]]
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
@test "evaluate-relevance: Phase 2 shape 5 — Related cites closed driver BUT child has independent open work → KEEP exit 1 (advisory A1 negative fixture)" {
|
|
575
|
-
cat > docs/problems/closed/156-driver-done.md <<EOF
|
|
576
|
-
# Problem 156: driver-done
|
|
577
|
-
|
|
578
|
-
**Status**: Closed
|
|
579
|
-
EOF
|
|
580
|
-
git add docs/problems/closed/156-driver-done.md
|
|
581
|
-
|
|
582
|
-
cat > docs/problems/open/151-independent.md <<EOF
|
|
583
|
-
# Problem 151: independent
|
|
584
|
-
|
|
585
|
-
**Status**: Open
|
|
586
|
-
**Reported**: $OLD_DATE
|
|
587
|
-
|
|
588
|
-
## Description
|
|
589
|
-
|
|
590
|
-
While the driver P156 is closed, this ticket has its own outstanding
|
|
591
|
-
investigation around \`packages/itil/skills/unrelated-future-skill/SKILL.md\`
|
|
592
|
-
which has not been implemented yet.
|
|
593
|
-
|
|
594
|
-
## Related
|
|
595
|
-
|
|
596
|
-
- **P156** — original driver (closed); this ticket carries new scope beyond P156.
|
|
597
|
-
EOF
|
|
598
|
-
run "$SCRIPT" docs/problems/open/151-independent.md
|
|
599
|
-
# The script extracts \`packages/itil/skills/unrelated-future-skill/SKILL.md\`
|
|
600
|
-
# which does NOT exist — shape 1 (file-no-longer-exists) would fire. But the
|
|
601
|
-
# ticket independent-work signal lives in the unimplemented-file class; the
|
|
602
|
-
# KEEP requirement here is: shape 5 must NOT fire when an existing file
|
|
603
|
-
# reference is unresolvable (i.e. the umbrella has unfinished scope).
|
|
604
|
-
# Per architect advisory A1, we surface this as KEEP-WITH-NOTE rather than
|
|
605
|
-
# silent CLOSE-CANDIDATE.
|
|
606
|
-
[ "$status" -ne 0 ]
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
# ── Phase 1 false-positive fixes ─────────────────────────────────────────────
|
|
610
|
-
#
|
|
611
|
-
# @adr ADR-079 Phase 2 — Phase 1 false-positive class fixes:
|
|
612
|
-
# - P180: state-suffix detection (incident I002.investigating.md vs I002.restored.md)
|
|
613
|
-
# - P244: sibling-file detection (plugin-maturity-list.sh vs plugin-maturity-render.sh)
|
|
614
|
-
# - P251: rename detection via git log --follow
|
|
615
|
-
|
|
616
|
-
@test "evaluate-relevance: Phase 1 fix — state-suffix variant exists at different suffix → KEEP-WITH-NOTE (not CLOSE-CANDIDATE)" {
|
|
617
|
-
mkdir -p docs/incidents
|
|
618
|
-
cat > docs/incidents/I002-renamed.restored.md <<EOF
|
|
619
|
-
# Incident I002
|
|
620
|
-
EOF
|
|
621
|
-
git add docs/incidents/I002-renamed.restored.md
|
|
622
|
-
|
|
623
|
-
cat > docs/problems/open/160-state-suffix.md <<EOF
|
|
624
|
-
# Problem 160: state-suffix
|
|
625
|
-
|
|
626
|
-
**Status**: Open
|
|
627
|
-
**Reported**: $OLD_DATE
|
|
628
|
-
|
|
629
|
-
## Description
|
|
630
|
-
|
|
631
|
-
Investigation references docs/incidents/I002-renamed.investigating.md
|
|
632
|
-
which has since transitioned state.
|
|
633
|
-
EOF
|
|
634
|
-
run "$SCRIPT" docs/problems/open/160-state-suffix.md
|
|
635
|
-
# Phase 1 would falsely declare the file gone. Phase 2 detects the
|
|
636
|
-
# restored.md state-suffix variant and routes to KEEP-WITH-NOTE.
|
|
637
|
-
[ "$status" -eq 1 ]
|
|
638
|
-
[[ "$output" == "KEEP-WITH-NOTE "* ]] || [[ "$output" == "KEEP "* ]]
|
|
639
|
-
[[ "$output" == *"state-suffix"* ]] || [[ "$output" == *"renamed.restored.md"* ]]
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
@test "evaluate-relevance: Phase 1 fix — sibling file with similar slug-prefix → KEEP-WITH-NOTE" {
|
|
643
|
-
mkdir -p packages/architect/scripts
|
|
644
|
-
cat > packages/architect/scripts/plugin-maturity-render.sh <<EOF
|
|
645
|
-
#!/bin/bash
|
|
646
|
-
EOF
|
|
647
|
-
cat > packages/architect/scripts/plugin-maturity-populate.sh <<EOF
|
|
648
|
-
#!/bin/bash
|
|
649
|
-
EOF
|
|
650
|
-
git add packages/architect/scripts/plugin-maturity-render.sh packages/architect/scripts/plugin-maturity-populate.sh
|
|
651
|
-
|
|
652
|
-
cat > docs/problems/open/161-sibling-file.md <<EOF
|
|
653
|
-
# Problem 161: sibling-file
|
|
654
|
-
|
|
655
|
-
**Status**: Open
|
|
656
|
-
**Reported**: $OLD_DATE
|
|
657
|
-
|
|
658
|
-
## Description
|
|
659
|
-
|
|
660
|
-
Bug in packages/architect/scripts/plugin-maturity-list.sh
|
|
661
|
-
EOF
|
|
662
|
-
run "$SCRIPT" docs/problems/open/161-sibling-file.md
|
|
663
|
-
# Phase 1 would declare plugin-maturity-list.sh gone. Phase 2 detects
|
|
664
|
-
# the sibling-file class (plugin-maturity-* slug-prefix) and routes to
|
|
665
|
-
# KEEP-WITH-NOTE.
|
|
666
|
-
[ "$status" -eq 1 ]
|
|
667
|
-
[[ "$output" == "KEEP-WITH-NOTE "* ]] || [[ "$output" == "KEEP "* ]]
|
|
668
|
-
[[ "$output" == *"sibling"* ]] || [[ "$output" == *"plugin-maturity-"* ]]
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
# ── CLOSE-CANDIDATE-WITH-CAVEAT structured emission (architect condition C2) ──
|
|
672
|
-
|
|
673
|
-
@test "evaluate-relevance: CLOSE-CANDIDATE-WITH-CAVEAT emits structured caveat format" {
|
|
674
|
-
cat > docs/decisions/040-multi-phase-confirmed.proposed.md <<EOF
|
|
675
|
-
---
|
|
676
|
-
status: "proposed"
|
|
677
|
-
human-oversight: confirmed
|
|
678
|
-
oversight-date: 2026-05-25
|
|
679
|
-
---
|
|
680
|
-
# ADR-040
|
|
681
|
-
EOF
|
|
682
|
-
git add docs/decisions/040-multi-phase-confirmed.proposed.md
|
|
683
|
-
|
|
684
|
-
cat > docs/problems/open/170-umbrella-caveat.md <<EOF
|
|
685
|
-
# Problem 170: umbrella-caveat
|
|
686
|
-
|
|
687
|
-
**Status**: Open
|
|
688
|
-
**Reported**: $OLD_DATE
|
|
689
|
-
|
|
690
|
-
## Description
|
|
691
|
-
|
|
692
|
-
Multi-phase umbrella. ADR-040 covers the design; Phase 2 done, Phase 3
|
|
693
|
-
outstanding work \`packages/jtbd/lib/phase3-helper.sh\`.
|
|
694
|
-
|
|
695
|
-
## Phase 3 progress
|
|
696
|
-
|
|
697
|
-
- [ ] Phase 3 work
|
|
698
|
-
EOF
|
|
699
|
-
# Phase 3 cited path does not exist; ADR-040 confirmed → shape 2 fires + caveat
|
|
700
|
-
run "$SCRIPT" docs/problems/open/170-umbrella-caveat.md
|
|
701
|
-
# Architect condition C2 — structured caveat emission:
|
|
702
|
-
# CLOSE-CANDIDATE-WITH-CAVEAT <basename> — shapes: <list> — caveat: <tag>: <one-line>
|
|
703
|
-
# For multi-phase umbrellas with unticked checkboxes the caveat tag is
|
|
704
|
-
# 'multi-phase-mixed-progress'.
|
|
705
|
-
[[ "$output" == "CLOSE-CANDIDATE-WITH-CAVEAT "* ]]
|
|
706
|
-
[[ "$output" == *"shapes:"* ]]
|
|
707
|
-
[[ "$output" == *"caveat:"* ]]
|
|
708
|
-
[[ "$output" == *"multi-phase-mixed-progress"* ]]
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
# ── KEEP fixtures from the 2026-05-31 labeled negative set ────────────────────
|
|
712
|
-
#
|
|
713
|
-
# @adr ADR-079 Phase 2 — KEEP regression suite: P136 multi-phase umbrella,
|
|
714
|
-
# P303/P326 recent-observation-no-shipped-evidence.
|
|
715
|
-
|
|
716
|
-
@test "evaluate-relevance: KEEP fixture — recent observation, no shipped evidence (P303/P326 class)" {
|
|
717
|
-
cat > docs/problems/open/180-recent-observation.md <<EOF
|
|
718
|
-
# Problem 180: recent-observation
|
|
719
|
-
|
|
720
|
-
**Status**: Open
|
|
721
|
-
**Reported**: $OLD_DATE
|
|
722
|
-
|
|
723
|
-
## Description
|
|
724
|
-
|
|
725
|
-
Observed friction with the risk-scorer pipeline staging. Composes-with
|
|
726
|
-
P057 / P125 / P273 (sibling staging traps) but no shipped fix yet.
|
|
727
|
-
|
|
728
|
-
## Related
|
|
729
|
-
|
|
730
|
-
- **P057** — sibling.
|
|
731
|
-
EOF
|
|
732
|
-
# P057 not closed (no file); no ADR refs that are confirmed; no SKILL refs;
|
|
733
|
-
# no self-markers. Should KEEP.
|
|
734
|
-
run "$SCRIPT" docs/problems/open/180-recent-observation.md
|
|
735
|
-
[ "$status" -ne 0 ]
|
|
736
|
-
# Either SKIP (no extractable paths) or KEEP — never CLOSE-CANDIDATE.
|
|
737
|
-
[[ "${lines[0]}" != "CLOSE-CANDIDATE "* ]]
|
|
738
|
-
[[ "${lines[0]}" != "CLOSE-CANDIDATE-WITH-CAVEAT "* ]]
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
# ── Cumulative shape annotation (architect Q4 — cumulative is correct) ───────
|
|
742
|
-
|
|
743
|
-
@test "evaluate-relevance: multi-shape match emits cumulative shapes: list" {
|
|
744
|
-
cat > docs/decisions/041-multi-match.proposed.md <<EOF
|
|
745
|
-
---
|
|
746
|
-
status: "proposed"
|
|
747
|
-
human-oversight: confirmed
|
|
748
|
-
oversight-date: 2026-05-25
|
|
749
|
-
---
|
|
750
|
-
# ADR-041
|
|
751
|
-
EOF
|
|
752
|
-
git add docs/decisions/041-multi-match.proposed.md
|
|
753
|
-
|
|
754
|
-
cat > docs/problems/open/190-multi-shape.md <<EOF
|
|
755
|
-
# Problem 190: multi-shape
|
|
756
|
-
|
|
757
|
-
**Status**: Open
|
|
758
|
-
**Reported**: $OLD_DATE
|
|
759
|
-
|
|
760
|
-
## Description
|
|
761
|
-
|
|
762
|
-
ADR-041 captures the design. Fix shipped.
|
|
763
|
-
|
|
764
|
-
## Fix Released
|
|
765
|
-
|
|
766
|
-
Implemented and confirmed.
|
|
767
|
-
EOF
|
|
768
|
-
run "$SCRIPT" docs/problems/open/190-multi-shape.md
|
|
769
|
-
[ "$status" -eq 0 ]
|
|
770
|
-
# Both shape 2 (ADR-confirmed) and shape 4 (Fix Released line) match.
|
|
771
|
-
[[ "$output" == *"ADR-shipped-confirmed"* ]]
|
|
772
|
-
[[ "$output" == *"self-marker-in-body"* ]]
|
|
773
|
-
}
|