@windyroad/itil 0.56.0-preview.876 → 0.56.0-preview.877

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windyroad/itil",
3
- "version": "0.56.0-preview.876",
3
+ "version": "0.56.0-preview.877",
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"
@@ -124,13 +124,15 @@ EOF
124
124
  }
125
125
 
126
126
  # ---------------------------------------------------------------------------
127
- # Surface 2b: helper applies lazy-empty discipline (empty stories: [])
127
+ # Surface 2b: renderer tolerates empty stories: [] on a DRAFT RFC
128
128
  # ---------------------------------------------------------------------------
129
129
 
130
- @test "rfc-stories-extension: helper does not reject empty stories: [] (atomic-RFC JTBD-101 friction guard)" {
131
- # Atomic RFC ships with stories: []; the helper must not reject this
132
- # shape (it represents a legitimate atomic-fix-adopter RFC per
133
- # ADR-060 line 262 JTBD-101 friction guard).
130
+ @test "rfc-stories-extension: renderer tolerates empty stories: [] on a draft RFC (ADR-089: enforced >=1 at accept, not at render)" {
131
+ # Per ADR-089 every RFC has >=1 story, but empty stories: [] is a legal
132
+ # TRANSIENT state on a draft/proposed RFC before the fix is scoped. The
133
+ # renderer must not reject it (that would block drafting); the >=1-story
134
+ # requirement is enforced at the manage-rfc accept gate by the
135
+ # check-rfc-has-stories predicate, not by this renderer.
134
136
  cat > docs/rfcs/RFC-002-atomic.proposed.md <<'EOF'
135
137
  ---
136
138
  status: proposed
@@ -56,12 +56,19 @@ setup() {
56
56
  }
57
57
 
58
58
  # ---------------------------------------------------------------------------
59
- # Surface 2: manage-problem names BOTH fallback paths
59
+ # Surface 2: manage-problem empty stories: [] is a legacy/back-fill state,
60
+ # NOT a legitimate atomic fallback (ADR-089: every RFC has >=1 story). The old
61
+ # JTBD-101-friction-guard atomic-RFC-empty-stories fallback is removed; the
62
+ # legacy no-RFC direct-implementation fallback (a distinct path) stays.
60
63
  # ---------------------------------------------------------------------------
61
64
 
62
- @test "traversal: manage-problem names the atomic-RFC empty stories: [] fallback (JTBD-101 friction guard)" {
63
- run grep -E 'atomic-RFC fallback|atomic RFC.*JTBD-101.*friction guard|stories: \[\].*atomic' "$MANAGE_PROBLEM"
65
+ @test "traversal: manage-problem treats empty stories: [] as legacy/back-fill, not a legitimate atomic fallback (ADR-089)" {
66
+ # Positive: the ADR-089 model (>=1 story; back-fill the legacy empty-stories RFC) is named.
67
+ run grep -iE 'ADR-089|back-fill' "$MANAGE_PROBLEM"
64
68
  [ "$status" -eq 0 ]
69
+ # Negative: the old atomic-RFC empty-stories fallback legitimation is gone.
70
+ run grep -iE 'atomic-RFC fallback|atomic RFC.*JTBD-101.*friction guard' "$MANAGE_PROBLEM"
71
+ [ "$status" -ne 0 ]
65
72
  }
66
73
 
67
74
  @test "traversal: manage-problem names the legacy no-RFC direct-implementation fallback" {
@@ -89,7 +96,7 @@ setup() {
89
96
  [ "$status" -eq 0 ]
90
97
  }
91
98
 
92
- @test "traversal: manage-problem names Refs: RFC-NNN trailer for atomic-RFC fallback" {
99
+ @test "traversal: manage-problem names Refs: RFC-NNN trailer for cross-cutting RFC work (no single story)" {
93
100
  run grep -E 'Refs: RFC-' "$MANAGE_PROBLEM"
94
101
  [ "$status" -eq 0 ]
95
102
  }
@@ -200,15 +200,15 @@ The Phase 2 working-the-problem traversal makes "implement the fix" concretely t
200
200
  1. **Read the problem's `## Fix Strategy` section** — extract referenced RFC IDs (anchor links / inline references like `RFC-NNN`). The I13 gate above has already guaranteed an RFC traces the problem; if the `## Fix Strategy` prose itself references none (a freshly auto-created RFC may not yet be cited inline), fall through to the legacy direct-implementation path (step 6 below) using the traced/auto-created RFC.
201
201
  2. **For each referenced RFC** (in the order they appear in the Fix Strategy section), read its frontmatter `stories:` array (per ADR-060 line 259, the array is ORDERED — array position IS execution sequence):
202
202
  - **Non-empty `stories:` array** (story-decomposed RFC): pick the first story whose lifecycle status is `accepted` or `in-progress` — skip `done` stories that already shipped, skip `draft` stories that aren't ready (the `manage-story <NNN> accepted` gate enforces INVEST shape; a draft story is structurally unready). Continue to step 3.
203
- - **Empty `stories: []`** (atomic RFC per JTBD-101 friction guard, ADR-060 line 262): fall back to Phase 1 per-RFC iter dispatch read the RFC body's `## Tasks` section directly; pick the first unticked task; no per-story scoping needed. Skip to step 5 (commit + trailer).
203
+ - **Empty `stories: []`** (a **legacy** pre-ADR-089 RFC, or one not yet decomposed): per **ADR-089** every RFC has ≥1 story — an empty `stories:` is a **back-fill** state, NOT a legitimate atomic shape. Back-fill the fix's story onto the RFC's story map (add ≥1 story, transition it `accepted` via `manage-story`), then re-traverse from step 2. The empty-stories atomic fallback is removed — do NOT close the problem on a story-less RFC.
204
204
  3. **Read the picked story's body** — `## User value` statement (INVEST Valuable), `## Acceptance criteria` (INVEST Testable observable behaviours), `## Implementation notes` (architecture sketches, library decisions). The story's frontmatter `estimated-effort` field (set at `manage-story accepted` transition per I10 INVEST Estimable) sets the appetite for the iteration.
205
205
  4. **Implement the story scope** — follow the project's standard development workflow (plan if needed, architect/JTBD review, behavioural tests per ADR-052, single-commit grain per ADR-014). Confine the implementation to the picked story's acceptance criteria; deviating into adjacent unscoped work is a scope-expansion signal — surface it via the `## Scope expansion` AskUserQuestion below.
206
206
  5. **Commit with the `Refs: STORY-<NNN>` trailer** (single-trailer vocabulary per ADR-060 line 307 + amendment 2026-05-10 nitpick N2 — same trailer verb whether the commit is the story's first implementation commit or a continuation). On the FIRST commit AFTER the capture commit (subject prefix discriminates: `feat(itil): capture STORY-NNN ...` is the capture; any other subject prefix is an implementation commit), `/wr-itil:manage-story` auto-transitions the story `draft → in-progress`. As acceptance criteria checkboxes are ticked across multiple commits, the same trailer continues to attribute the work.
207
207
  6. **Story `done` auto-transition**: when ALL acceptance-criteria checkboxes in the story body are ticked AND the linked RFC reaches `closed`, `/wr-itil:manage-story` auto-transitions the story `in-progress → done`. (When a story's RFC is still `in-progress` but the acceptance criteria are all ticked, the story stays at `in-progress` until the RFC closes — this preserves the trace coupling per ADR-060 line 309.)
208
- 7. **Pick the next not-done story** from the RFC's `stories:` array (or the next unticked task from the RFC body for the atomic-RFC fallback path). Repeat from step 3.
208
+ 7. **Pick the next not-done story** from the RFC's `stories:` array. Repeat from step 3.
209
209
  8. **When all stories under all referenced RFCs are done** — the problem is fix-released. Include the problem doc closure in the final commit (`git mv` to `.verifying.md`, update Status) per ADR-022. Push, create changeset, release per the lean release principle.
210
210
 
211
- **Atomic-RFC fallback path** (step 2 empty-stories case, in detail): a Phase 1-shape problem whose Fix Strategy references RFCs that have not been decomposed into stories continues to work via the existing per-RFC iter dispatch read the RFC body's tasks/steps section, implement each task as a single-commit per ADR-014, attribute via `Refs: RFC-<NNN>` trailer (still single-trailer vocabulary). This preserves Phase 1 atomic-fix-adopter behaviour: an adopter who hasn't adopted Phase 2 story tooling has zero new friction; their RFCs continue to ship with `stories: []` and their problems continue to close via per-RFC iter dispatch.
211
+ **Legacy empty-stories back-fill (per ADR-089)**: a pre-ADR-089 RFC whose `stories:` is empty is a **back-fill** case, not an atomic fallback ADR-089 requires ≥1 story, so the empty-stories atomic dispatch is removed. Decompose the fix into ≥1 story on the RFC's story map (add the story, transition it `accepted`), then traverse it via the normal story path above. The `Refs: RFC-<NNN>` trailer remains valid for **cross-cutting RFC work with no single story** (e.g. an RFC-level enforcement change spanning several files); it is no longer an atomic-empty-stories fallback. Legacy on-disk RFCs still carrying `stories: []` are surfaced for back-fill by `wr-itil-check-rfc-has-stories` at their next `manage-rfc accepted` transition.
212
212
 
213
213
  **Legacy direct-implementation path** (step 1 no-RFCs case): a Phase 1-shape Known Error whose Fix Strategy references no RFCs continues to work via the pre-Phase-2 flow — read the root cause analysis and fix strategy, implement the fix following the project's development workflow, include the problem doc closure in the fix commit (`git mv` to `.verifying.md`, update Status), push + changeset + release. This preserves backwards compatibility with all existing Known Error problems (which were captured before the RFC framework was Phase-1-graduated).
214
214
 
@@ -81,7 +81,7 @@ When a single ticket is the strict top, rungs 2-5 are not consulted. When multip
81
81
  Invoke `/wr-itil:manage-problem <NNN>` via the Skill tool with the selected ticket's ID as the argument. The delegated skill runs the full Working a Problem flow appropriate to the ticket's status:
82
82
 
83
83
  - **Open ticket**: investigate root cause; document findings; create reproduction test; identify workaround; auto-transition to Known Error when root cause + workaround are documented; if the fix is small, proceed straight into implementation.
84
- - **Known Error**: traverse problem `## Fix Strategy` → referenced RFCs → each RFC's frontmatter `stories:` array (ordered per ADR-060 line 259) → pick first not-done story (status `accepted` or `in-progress`, skipping `done` and `draft`) → implement the picked story scope. Empty `stories: []` (atomic RFC, JTBD-101 friction guard) falls back to per-RFC iter dispatch on the RFC body's tasks. No-RFC Fix Strategy (Phase 1-shape legacy problems) falls back to direct fix implementation. Each commit carries `Refs: STORY-<NNN>` (or `Refs: RFC-<NNN>` for atomic-RFC fallback / `Refs: P<NNN>` for legacy direct path). Stories auto-transition `draft → in-progress` on first non-capture commit; auto-transition `in-progress → done` on all-criteria-ticked + linked RFC closed. When all stories under all referenced RFCs are done, include the Known Error → Verification Pending `git mv` in the final commit per ADR-022. The full traversal contract lives in `/wr-itil:manage-problem` § Working a Problem → Known Error subsection (post-Phase-2 rewrite per ADR-060 lines 300-320).
84
+ - **Known Error**: traverse problem `## Fix Strategy` → referenced RFCs → each RFC's frontmatter `stories:` array (ordered per ADR-060 line 259) → pick first not-done story (status `accepted` or `in-progress`, skipping `done` and `draft`) → implement the picked story scope. An empty `stories: []` is a legacy/back-fill state (per **ADR-089** every RFC has ≥1 story — the empty-stories atomic fallback is removed): back-fill a story onto the RFC, don't fall back to a per-RFC atomic dispatch. No-RFC Fix Strategy (Phase 1-shape legacy problems) falls back to direct fix implementation. Each commit carries `Refs: STORY-<NNN>` (or `Refs: RFC-<NNN>` for cross-cutting RFC work with no single story / `Refs: P<NNN>` for legacy direct path). Stories auto-transition `draft → in-progress` on first non-capture commit; auto-transition `in-progress → done` on all-criteria-ticked + linked RFC closed. When all stories under all referenced RFCs are done, include the Known Error → Verification Pending `git mv` in the final commit per ADR-022. The full traversal contract lives in `/wr-itil:manage-problem` § Working a Problem → Known Error subsection (post-Phase-2 rewrite per ADR-060 lines 300-320).
85
85
 
86
86
  **Why delegate rather than re-implement:** the full investigation / transition / fix / release pipeline is a long-lived, policy-governed flow that must stay on a single authoritative workflow. Re-hosting it on a sibling skill would fork the ownership contract and compound maintenance cost. The split skill (this file) owns the *selection* of the next ticket; `/wr-itil:manage-problem <NNN>` owns the *execution*.
87
87