@windyroad/retrospective 0.8.0 → 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",
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,12 +8,77 @@ 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
14
29
 
15
30
  Read `docs/briefing/README.md` — the per-topic index, Critical Points summary, and per-file hooks. Then read each topic file referenced in the Topic Index (`docs/briefing/<topic>.md`) to understand what previous sessions captured under each heading. During the P100 transition window the legacy single-file `docs/BRIEFING.md` may still exist as a stub pointer; it is read-only until P100 slice 2 retires it.
16
31
 
32
+ ### 1.5. Briefing signal-vs-noise pass (P105)
33
+
34
+ After reading the briefing tree, score every entry in `docs/briefing/*.md` to decide whether it was **signal** (useful this session), **noise** (loaded but not useful), or **decay-only** (not in context at all). This pass drives the Critical Points roll-up curation that the SessionStart hook consumes.
35
+
36
+ **Scoring rules** (applied per entry, per retro cycle):
37
+
38
+ | Event | Delta | Trigger |
39
+ |-------|-------|---------|
40
+ | Signal | +2 | Entry was cited, paraphrased, or acted on during this session. |
41
+ | Noise | -1 | Entry was loaded into context but not cited or acted on. |
42
+ | Decay | -1 | Applied to **all** entries every retro cycle, regardless of signal/noise status. |
43
+
44
+ **Grounding requirement (ADR-026)**: every classification MUST carry a specific citation — the tool invocation, reasoning paraphrase, or session position that exercised (or failed to exercise) the entry. Bare classifications are forbidden. The citation is recorded in the retro summary (Step 5) so the user can audit the agent's judgment.
45
+
46
+ **Thresholds and actions**:
47
+
48
+ | Score range | Action |
49
+ |-------------|--------|
50
+ | >= +3 | Promote to Critical Points candidate. The agent adds the entry to the Critical Points roll-up in `docs/briefing/README.md` during Step 3. |
51
+ | 0 .. +2 | Keep in the topic file. No roll-up change. |
52
+ | <= -3 | Route to the **delete queue**. These entries are surfaced for user confirmation in a single batched `AskUserQuestion` at the end of this step. |
53
+
54
+ **Per-entry persistence format**: each briefing entry carries a trailing HTML comment block:
55
+
56
+ ```markdown
57
+ - Entry text body goes here.
58
+ <!-- signal-score: 2 | last-classified: 2026-04-22 | first-written: 2026-04-15 -->
59
+ ```
60
+
61
+ The comment block is appended to the list item (or heading) that contains the entry text. `first-written` is set when the entry is created and never changed; `last-classified` and `signal-score` are updated each retro. If an entry lacks a comment block, treat `signal-score` as `0` and set `first-written` to today.
62
+
63
+ **Classification ownership (policy-authorised per ADR-013 Rule 5)**: the agent owns silent classification. No `AskUserQuestion` is fired for individual entry promotions, demotions, or keep decisions. The agent applies the ADR-026 heuristic directly: entry cited in a tool call (or paraphrased in reasoning) during the session = signal; never loaded or loaded-but-unused = noise; ambiguous cases still classify but with a tentative flag the next retro resolves.
64
+
65
+ **Delete queue confirmation**: after scoring all entries, if any entries have a score <= -3:
66
+
67
+ 1. Present a single `AskUserQuestion` with `header: "Delete briefing entries?"` and `multiSelect: false`.
68
+ 2. The question body lists each delete candidate with its score and the ADR-026 citation that led to the noise classification.
69
+ 3. Options (up to 4 per prompt, sequential if > 4):
70
+ 1. `Confirm all deletions` — description: "Remove all listed entries from their topic files."
71
+ 2. `Delete selected only` — description: "The agent will present a follow-up with per-entry checkboxes."
72
+ 3. `Keep all (defer to next retro)` — description: "Leave entries in place; scores remain unchanged."
73
+ 4. `Review individually` — description: "Present each entry one at a time for keep/delete decision."
74
+ 4. If the queue is empty, skip the prompt entirely.
75
+
76
+ If the user chooses `Delete selected only` or `Review individually`, present subsequent `AskUserQuestion` calls as needed, respecting the 4-option cap per ADR-013 Rule 1.
77
+
78
+ **Tier 1 budget guard**: if promoting all score >= +3 entries would breach the 2 KB / ~10-bullet Critical Points budget (ADR-040), promote only the highest-scored entries until the budget is met and surface the remainder as a budget-overflow advisory in the retro summary.
79
+
80
+ **Non-interactive / AFK fallback (ADR-013 Rule 6)**: when `AskUserQuestion` is unavailable, classify silently and defer the delete queue to the retro summary (Step 5). Do NOT auto-delete entries in AFK mode. The retro summary's "Signal-vs-Noise Pass" section lists each delete candidate with score and citation so the user can review on return. Same trust-boundary shape as Step 2b and Step 4a.
81
+
17
82
  ### 2. Reflect on this session
18
83
 
19
84
  Consider the work done in this session and identify:
@@ -64,7 +129,7 @@ The shape mirrors P068's Step 4a Verification-close housekeeping: glob / evidenc
64
129
 
65
130
  **Signal categories** — each detection is tagged with the primary category. A detection may match multiple categories; pick the one whose fix path is most concrete.
66
131
 
67
- 1. **Hook-protocol friction** — gate-marker TTL expiries mid-work (e.g. architect-hook 1800s TTL per ADR-009 expiring while drafting a long file), marker-vs-file deadlocks (a gate demands PASS before a Write; the agent refuses to PASS on a file that doesn't exist yet), hook-exemption scope gaps, hooks firing on paths they shouldn't, hooks silently skipping paths they should.
132
+ 1. **Hook-protocol friction** — gate-marker TTL expiries mid-work (e.g. architect-hook 3600s TTL per ADR-009 expiring while drafting a very long file — was 1800s before P107), marker-vs-file deadlocks (a gate demands PASS before a Write; the agent refuses to PASS on a file that doesn't exist yet), hook-exemption scope gaps, hooks firing on paths they shouldn't, hooks silently skipping paths they should.
68
133
  2. **Skill-contract violations** — skill steps that collide (e.g. ADR-027 Step 0 colliding with ADR-031 auto-migration Step 0), skills that return empty on paths they should handle (e.g. work-problems false-zero-bail on flat-layout adopter repos), skills whose AskUserQuestion options exceed the 4-option cap (per P061), skills that silently swallow error states the contract says should halt.
69
134
  3. **Release-path instability** — `push:watch` / `release:watch` misbehaviour (P054, P060 class — reporting success on a stale SHA's workflow run), changeset authoring defects (P073), release-PR body issues, npm publish failing on metadata mismatch.
70
135
  4. **Subagent-delegation friction** — architect / jtbd / risk-scorer / style-guide / voice-tone agents returning `DEFERRED` or `ISSUES FOUND` that block progress, PASS markers failing to write, agent prompts timing out, agent outputs missing the specific citations ADR-026 requires.
@@ -117,10 +182,43 @@ For each accepted learning:
117
182
  After editing topic files, update `docs/briefing/README.md`:
118
183
 
119
184
  - Refresh per-file summaries in the Topic Index if the topic file's character changed.
120
- - Promote an entry into the Critical Points section only when it is genuinely among the highest-value rules of the session (the session-start surface is small and curated adding there is a user-interactive decision per the helpfulness rating slice 2 will add).
185
+ - Promote an entry into the Critical Points section when its signal-score is >= +3 (agent-driven per Step 1.5). The session-start surface is small and curated; the agent promotes the highest-scored entries first, respecting the Tier 1 budget guard. Demotion from Critical Points happens automatically when an entry's score drops below +3 after decay. The remaining user-interactive boundary is the delete queue (score <= -3), which requires explicit user confirmation.
121
186
 
122
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?"
123
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
+
124
222
  ### 4. Create or update problem tickets
125
223
 
126
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:
@@ -259,6 +357,20 @@ Present a summary to the user:
259
357
  - Updated: [items modified]
260
358
  - README index refreshed: [per-file summaries or Critical Points changes]
261
359
 
360
+ ### Signal-vs-Noise Pass (P105)
361
+
362
+ (Emitted only when Step 1.5 scored briefing entries. Always present when run-retro is invoked — the pass runs regardless of other outcomes. In non-interactive / AFK mode, the delete queue is surfaced here instead of firing `AskUserQuestion`.)
363
+
364
+ | Entry | Topic file | Old score | New score | Classification | Citation |
365
+ |-------|-----------|-----------|-----------|----------------|----------|
366
+ | <one-line entry summary> | `docs/briefing/<topic>.md` | <old> | <new> | signal / noise / decay-only | <tool call or reasoning paraphrase> |
367
+
368
+ **Critical Points changes**: list any entries promoted to or demoted from the Critical Points roll-up.
369
+
370
+ **Delete queue** (only when non-empty): list each score <= -3 candidate with its score and citation. In interactive mode, note the user's decision (`confirmed / deferred / kept`). In AFK mode, label each as `deferred to next interactive session`.
371
+
372
+ **Budget overflow** (only when triggered): list any score >= +3 entries that were NOT promoted because the Tier 1 budget was already met.
373
+
262
374
  ### Problems Created/Updated
263
375
  - [problem ticket]: [summary]
264
376
 
@@ -278,6 +390,14 @@ Present a summary to the user:
278
390
  |--------|----------|-----------|----------|
279
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) |
280
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
+
281
401
  ### Codification Candidates
282
402
 
283
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
+ }
@@ -0,0 +1,129 @@
1
+ #!/usr/bin/env bats
2
+
3
+ # P105: run-retro SKILL.md documents a signal-vs-noise pass (Step 1.5) that
4
+ # scores every briefing entry per retro cycle, drives Critical Points curation,
5
+ # and gates deletion behind a batched user-confirmation queue.
6
+ #
7
+ # Doc-lint structural test (Permitted Exception per ADR-005). Asserts
8
+ # SKILL.md wording for: the step header, placement between Step 1 and Step 2,
9
+ # the three scoring rules (signal +2, noise -1, decay -1), the HTML comment
10
+ # persistence format, the ADR-026 grounding requirement, the threshold
11
+ # actions (promote/keep/delete), the Tier 1 budget guard, the delete-queue
12
+ # AskUserQuestion contract (ADR-013 Rule 1), the AFK fallback (ADR-013 Rule 6),
13
+ # the Step 3 agent-driven promotion update, and the Step 5 summary integration.
14
+
15
+ setup() {
16
+ REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../../.." && pwd)"
17
+ SKILL_MD="$REPO_ROOT/packages/retrospective/skills/run-retro/SKILL.md"
18
+ }
19
+
20
+ @test "run-retro: SKILL.md contains Step 1.5 Briefing signal-vs-noise pass (P105)" {
21
+ run grep -F '### 1.5. Briefing signal-vs-noise pass (P105)' "$SKILL_MD"
22
+ [ "$status" -eq 0 ]
23
+ }
24
+
25
+ @test "run-retro: Step 1.5 placement between Step 1 and Step 2" {
26
+ pos_1=$(grep -n '^### 1\. ' "$SKILL_MD" | head -1 | cut -d: -f1)
27
+ pos_1_5=$(grep -n '^### 1\.5\. ' "$SKILL_MD" | head -1 | cut -d: -f1)
28
+ pos_2=$(grep -n '^### 2\. ' "$SKILL_MD" | head -1 | cut -d: -f1)
29
+ [ -n "$pos_1" ]
30
+ [ -n "$pos_1_5" ]
31
+ [ -n "$pos_2" ]
32
+ [ "$pos_1" -lt "$pos_1_5" ]
33
+ [ "$pos_1_5" -lt "$pos_2" ]
34
+ }
35
+
36
+ @test "run-retro: Step 1.5 documents all three scoring events" {
37
+ run grep -F 'Signal | +2' "$SKILL_MD"
38
+ [ "$status" -eq 0 ]
39
+ run grep -F 'Noise | -1' "$SKILL_MD"
40
+ [ "$status" -eq 0 ]
41
+ run grep -F 'Decay | -1' "$SKILL_MD"
42
+ [ "$status" -eq 0 ]
43
+ }
44
+
45
+ @test "run-retro: Step 1.5 documents the HTML comment persistence format" {
46
+ run grep -F 'signal-score:' "$SKILL_MD"
47
+ [ "$status" -eq 0 ]
48
+ run grep -F 'last-classified:' "$SKILL_MD"
49
+ [ "$status" -eq 0 ]
50
+ run grep -F 'first-written:' "$SKILL_MD"
51
+ [ "$status" -eq 0 ]
52
+ }
53
+
54
+ @test "run-retro: Step 1.5 requires ADR-026 grounding for classifications" {
55
+ run grep -F 'ADR-026' "$SKILL_MD"
56
+ [ "$status" -eq 0 ]
57
+ run grep -F 'specific citation' "$SKILL_MD"
58
+ [ "$status" -eq 0 ]
59
+ run grep -F 'Bare classifications are forbidden' "$SKILL_MD"
60
+ [ "$status" -eq 0 ]
61
+ }
62
+
63
+ @test "run-retro: Step 1.5 documents promote threshold (score >= +3)" {
64
+ run grep -F '>= +3' "$SKILL_MD"
65
+ [ "$status" -eq 0 ]
66
+ run grep -F 'Promote to Critical Points' "$SKILL_MD"
67
+ [ "$status" -eq 0 ]
68
+ }
69
+
70
+ @test "run-retro: Step 1.5 documents delete queue threshold (score <= -3)" {
71
+ run grep -F '<= -3' "$SKILL_MD"
72
+ [ "$status" -eq 0 ]
73
+ run grep -F 'delete queue' "$SKILL_MD"
74
+ [ "$status" -eq 0 ]
75
+ }
76
+
77
+ @test "run-retro: Step 1.5 delete queue uses single batched AskUserQuestion (ADR-013 Rule 1)" {
78
+ run grep -F 'Delete briefing entries?' "$SKILL_MD"
79
+ [ "$status" -eq 0 ]
80
+ run grep -F 'Confirm all deletions' "$SKILL_MD"
81
+ [ "$status" -eq 0 ]
82
+ run grep -F 'Keep all (defer to next retro)' "$SKILL_MD"
83
+ [ "$status" -eq 0 ]
84
+ }
85
+
86
+ @test "run-retro: Step 1.5 AFK fallback defers delete queue to retro summary (ADR-013 Rule 6)" {
87
+ run grep -F 'Non-interactive / AFK fallback (ADR-013 Rule 6)' "$SKILL_MD"
88
+ [ "$status" -eq 0 ]
89
+ run grep -F 'Do NOT auto-delete' "$SKILL_MD"
90
+ [ "$status" -eq 0 ]
91
+ run grep -F 'Signal-vs-Noise Pass' "$SKILL_MD"
92
+ [ "$status" -eq 0 ]
93
+ }
94
+
95
+ @test "run-retro: Step 1.5 documents the Tier 1 budget guard" {
96
+ run grep -F 'Tier 1 budget guard' "$SKILL_MD"
97
+ [ "$status" -eq 0 ]
98
+ run grep -F '2 KB' "$SKILL_MD"
99
+ [ "$status" -eq 0 ]
100
+ }
101
+
102
+ @test "run-retro: Step 1.5 cites ADR-040 for the Critical Points budget" {
103
+ run grep -F 'ADR-040' "$SKILL_MD"
104
+ [ "$status" -eq 0 ]
105
+ }
106
+
107
+ @test "run-retro: Step 1.5 classification is policy-authorised silent (ADR-013 Rule 5)" {
108
+ run grep -F 'policy-authorised per ADR-013 Rule 5' "$SKILL_MD"
109
+ [ "$status" -eq 0 ]
110
+ run grep -F 'agent owns silent classification' "$SKILL_MD"
111
+ [ "$status" -eq 0 ]
112
+ }
113
+
114
+ @test "run-retro: Step 3 acknowledges agent-driven promotion from Step 1.5 score" {
115
+ run grep -F 'agent-driven per Step 1.5' "$SKILL_MD"
116
+ [ "$status" -eq 0 ]
117
+ run grep -F 'signal-score' "$SKILL_MD"
118
+ [ "$status" -eq 0 ]
119
+ }
120
+
121
+ @test "run-retro: Step 5 summary adds a Signal-vs-Noise Pass section" {
122
+ run grep -F '### Signal-vs-Noise Pass (P105)' "$SKILL_MD"
123
+ [ "$status" -eq 0 ]
124
+ }
125
+
126
+ @test "run-retro: Signal-vs-Noise Pass summary table columns match Step 1.5 output" {
127
+ run grep -F '| Entry | Topic file | Old score | New score | Classification | Citation |' "$SKILL_MD"
128
+ [ "$status" -eq 0 ]
129
+ }