@windyroad/retrospective 0.3.0 → 0.4.0

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-retrospective",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Session retrospective reminders and plan review for Claude Code"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windyroad/retrospective",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Session retrospectives that update briefings and create problem tickets",
5
5
  "bin": {
6
6
  "windyroad-retrospective": "./bin/install.mjs"
@@ -75,6 +75,49 @@ For each item identified in "What was harder than it should have been", "What fa
75
75
  - If yes: update it with new evidence from this session
76
76
  - If no: create a new problem ticket
77
77
 
78
+ ### 4a. Verification-close housekeeping (P068)
79
+
80
+ Problems whose fix shipped but whose closure is still pending (`docs/problems/*.verifying.md` per ADR-022) accumulate across sessions. When this session's activity exercised a pending fix successfully, run-retro surfaces the evidence so the user can close on observed fact rather than by calendar age (P048's `Likely verified` heuristic) or deferred user review (manage-problem Step 9d's baseline user-initiated path). This step extends those paths with **session-context evidence**; the close decision remains the user's.
81
+
82
+ **Ownership boundary**: run-retro surfaces evidence and asks; `/wr-itil:manage-problem` Step 7 Verification Pending → Closed transition (rename + Status edit + P057 re-stage + ADR-014 commit per ADR-022) is invoked via the Skill tool to perform the actual file rename and commit. run-retro does **not** rename, edit the Status field, or commit — those remain `manage-problem`'s responsibility. ADR-014 lists run-retro as out of scope for its own commits; the delegated manage-problem call commits per ADR-014 + ADR-022 and that boundary is preserved.
83
+
84
+ **Steps:**
85
+
86
+ 1. **Glob**: enumerate `docs/problems/*.verifying.md` (the driven-by-filename surface per ADR-022).
87
+
88
+ 2. **Read the `## Fix Released` section** of each file and extract the fix-summary keyword set: release marker (version, commit SHA, or date), affected source path(s), new test file path(s), and any named skill / hook / gate the fix exercises.
89
+
90
+ 3. **Evidence scan** against the session's in-context activity. For each ticket, collect specific citations (tool invocation, timestamp or position in the session, and the observable outcome). Accepted evidence classes:
91
+ - **Test invocations** that ran the fix's test file or a superset and returned zero (e.g. `npx bats packages/itil/skills/manage-problem/test/manage-problem-external-root-cause-detection.bats` — 14/14 passed at session position N).
92
+ - **Commits** whose diff covered the fix's source path (cite the commit SHA and path).
93
+ - **Skill invocations** that rely on the fix (e.g. `manage-problem` using P056's corrected next-ID lookup; cite the invocation and the observable that the fix contract held — "ID 072 computed without origin_max blob-SHA false-match").
94
+ - **Hook firings** on gate paths the fix established (cite the tool call that triggered the hook and the hook's observed behaviour).
95
+ - **Release cycles** (`push:watch` / `release:watch`) that shipped a commit dependent on the fix (cite the workflow run ID and exit status).
96
+
97
+ 4. **Categorise** each `.verifying.md` ticket into one of three buckets:
98
+ - **Exercised successfully in-session** — at least one citation from step 3. Record the ticket as a close-candidate. Citations MUST be specific (tool invocation + observable outcome), not bare counts — per ADR-026 grounding. If no specific citation can be produced, the ticket does NOT go in this bucket regardless of how often the fix's area was touched.
99
+ - **Not exercised in-session** — no citation collected. Leave as Verification Pending; nothing surfaces for this ticket.
100
+ - **Exercised with regression** — the fix's contract observably failed (test red, hook misfired, skill produced incorrect output). This is a distinct problem, not a closure candidate. Flag it in the retro report as a new problem ticket (route via Step 4) with the regression evidence, and leave the `.verifying.md` file alone.
101
+
102
+ 5. **Prompt the user (interactive path per ADR-013 Rule 1)** — for each close-candidate use `AskUserQuestion`:
103
+ - `header: "Close verified ticket?"`
104
+ - `multiSelect: false`
105
+ - Question body MUST include the fix summary AND the specific citations collected in step 3 (not just ticket ID + title). The prompt is self-contained so the user can decide without reading the full ticket file.
106
+ - Options:
107
+ 1. `Close P<NNN>` — description: "Delegate to /wr-itil:manage-problem for Verification Pending → Closed transition. manage-problem renames, updates Status, and commits per ADR-014 + ADR-022."
108
+ 2. `Leave as Verification Pending` — description: "Evidence noted but not yet sufficient to close. Ticket stays in the Verification Queue."
109
+ 3. `Flag for manual review` — description: "The evidence is ambiguous or contested; defer to a dedicated manage-problem review session."
110
+
111
+ 6. **For each `Close P<NNN>` confirmation**, invoke the Skill tool with `wr-itil:manage-problem` and arguments like `<NNN> close — verified in-session via <citation summary>`. manage-problem performs the `git mv` .verifying.md → .closed.md, updates the Status field, re-stages per P057, and commits with message `docs(problems): close P<NNN> <title>` per ADR-014. The commit message should reference the retro session in its body.
112
+
113
+ 7. **Non-interactive / AFK fallback (per ADR-013 Rule 6)**: when `AskUserQuestion` is unavailable (autonomous retro, batch session-wrap), do NOT auto-close and do NOT delegate to manage-problem. Instead, write a "Verification Candidates" section into the retro report (Step 5 summary) listing each close-candidate with its ticket ID, fix summary, and the specific citations collected in step 3. The user reviews on return and can run `/wr-itil:manage-problem <NNN> close` per ticket, or run `/wr-itil:manage-problem review` to fire Step 9d's baseline verification prompt. This deferral is explicit per the user's documented preference (feedback_verify_from_own_observation.md memory): surface evidence from the agent's own in-session observations, but the close decision remains user-confirmed per ADR-022.
114
+
115
+ **ADR-027 compatibility note**: when ADR-027's Step-0 auto-delegation lands on run-retro (run-retro is named in ADR-027's Scope as in-scope but has no Step 0 today), the evidence scan in step 3 becomes load-bearing on main-agent session context that a delegated subagent does not automatically inherit. The SKILL.md contract for that migration: either (a) run Step 4a in the main-agent context BEFORE Step-0 delegation to the subagent, or (b) have the Step-0 delegation prompt include an explicit session-activity summary (tool invocations, commits, skill calls observed in main-agent context) so the subagent has citable evidence. Option (a) is preferred because it keeps the evidence scan as close as possible to the observed activity; option (b) is the fallback if the subagent boundary must be crossed first.
116
+
117
+ **Interaction with other surfaces**:
118
+ - **manage-problem Step 9d** (baseline user-initiated verification review per P048) still fires on `/wr-itil:manage-problem review` — it is the age-based heuristic path. Step 4a here is the evidence-based session-wrap path. The two compose: a ticket that is both "≥ 14 days old" (Step 9d highlight) AND "exercised successfully this session" (Step 4a candidate) should be surfaced in both paths independently; closing via either path moves the ticket to `.closed.md` and de-lists it from both queues.
119
+ - **Skipped in this step**: `.verifying.md` tickets for fixes that ship in the currently-running session (e.g. P066, P063 just transitioned to `.verifying.md` this session) — a session cannot verify its own fix beyond "bats passed at commit time"; subsequent-session exercise is the meaningful signal. Treat same-session verifyings as "not exercised in-session" for closure purposes unless a later-session exercise path is in the citation list.
120
+
78
121
  ### 4b. Recommend new codifications
79
122
 
80
123
  For each **codification candidate** identified in Step 2, route the decision through a single `AskUserQuestion` call. This is the ADR-013 Rule 1 structured-interaction pattern — do not present the choices as prose enumeration in the skill output. The shape and Kind identified in Step 2 determine which option rows the user picks from; every shape and Kind routes through the same `AskUserQuestion` so the decision stays one structured interaction (architect decision: flat shape-prefixed options, not a two-step type-then-action or Kind-then-shape flow).
@@ -154,6 +197,14 @@ Present a summary to the user:
154
197
  ### Problems Created/Updated
155
198
  - [problem ticket]: [summary]
156
199
 
200
+ ### Verification Candidates
201
+
202
+ (Emitted only when Step 4a found `.verifying.md` tickets with specific in-session citations. Omit this section entirely when no candidates were found — or when the interactive path closed them all during Step 4a. Populated in non-interactive / AFK mode per ADR-013 Rule 6 — the user closes on return.)
203
+
204
+ | Ticket | Fix summary | In-session citations | Decision |
205
+ |--------|-------------|----------------------|----------|
206
+ | P<NNN> | <one-sentence fix summary> | <specific invocations + observable outcomes> | closed via manage-problem / left Verification Pending / flagged for manual review / flagged (non-interactive) |
207
+
157
208
  ### Codification Candidates
158
209
 
159
210
  | Kind | Shape | Suggested name / Target file | Scope / Flaw | Triggers / Evidence | Decision |
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env bats
2
+
3
+ # P068: run-retro SKILL.md documents the Verification-close housekeeping
4
+ # step (Step 4a) that surfaces in-session evidence for `.verifying.md`
5
+ # tickets and delegates the close transition to /wr-itil:manage-problem.
6
+ #
7
+ # Doc-lint structural test (Permitted Exception per ADR-005). Asserts
8
+ # SKILL.md wording for: the glob, the evidence-scan grounding (ADR-026),
9
+ # the three categorisation buckets, the AskUserQuestion prompt contract
10
+ # (ADR-013 Rule 1), the AFK fallback (ADR-013 Rule 6), the delegation
11
+ # boundary to manage-problem Step 7 (ADR-022 + ADR-014 ownership), and
12
+ # the ADR-027 auto-delegation compatibility note.
13
+
14
+ setup() {
15
+ REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
16
+ SKILL_MD="$REPO_ROOT/packages/retrospective/skills/run-retro/SKILL.md"
17
+ }
18
+
19
+ @test "run-retro: SKILL.md contains Step 4a Verification-close housekeeping (P068)" {
20
+ run grep -F '### 4a. Verification-close housekeeping (P068)' "$SKILL_MD"
21
+ [ "$status" -eq 0 ]
22
+ }
23
+
24
+ @test "run-retro: Step 4a globs docs/problems/*.verifying.md per ADR-022" {
25
+ run grep -F 'docs/problems/*.verifying.md' "$SKILL_MD"
26
+ [ "$status" -eq 0 ]
27
+ }
28
+
29
+ @test "run-retro: Step 4a delegates the close transition to /wr-itil:manage-problem Step 7" {
30
+ run grep -F '/wr-itil:manage-problem' "$SKILL_MD"
31
+ [ "$status" -eq 0 ]
32
+ run grep -F 'run-retro does **not** rename, edit the Status field, or commit' "$SKILL_MD"
33
+ [ "$status" -eq 0 ]
34
+ }
35
+
36
+ @test "run-retro: Step 4a documents all three evidence-category buckets" {
37
+ run grep -F 'Exercised successfully in-session' "$SKILL_MD"
38
+ [ "$status" -eq 0 ]
39
+ run grep -F 'Not exercised in-session' "$SKILL_MD"
40
+ [ "$status" -eq 0 ]
41
+ run grep -F 'Exercised with regression' "$SKILL_MD"
42
+ [ "$status" -eq 0 ]
43
+ }
44
+
45
+ @test "run-retro: Step 4a requires specific-citation grounding (ADR-026)" {
46
+ run grep -F 'ADR-026 grounding' "$SKILL_MD"
47
+ [ "$status" -eq 0 ]
48
+ run grep -F 'not bare counts' "$SKILL_MD"
49
+ [ "$status" -eq 0 ]
50
+ }
51
+
52
+ @test "run-retro: Step 4a AskUserQuestion prompt contract requires fix summary AND citations inline (ADR-013 Rule 1)" {
53
+ run grep -F 'ADR-013 Rule 1' "$SKILL_MD"
54
+ [ "$status" -eq 0 ]
55
+ run grep -F 'Question body MUST include the fix summary AND the specific citations' "$SKILL_MD"
56
+ [ "$status" -eq 0 ]
57
+ }
58
+
59
+ @test "run-retro: Step 4a three AskUserQuestion options (Close / Leave Verification Pending / Flag for manual review)" {
60
+ run grep -F 'Close P<NNN>' "$SKILL_MD"
61
+ [ "$status" -eq 0 ]
62
+ run grep -F 'Leave as Verification Pending' "$SKILL_MD"
63
+ [ "$status" -eq 0 ]
64
+ run grep -F 'Flag for manual review' "$SKILL_MD"
65
+ [ "$status" -eq 0 ]
66
+ }
67
+
68
+ @test "run-retro: Step 4a AFK fallback surfaces evidence in the retro report and does NOT auto-close (ADR-013 Rule 6)" {
69
+ run grep -F 'Non-interactive / AFK fallback (per ADR-013 Rule 6)' "$SKILL_MD"
70
+ [ "$status" -eq 0 ]
71
+ run grep -F 'do NOT auto-close' "$SKILL_MD"
72
+ [ "$status" -eq 0 ]
73
+ }
74
+
75
+ @test "run-retro: Step 4a ADR-027 compatibility note documents session-context handling" {
76
+ run grep -F 'ADR-027 compatibility note' "$SKILL_MD"
77
+ [ "$status" -eq 0 ]
78
+ run grep -F 'subagent' "$SKILL_MD"
79
+ [ "$status" -eq 0 ]
80
+ }
81
+
82
+ @test "run-retro: Step 4a cites feedback_verify_from_own_observation memory for the deferred-close rationale" {
83
+ run grep -F 'feedback_verify_from_own_observation.md' "$SKILL_MD"
84
+ [ "$status" -eq 0 ]
85
+ }
86
+
87
+ @test "run-retro: Step 4a documents interaction with manage-problem Step 9d and same-session verifyings are skipped" {
88
+ run grep -F 'manage-problem Step 9d' "$SKILL_MD"
89
+ [ "$status" -eq 0 ]
90
+ run grep -F 'same-session verifyings' "$SKILL_MD"
91
+ [ "$status" -eq 0 ]
92
+ }
93
+
94
+ @test "run-retro: Step 5 summary adds a Verification Candidates section" {
95
+ run grep -F '### Verification Candidates' "$SKILL_MD"
96
+ [ "$status" -eq 0 ]
97
+ }
98
+
99
+ @test "run-retro: Verification Candidates table columns match the Step 4a output semantics" {
100
+ run grep -F '| Ticket | Fix summary | In-session citations | Decision |' "$SKILL_MD"
101
+ [ "$status" -eq 0 ]
102
+ }
103
+
104
+ @test "run-retro: Step 4a does not miscite ADR-018 as the retrospective contract (P068 architect review)" {
105
+ # The SKILL.md change must not claim ADR-018 governs the run-retro contract.
106
+ # ADR-018 is about AFK inter-iteration release cadence, not retrospective.
107
+ run grep -iE 'ADR-018.*retrospective (contract|ADR)|retrospective (contract|ADR).*ADR-018' "$SKILL_MD"
108
+ [ "$status" -ne 0 ]
109
+ }