@windyroad/retrospective 0.8.0-preview.208 → 0.9.0-preview.210

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.8.0",
3
+ "version": "0.9.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.8.0-preview.208",
3
+ "version": "0.9.0-preview.210",
4
4
  "description": "Session retrospectives that update briefings and create problem tickets",
5
5
  "bin": {
6
6
  "windyroad-retrospective": "./bin/install.mjs"
@@ -8,6 +8,21 @@ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, Skill
8
8
 
9
9
  Reflect on the current session, update the project briefing, and create problem tickets for failures and friction.
10
10
 
11
+ ## When to use
12
+
13
+ ### Supported invocation surfaces
14
+
15
+ - **Foreground `/wr-retrospective:run-retro`** — the canonical invocation. The user types the slash command in their parent session; the retro runs with full visibility of the session's tool-call history. This is the only invocation surface every other use case falls back to.
16
+ - **`claude -p` subprocess invocation** — supported per **P086** (the AFK `/wr-itil:work-problems` iteration subprocess invokes run-retro before emitting `ITERATION_SUMMARY`). The subprocess has the iteration's tool-call history naturally; retro runs with iteration-bounded scope and produces correct findings for that scope. ADR-032 subprocess-boundary variant covers this surface.
17
+
18
+ ### Anti-pattern: Never invoke as a background agent
19
+
20
+ Do **NOT** invoke run-retro via `Agent(run_in_background: true)` or any background-subagent surface (the deferred ADR-032 `capture-retro` sibling). Background subagents have isolated context at spawn — they cannot see the parent session's tool-call history, which is run-retro's primary input. A background retro would either produce empty findings, require explicit context-marshalling at spawn (the "shenanigans" the user direction rejected), or post-hoc parse session logs (out of scope today).
21
+
22
+ The `/wr-retrospective:capture-retro` background sibling listed in early ADR-032 drafts is **deferred pending resolution of the context-marshalling problem** (P088, 2026-04-21 user direction: *"run-retro cannot be done as a subagent, because it won't have the context"*). The other ADR-032 background siblings (`capture-problem`, `capture-adr`) are unaffected — their inputs are self-contained aside payloads, not whole-session histories. See **ADR-032** in-scope-list amendment and **P088** ticket for the full settlement.
23
+
24
+ This anti-pattern clause does NOT forbid retro inside an AFK iteration subprocess (P086) — that surface is the `claude -p` row above, not the background-agent row. Those two surfaces are distinct: `claude -p` is a fresh main Claude Code session that loads its own context naturally; `Agent(run_in_background: true)` is a subagent spawned inside an existing session whose context is isolated from the parent.
25
+
11
26
  ## Steps
12
27
 
13
28
  ### 1. Read the current briefing
@@ -171,6 +186,39 @@ After editing topic files, update `docs/briefing/README.md`:
171
186
 
172
187
  Use the AskUserQuestion tool to confirm any removals: "I would like to remove [item] from `docs/briefing/<topic>.md` because [reason]. Is this correct?"
173
188
 
189
+ #### Tier 3 budget rotation pass (P099)
190
+
191
+ After all topic-file edits, Step 1.5 delete-queue persistence, and the README refresh have completed, run the per-topic-file budget pass. ADR-040 Tier 3 names a 2-5 KB / topic envelope; this pass promotes that budget from informational to advisory enforcement.
192
+
193
+ **Mechanism**: invoke `packages/retrospective/scripts/check-briefing-budgets.sh` (read-only diagnostic) against `docs/briefing/`. Each line of output identifies a topic file at or above the configured threshold:
194
+
195
+ ```
196
+ OVER <basename> bytes=<N> threshold=<N>
197
+ ```
198
+
199
+ The script's threshold defaults to `5120` bytes (the upper bound of ADR-040's Tier 3 envelope) and is overridable via `BRIEFING_TIER3_MAX_BYTES`. Empty stdout means no files are over budget — skip the rest of this pass.
200
+
201
+ **Ordering**: this pass runs as the FINAL action of Step 3, after edits + Step 1.5 delete-queue persistence + README refresh. It must observe post-edit byte counts so the deletes the user confirmed in Step 1.5 are reflected in the measurement.
202
+
203
+ **Interactive path (ADR-013 Rule 1)** — for each `OVER` line, invoke `AskUserQuestion`:
204
+
205
+ - `header: "Rotate over-budget topic file?"`
206
+ - `multiSelect: false`
207
+ - The question body MUST cite the specific byte count and threshold from the script's output (per ADR-026 grounding) plus a one-line summary of what the file currently covers, so the user can pick a rotation shape without reading the full file.
208
+ - Options (exactly four per ADR-013 Rule 1 cap):
209
+ 1. `Split by sub-topic` — description: "Identify a coherent sub-topic in this file and migrate its entries to a new `docs/briefing/<sub-topic>.md` archive. Update README Topic Index. The agent surfaces a proposed sub-topic boundary; the user confirms in a follow-up question if needed."
210
+ 2. `Split by date — archive oldest` — description: "Move entries older than a chosen cutoff date to a sibling archive (e.g. `docs/briefing/<topic>-archive.md`). The agent surfaces a proposed cutoff drawn from the entry HTML comment block (`first-written` field per Step 1.5)."
211
+ 3. `Trim noise out of band` — description: "Score-and-delete in a follow-up retro is the right shape — defer rotation, leave the file as-is, and let Step 1.5's signal-vs-noise pass shrink it across cycles. Use this when no clean split boundary exists."
212
+ 4. `Defer — record only` — description: "Surface the over-budget state in this retro's summary; take no action this session. Picks up next retro."
213
+
214
+ The four options correspond to the four common rotation shapes for accumulator docs. The user's choice is recorded in the retro summary (Step 5) under the new Topic File Rotation section.
215
+
216
+ **Non-interactive / AFK fallback (ADR-013 Rule 6)** — when `AskUserQuestion` is unavailable (autonomous retro, AFK orchestrator), do NOT auto-rotate. Each `OVER` line is recorded in the retro summary's "Topic File Rotation Candidates" section with the specific byte count, threshold, and one-line file summary. The user reviews on return and re-runs `/wr-retrospective:run-retro` interactively (or applies a manual split / archive) per accepted candidate. Same trust-boundary shape as Step 1.5's delete queue — surface the evidence; defer the decision.
217
+
218
+ **Why advisory, not fail-closed**: the rotation is a judgment call (which sub-topic to extract, which archive shape to use). A CI-fail-on-overflow would block routine retros mid-session, directly violating JTBD-001 ("enforce governance without slowing down"). The advisory shape mirrors ADR-038's chosen response to the analogous honour-system byte-budget problem: bats catch script-contract drift; the script itself surfaces signal at runtime without halting.
219
+
220
+ **Reusable pattern note** (JTBD-101): this triplet — read-only advisory script + behavioural bats fixture + ADR-tier-budget amendment — is the documented shape for any accumulator-doc surface that needs progressive-disclosure enforcement. Future surfaces (risk register per P102, ADR index, problems index) can mirror it without re-deriving.
221
+
174
222
  ### 4. Create or update problem tickets
175
223
 
176
224
  For each item identified in "What was harder than it should have been", "What failed", and "What should we make easier or automate", use the `/problem` skill to:
@@ -342,6 +390,14 @@ Present a summary to the user:
342
390
  |--------|----------|-----------|----------|
343
391
  | <one-line signal summary> | Hook-protocol friction / Skill-contract violations / Release-path instability / Subagent-delegation friction / Repeat-work friction / Session-wrap silent drops | <specific invocations + session-position markers + observable outcomes> | new ticket via manage-problem / appended to P<NNN> / recorded in retro only / skipped (false positive) / flagged (non-interactive) |
344
392
 
393
+ ### Topic File Rotation Candidates
394
+
395
+ (Emitted only when Step 3's Tier 3 budget pass surfaced topic files at or above the configured threshold via `check-briefing-budgets.sh`. Omit this section entirely when no candidates were found — or when the interactive path resolved them all during Step 3. Populated in non-interactive / AFK mode per ADR-013 Rule 6 — the user reviews on return and applies the chosen rotation shape per candidate. P099.)
396
+
397
+ | Topic file | Bytes | Threshold | Proposed rotation | Decision |
398
+ |------------|-------|-----------|-------------------|----------|
399
+ | `docs/briefing/<topic>.md` | <N> | <N> | split-by-subtopic / split-by-date / trim-noise / defer | applied / deferred / flagged (non-interactive) |
400
+
345
401
  ### Codification Candidates
346
402
 
347
403
  | Kind | Shape | Suggested name / Target file | Scope / Flaw | Triggers / Evidence | Decision |
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/env bats
2
+
3
+ # P088: run-retro SKILL.md MUST carry a "Never invoke as a background
4
+ # agent" anti-pattern clause that warns the agent off the
5
+ # Agent(run_in_background: true) surface before it commits to that
6
+ # invocation shape. The clause is the user-direction-settled outcome
7
+ # of P088 ((b)): foreground /wr-retrospective:run-retro is the only
8
+ # supported invocation; `claude -p` subprocess invocation (per P086)
9
+ # remains supported because the subprocess has the iteration's context
10
+ # naturally; background-agent invocation is deferred pending the
11
+ # context-marshalling problem (ADR-032 capture-retro sibling, also
12
+ # deferred).
13
+ #
14
+ # # Test shape: structural contract-assertion (ADR-037 fallback path)
15
+ #
16
+ # The architect-review verdict on P088 (2026-04-26 iter) was:
17
+ # **structural-with-fallback-note, ship this iter**. P081 (architect-
18
+ # design / open) flags structural grep tests on SKILL.md prose as
19
+ # wasteful; the behavioural alternative would programmatically simulate
20
+ # the subagent surface, invoke run-retro, and assert the skill detects
21
+ # the surface and emits an anti-pattern denial. That requires
22
+ # infrastructure (mock subagent stub, mock Agent-tool harness) which
23
+ # does not exist in this repo today.
24
+ #
25
+ # Per ADR-037's "permitted exception" affordance for prose-only
26
+ # contracts, this fixture takes the structural path. P081 follow-up
27
+ # tracks the behavioural-test infrastructure build; once P081 lands a
28
+ # subagent-surface mock, this file's structural assertions become
29
+ # replaceable by behavioural assertions exercising the actual surface
30
+ # detection. Until then, structural is the contract.
31
+ #
32
+ # # @adr ADR-037 fallback — P081 behavioural follow-up tracked.
33
+ # # @ticket P088 — run-retro context-visibility settlement.
34
+
35
+ setup() {
36
+ REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
37
+ SKILL_MD="$REPO_ROOT/packages/retrospective/skills/run-retro/SKILL.md"
38
+ }
39
+
40
+ @test "run-retro: SKILL.md carries 'Never invoke as a background agent' anti-pattern clause (P088)" {
41
+ run grep -F 'Never invoke as a background agent' "$SKILL_MD"
42
+ [ "$status" -eq 0 ]
43
+ }
44
+
45
+ @test "run-retro: anti-pattern clause cites P088 as driver" {
46
+ run grep -F 'P088' "$SKILL_MD"
47
+ [ "$status" -eq 0 ]
48
+ }
49
+
50
+ @test "run-retro: anti-pattern clause names the supported invocation surfaces" {
51
+ # Foreground /wr-retrospective:run-retro — the canonical invocation.
52
+ run grep -F 'Foreground' "$SKILL_MD"
53
+ [ "$status" -eq 0 ]
54
+ # claude -p subprocess invocation — supported per P086 (subprocess has
55
+ # iteration context naturally).
56
+ run grep -F 'claude -p' "$SKILL_MD"
57
+ [ "$status" -eq 0 ]
58
+ run grep -F 'P086' "$SKILL_MD"
59
+ [ "$status" -eq 0 ]
60
+ }
61
+
62
+ @test "run-retro: anti-pattern clause names the deferred background-agent surface explicitly" {
63
+ # The clause MUST mention Agent(run_in_background: true) or the
64
+ # capture-retro sibling so a future contributor can pattern-match
65
+ # the surface to the warning.
66
+ run grep -E 'run_in_background|capture-retro' "$SKILL_MD"
67
+ [ "$status" -eq 0 ]
68
+ }
69
+
70
+ @test "run-retro: anti-pattern clause appears in the preamble (before Step 1)" {
71
+ # The anti-pattern note belongs near the top of the SKILL so the
72
+ # agent encounters it before committing to an invocation surface.
73
+ # Placement requirement: clause appears before the '### 1. Read the
74
+ # current briefing' section header.
75
+ pos_clause=$(grep -n 'Never invoke as a background agent' "$SKILL_MD" | head -1 | cut -d: -f1)
76
+ pos_step1=$(grep -n '^### 1\. Read the current briefing' "$SKILL_MD" | head -1 | cut -d: -f1)
77
+ [ -n "$pos_clause" ]
78
+ [ -n "$pos_step1" ]
79
+ [ "$pos_clause" -lt "$pos_step1" ]
80
+ }
81
+
82
+ @test "run-retro: anti-pattern clause cross-references ADR-032 capture-retro deferral" {
83
+ # The clause should pin the ADR amendment so a contributor reading
84
+ # the SKILL can trace the deferral decision back to the ADR.
85
+ run grep -F 'ADR-032' "$SKILL_MD"
86
+ [ "$status" -eq 0 ]
87
+ }