fix: status maintenance workflow time window detection (#513)

the workflow was using "last week" as its time window, which caused it
to miss work that happened between the last merged PR and ~7 days ago.

changes:
- query gh pr list to find when last status-maintenance PR was MERGED
- filter by branch name (startswith "status-maintenance-") and sort by mergedAt
- use that merge date as the starting point, not "last week"
- clarify that archive files are organized by month (YYYY-MM.md)
- add examples for archive file naming (2025-12.md for December, etc.)
- remove hardcoded "weekly" titles, let Claude craft descriptive titles

fixes the issue where PR #512 only covered Dec 7th onwards when it
should have covered everything since Dec 2nd (last merge date).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>

authored by zzstoatzz.io Claude and committed by GitHub 6143ab1a ea508de7

Changed files
+26 -10
.github
+26 -10
.github/workflows/status-maintenance.yml
··· 1 - # weekly status maintenance via claude code 1 + # status maintenance via claude code 2 2 # 3 3 # two-phase workflow: 4 4 # 1. workflow_dispatch: archives old STATUS.md sections, generates audio, opens PR ··· 58 58 59 59 ## task 1: gather temporal context 60 60 61 + CRITICAL: you must determine the correct time window by finding when the LAST status maintenance PR was MERGED (not opened). 62 + 61 63 run these commands: 62 64 ```bash 63 65 date 64 - git log --oneline --since="1 week ago" 65 - git log --oneline -30 66 + # get the most recently merged status-maintenance PR (filter by branch name, sort by merge date) 67 + gh pr list --state merged --search "status-maintenance" --limit 20 --json number,title,mergedAt,headRefName | jq '[.[] | select(.headRefName | startswith("status-maintenance-"))] | sort_by(.mergedAt) | reverse | .[0]' 68 + git log --oneline -50 66 69 ls -la .status_history/ 2>/dev/null || echo "no archive directory yet" 67 70 wc -l STATUS.md 68 71 ``` 69 72 70 73 determine: 71 74 - what is today's date? 72 - - what shipped in the last week vs earlier? 75 + - when was the last status-maintenance PR MERGED? (use the mergedAt field from the jq output - it's the most recent PR with a branch starting with "status-maintenance-") 76 + - what shipped SINCE that merge date? (this is your focus window - NOT "last week") 73 77 - does .status_history/ exist? (this implies whether or not this is the first episode) 74 78 - how many lines is STATUS.md currently? 79 + 80 + IMPORTANT: the time window for this maintenance run is from the last merged status-maintenance PR until now. if the last PR was merged on Dec 2nd and today is Dec 8th, you should focus on everything from Dec 3rd onwards, NOT just "the last week". 75 81 76 82 ## task 2: archive old sections (MANDATORY if over 250 lines) 77 83 ··· 83 89 5. generally preserve the document structure (keep "## recent work" header, "## immediate priorities", etc) 84 90 6. do NOT summarize archived content - move it verbatim and organize it chronologically 85 91 92 + ARCHIVE FILE NAMING - CRITICAL: 93 + - archive files are organized BY MONTH: .status_history/YYYY-MM.md 94 + - if today is December 2025, archived December content goes to .status_history/2025-12.md 95 + - if today is January 2026, archived January content goes to .status_history/2026-01.md 96 + - check what files already exist in .status_history/ and ADD to the appropriate month file if it exists 97 + - each month gets ONE file - append to existing month files, don't create duplicates 98 + 86 99 so STATUS.md is the living overview, slightly recency biased, but a good general overview of the project. 87 100 88 - .status_history/ is the archive of temporally specific sections of STATUS.md that are worth preserving for historical context, but not significant enought to be stated literally in STATUS.md in perpetuity. 101 + .status_history/ is the archive of temporally specific sections of STATUS.md that are worth preserving for historical context, but not significant enough to be stated literally in STATUS.md in perpetuity. 89 102 90 103 VERIFY: run `wc -l STATUS.md` after archiving. it MUST be under 500 lines. 91 104 ··· 125 138 - work chronologically from beginning to end, don't heavily bias towards nascent or recent work 126 139 127 140 SUBSEQUENT EPISODES (ignore this if its the first episode): 128 - - focus on what actually shipped since last episode 129 - - use git history to determine timing ("last week" vs "earlier this month") 141 + - focus on what actually shipped since the last status-maintenance PR was MERGED 142 + - use the mergedAt date from task 1 as your starting point, NOT "last week" 143 + - reference git commits since that merge date to determine what shipped 130 144 - don't re-explain the whole project - listeners already know 131 145 - tone: "here's what changed since last time" 132 146 ··· 157 171 if any files changed: 158 172 1. git checkout -b status-maintenance-$(date +%Y%m%d) 159 173 2. git add .status_history/ STATUS.md update.wav 160 - 3. git commit -m "chore: weekly status maintenance" 174 + 3. git commit -m "chore: status maintenance" 161 175 4. git push -u origin status-maintenance-$(date +%Y%m%d) 162 - 5. gh pr create --title "chore: weekly status maintenance" --body "automated status archival and audio overview" 176 + 5. gh pr create with a title and body you craft: 177 + - title should be descriptive of what this status update covers (e.g. "chore: status maintenance - playlist fast-follow fixes" or "chore: status maintenance - December updates") 178 + - make it clear this is an automated status maintenance PR from the GitHub Action 179 + - body should summarize what changed (archival, audio generation, etc.) 163 180 164 - add detail as desired to the PR body and title. 165 181 add a label like "ai-generated" to the PR (create the label if it doesn't exist) 166 182 if nothing changed, report that no maintenance was needed. 167 183