Skip to content

fix(retro): persist recommendations so the next retro detects follow-through (#1834)#1853

Open
jbetala7 wants to merge 2 commits into
garrytan:mainfrom
jbetala7:oss/fix-1834-retro-persist-recommendations
Open

fix(retro): persist recommendations so the next retro detects follow-through (#1834)#1853
jbetala7 wants to merge 2 commits into
garrytan:mainfrom
jbetala7:oss/fix-1834-retro-persist-recommendations

Conversation

@jbetala7
Copy link
Copy Markdown
Contributor

@jbetala7 jbetala7 commented Jun 3, 2026

Problem

/retro generates its "3 Things to Improve" recommendations as prose output but never saves them to the JSON snapshot in .context/retros/. On the next run, Step 12 loads the prior snapshot for trend comparison but has no structured record of what it recommended.

The result: a week spent acting on retro feedback (security hardening, dependency bumps, the exact things the last retro asked for) gets mischaracterized as a generic "fix ratio is high" instead of "2 of 3 prior recommendations addressed." The improvement loop never closes.

Fixes #1834.

Root cause

The Step 13 snapshot schema (retro/SKILL.md.tmpl) persists metrics, authors, streak, greptile/backlog/test_health, and a tweetable — but not the recommendations. Step 12 reads the prior snapshot back for trend deltas, yet there is nothing in it to compare current-week work against.

Fix (repo-scoped /retro)

Three template edits in retro/SKILL.md.tmpl, then regenerated retro/SKILL.md:

  1. Step 13 — the snapshot schema gains a mandatory recommendations array of {category, text} objects, populated from the "3 Things to Improve" items. Unlike greptile/backlog/test_health (omitted when empty), this is always written, because it is the input the next run reads back.
  2. Step 12 — after loading the prior snapshot, each prior recommendation is scored against this window's commit subjects, changed files, and metrics as addressed / partial / open, surfaced in a Recommendation follow-through section ("2 of 3 prior recommendations addressed"). Snapshots written before this field existed have no recommendations key and are skipped silently, so old .context/retros/ history doesn't break.
  3. "3 Things to Improve" narrative — wired to record the same 3 items into the snapshot array, closing the loop.

Matches the schema the issue proposed. Scoped to the repo-scoped retro that writes .context/retros/; global mode (~/.gstack/retros/) is left as a follow-up to keep this to one issue.

Testing

New test/regression-1834-retro-recommendations.test.ts, following the #1624 static-invariant convention — it asserts the full persist → read-back loop in both the template and the regenerated SKILL.md, so the capability can't silently regress:

bun test test/regression-1834-retro-recommendations.test.ts   # 8 pass

Verified the guard bites: 8/8 fail without the template fix, 8/8 pass with it. test/skill-validation.test.ts and the existing test/regression-1624-retro-stale-base.test.ts still pass.

Note: gen-skill-docs.test.ts has 8 pre-existing --host all / --host gbrain dry-run freshness failures on a clean main (c43c850c) on my machine, unrelated to this change — this PR adds zero new failures. The external-fork eval/report CI jobs may also fail on empty-env auth as usual; not actionable from a fork.

🤖 Generated with Claude Code

jbetala7 and others added 2 commits June 3, 2026 11:34
…follow-through

/retro generated its "3 Things to Improve" as throwaway prose and never wrote
them to the .context/retros/ snapshot. The next run loaded the prior snapshot
for trend comparison but had no structured record of what it recommended, so a
week spent acting on retro feedback (security hardening, dependency bumps) got
mischaracterized as a generic "fix ratio is high" instead of "2 of 3 prior
recommendations addressed."

- Step 13 snapshot schema gains a mandatory `recommendations` array
  ({category, text}), populated from the "3 Things to Improve" items.
- Step 12 reads a prior snapshot's `recommendations` back, classifies each as
  addressed / partial / open against this window's commits, changed files, and
  metrics, and surfaces a "Recommendation follow-through" section. Snapshots
  that predate the field are skipped (backward compatible).
- The "3 Things to Improve" narrative is wired to the persisted array so the
  loop closes.

Repo-scoped retro only; global mode (~/.gstack/retros/) left as a follow-up to
keep this contained to one issue.

Fixes garrytan#1834

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ollow-through loop

Mirrors the garrytan#1624 static-invariant convention: asserts the persist → read-back
loop in retro/SKILL.md.tmpl (and the regenerated SKILL.md) stays intact — Step
13 always writes recommendations, Step 12 reads them back and scores
addressed/partial/open with a backward-compat skip, and the "3 Things to
Improve" narrative records them. Fails the build if any leg regresses.

Verified 8/8 fail without the template fix and pass with it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented Jun 3, 2026

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/retro should persist recommendations and detect follow-through in subsequent runs

1 participant