@windyroad/itil 0.4.0 → 0.4.1-preview.92

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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "wr-itil",
3
- "version": "0.1.0",
3
+ "version": "0.4.0",
4
4
  "description": "ITIL-aligned IT service management for Claude Code"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windyroad/itil",
3
- "version": "0.4.0",
3
+ "version": "0.4.1-preview.92",
4
4
  "description": "ITIL-aligned IT service management for Claude Code (problem, and future incident/change skills)",
5
5
  "bin": {
6
6
  "windyroad-itil": "./bin/install.mjs"
@@ -96,6 +96,28 @@ Format as a brief status line, not a wall of text. The user will read these when
96
96
  [Iteration 3] Skipped P016 (Multi-concern ticket splitting) — fix released, awaiting user verification. Worked P024 (Risk scorer WIP flag) — implemented fix, closed. 6 problems remain.
97
97
  ```
98
98
 
99
+ ### Step 6.5: Release-cadence check (per ADR-018)
100
+
101
+ After the iteration's commit lands but before starting the next iteration, check whether the unreleased queue would push pipeline risk to or above appetite. If so, drain the queue before continuing. This prevents silent accumulation of unreleased changesets across AFK iterations (P041).
102
+
103
+ **Mechanism — delegate, do not re-implement scoring:**
104
+
105
+ 1. Invoke the risk scorer to score cumulative pipeline state. Two paths are valid (per ADR-015):
106
+ - **Primary**: delegate to subagent type `wr-risk-scorer:pipeline` via the Agent tool.
107
+ - **Fallback**: if that subagent type is not available, invoke skill `/wr-risk-scorer:assess-release` via the Skill tool. The skill wraps the same pipeline subagent.
108
+ 2. Read the returned `RISK_SCORES: commit=X push=Y release=Z` line.
109
+ 3. **Threshold**: if `push` or `release` is at or above appetite (4/25, "Low" band per `RISK-POLICY.md`), drain the queue.
110
+
111
+ **Drain action (non-interactive, policy-authorised per ADR-013 Rule 6):**
112
+
113
+ 1. Run `npm run push:watch` (push + wait for CI to pass).
114
+ 2. If `.changeset/` is non-empty after push, run `npm run release:watch` (merge the release PR + wait for npm publish).
115
+ 3. Resume the loop only after the release lands on npm.
116
+
117
+ **Failure handling**: If `release:watch` fails (CI failure, publish failure), stop the loop and report the failure in the AFK summary. Do not retry non-interactively — the user must intervene.
118
+
119
+ `push:watch` and `release:watch` are policy-authorised actions when residual risk is within appetite per RISK-POLICY.md, so no `AskUserQuestion` is required for the drain itself (ADR-013 Rule 6).
120
+
99
121
  ### Step 7: Loop
100
122
 
101
123
  Go back to step 1. The backlog may have changed — new problems may have been created during fixes, priorities may have shifted, and the README.md cache will be stale.
@@ -111,6 +133,7 @@ When `AskUserQuestion` is unavailable or the user is AFK, the skill (and the del
111
133
  | Scope expansion during work | Update problem file, re-score WSJF, move to next problem instead of continuing |
112
134
  | Commit when risk within appetite | Auto-commit (manage-problem step 9e fallback) |
113
135
  | Commit when risk above appetite | Skip commit, report uncommitted state |
136
+ | Pipeline risk at appetite (push or release >= 4/25) | Drain release queue (`push:watch` then `release:watch`) before next iteration — per ADR-018 (Step 6.5) |
114
137
  | Fix verification needed | Skip problem, add to "needs verification" list |
115
138
 
116
139
  ## Edge Cases
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env bats
2
+ # Doc-lint guard: work-problems SKILL.md must include the inter-iteration
3
+ # release-cadence check per ADR-018.
4
+ #
5
+ # Structural assertion — Permitted Exception to the source-grep ban (ADR-005 / P011).
6
+ # These tests assert that the skill specification document contains the
7
+ # release-cadence step so the AFK orchestrator does not silently accumulate
8
+ # unreleased changesets across iterations.
9
+ #
10
+ # Cross-reference:
11
+ # P041 (work-problems does not enforce release cadence)
12
+ # ADR-018 (inter-iteration release cadence for AFK loops)
13
+ # @jtbd JTBD-006 (Progress the Backlog While I'm Away)
14
+
15
+ setup() {
16
+ SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
17
+ SKILL_FILE="${SKILL_DIR}/SKILL.md"
18
+ }
19
+
20
+ @test "SKILL.md exists" {
21
+ [ -f "$SKILL_FILE" ]
22
+ }
23
+
24
+ @test "SKILL.md cites ADR-018 (release cadence)" {
25
+ # ADR-018 confirmation criterion: skill must reference the ADR.
26
+ run grep -n "ADR-018" "$SKILL_FILE"
27
+ [ "$status" -eq 0 ]
28
+ }
29
+
30
+ @test "SKILL.md delegates to wr-risk-scorer:assess-release (preserves pure-scorer contract from ADR-015)" {
31
+ # ADR-018 mechanism: must delegate to the assess-release skill rather than
32
+ # re-implementing risk scoring inline.
33
+ run grep -n "assess-release" "$SKILL_FILE"
34
+ [ "$status" -eq 0 ]
35
+ }
36
+
37
+ @test "SKILL.md references release:watch as the drain mechanism" {
38
+ # ADR-018 mechanism: drain action runs npm run release:watch (after
39
+ # push:watch) when the queue hits appetite.
40
+ run grep -n "release:watch" "$SKILL_FILE"
41
+ [ "$status" -eq 0 ]
42
+ }
43
+
44
+ @test "SKILL.md references push:watch as part of the drain mechanism" {
45
+ # ADR-018 mechanism: drain action runs push:watch before release:watch.
46
+ run grep -n "push:watch" "$SKILL_FILE"
47
+ [ "$status" -eq 0 ]
48
+ }
49
+
50
+ @test "SKILL.md has a release-cadence step between iterations" {
51
+ # The inter-iteration check should appear as a discrete step or subsection
52
+ # so it is not buried in prose.
53
+ run grep -niE "release.cadence|cadence check|release queue" "$SKILL_FILE"
54
+ [ "$status" -eq 0 ]
55
+ }
56
+
57
+ @test "SKILL.md Non-Interactive Decision Making table covers pipeline risk at appetite" {
58
+ # ADR-018 confirmation criterion: the non-interactive defaults table must
59
+ # include a row for the release-drain decision, otherwise an AFK reader
60
+ # cannot find the rule.
61
+ run grep -niE "Pipeline risk at appetite|release queue.*appetite|drain.*release" "$SKILL_FILE"
62
+ [ "$status" -eq 0 ]
63
+ }