Skip to content

Commit 09ce855

Browse files
chandanv89oz-agent
andauthored
fix: use last_updated instead of generated for sprint-status staleness check (bmad-code-org#1836)
The staleness warning in sprint-status always fired after 7 days because it checked the 'generated' timestamp, which is only set once during sprint-planning. Other workflows (dev-story, create-story, code-review, retrospective) update statuses but never touched 'generated'. This adds a 'last_updated' field that is: - Set initially alongside 'generated' during sprint-planning - Bumped to current date by every workflow that modifies sprint-status.yaml - Used by the staleness check (with fallback to 'generated' for backward compatibility) Fixes bmad-code-org#1820 Co-authored-by: Oz <oz-agent@warp.dev>
1 parent e3ffdf9 commit 09ce855

File tree

7 files changed

+12
-3
lines changed

7 files changed

+12
-3
lines changed

src/bmm/workflows/4-implementation/code-review/instructions.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,14 @@
195195

196196
<check if="{{new_status}} == 'done'">
197197
<action>Update development_status[{{story_key}}] = "done"</action>
198+
<action>Update last_updated field to current date</action>
198199
<action>Save file, preserving ALL comments and structure</action>
199200
<output>✅ Sprint status synced: {{story_key}} → done</output>
200201
</check>
201202

202203
<check if="{{new_status}} == 'in-progress'">
203204
<action>Update development_status[{{story_key}}] = "in-progress"</action>
205+
<action>Update last_updated field to current date</action>
204206
<action>Save file, preserving ALL comments and structure</action>
205207
<output>🔄 Sprint status synced: {{story_key}} → in-progress</output>
206208
</check>

src/bmm/workflows/4-implementation/create-story/instructions.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@
321321
<action>Find development_status key matching {{story_key}}</action>
322322
<action>Verify current status is "backlog" (expected previous state)</action>
323323
<action>Update development_status[{{story_key}}] = "ready-for-dev"</action>
324+
<action>Update last_updated field to current date</action>
324325
<action>Save file, preserving ALL comments and structure including STATUS DEFINITIONS</action>
325326
</check>
326327

src/bmm/workflows/4-implementation/dev-story/instructions.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@
195195

196196
<check if="current status == 'ready-for-dev' OR review_continuation == true">
197197
<action>Update the story in the sprint status report to = "in-progress"</action>
198+
<action>Update last_updated field to current date</action>
198199
<output>🚀 Starting work on story {{story_key}}
199200
Status updated: ready-for-dev → in-progress
200201
</output>
@@ -348,6 +349,7 @@
348349
<action>Find development_status key matching {{story_key}}</action>
349350
<action>Verify current status is "in-progress" (expected previous state)</action>
350351
<action>Update development_status[{{story_key}}] = "review"</action>
352+
<action>Update last_updated field to current date</action>
351353
<action>Save file, preserving ALL comments and structure including STATUS DEFINITIONS</action>
352354
<output>✅ Story status updated to "review" in sprint-status.yaml</output>
353355
</check>

src/bmm/workflows/4-implementation/retrospective/instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,6 +1336,7 @@ Bob (Scrum Master): "See you all when prep work is done. Meeting adjourned!"
13361336
<action>Find development_status key "epic-{{epic_number}}-retrospective"</action>
13371337
<action>Verify current status (typically "optional" or "pending")</action>
13381338
<action>Update development_status["epic-{{epic_number}}-retrospective"] = "done"</action>
1339+
<action>Update last_updated field to current date</action>
13391340
<action>Save file, preserving ALL comments and structure including STATUS DEFINITIONS</action>
13401341

13411342
<check if="update successful">

src/bmm/workflows/4-implementation/sprint-planning/instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ development_status:
9595

9696
```yaml
9797
# generated: {date}
98+
# last_updated: {date}
9899
# project: {project_name}
99100
# project_key: {project_key}
100101
# tracking_system: {tracking_system}
@@ -130,6 +131,7 @@ development_status:
130131
# - Dev moves story to 'review', then runs code-review (fresh context, different LLM recommended)
131132
132133
generated: { date }
134+
last_updated: { date }
133135
project: { project_name }
134136
project_key: { project_key }
135137
tracking_system: { tracking_system }

src/bmm/workflows/4-implementation/sprint-planning/sprint-status-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
# EXAMPLE STRUCTURE (your actual epics/stories will replace these):
3636

3737
generated: 05-06-2-2025 21:30
38+
last_updated: 05-06-2-2025 21:30
3839
project: My Awesome Project
3940
project_key: NOKEY
4041
tracking_system: file-system

src/bmm/workflows/4-implementation/sprint-status/instructions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Run `/bmad:bmm:workflows:sprint-planning` to generate it, then rerun sprint-stat
3636

3737
<step n="2" goal="Read and parse sprint-status.yaml">
3838
<action>Read the FULL file: {sprint_status_file}</action>
39-
<action>Parse fields: generated, project, project_key, tracking_system, story_location</action>
39+
<action>Parse fields: generated, last_updated, project, project_key, tracking_system, story_location</action>
4040
<action>Parse development_status map. Classify keys:</action>
4141
- Epics: keys starting with "epic-" (and not ending with "-retrospective")
4242
- Retrospectives: keys ending with "-retrospective"
@@ -84,7 +84,7 @@ Enter corrections (e.g., "1=in-progress, 2=backlog") or "skip" to continue witho
8484
- IF any story has status "review": suggest `/bmad:bmm:workflows:code-review`
8585
- IF any story has status "in-progress" AND no stories have status "ready-for-dev": recommend staying focused on active story
8686
- IF all epics have status "backlog" AND no stories have status "ready-for-dev": prompt `/bmad:bmm:workflows:create-story`
87-
- IF `generated` timestamp is more than 7 days old: warn "sprint-status.yaml may be stale"
87+
- IF `last_updated` timestamp is more than 7 days old (or `last_updated` is missing, fall back to `generated`): warn "sprint-status.yaml may be stale"
8888
- IF any story key doesn't match an epic pattern (e.g., story "5-1-..." but no "epic-5"): warn "orphaned story detected"
8989
- IF any epic has status in-progress but has no associated stories: warn "in-progress epic has no stories"
9090
</step>
@@ -195,7 +195,7 @@ If the command targets a story, set `story_key={{next_story_id}}` when prompted.
195195

196196
<action>Read and parse {sprint_status_file}</action>
197197

198-
<action>Validate required metadata fields exist: generated, project, project_key, tracking_system, story_location</action>
198+
<action>Validate required metadata fields exist: generated, project, project_key, tracking_system, story_location (last_updated is optional for backward compatibility)</action>
199199
<check if="any required field missing">
200200
<template-output>is_valid = false</template-output>
201201
<template-output>error = "Missing required field(s): {{missing_fields}}"</template-output>

0 commit comments

Comments
 (0)