feat(dev-story): capture baseline commit for code-review diff

This commit is contained in:
Alex Verkhovsky 2026-01-04 03:04:56 -08:00
parent 6d1d7d0e72
commit f5d949b922
2 changed files with 28 additions and 16 deletions

View File

@ -22,13 +22,14 @@ nextStepFile: '{workflow_path}/steps/step-05-consolidate-findings.md'
From previous steps: From previous steps:
- `{story_path}`, `{story_key}` - `{story_path}`, `{story_key}`
- `{git_changed_files}` - Files changed according to git - `{file_list}` - Files listed in story's File List section
- `{context_aware_findings}` - Findings from Phase 1 - `{context_aware_findings}` - Findings from Phase 1
--- ---
## STATE VARIABLE (capture now) ## STATE VARIABLE (capture now)
- `{baseline_commit}` - From story file Dev Agent Record
- `{diff_output}` - Complete diff of changes - `{diff_output}` - Complete diff of changes
- `{asymmetric_findings}` - Findings from adversarial review - `{asymmetric_findings}` - Findings from adversarial review
@ -40,29 +41,29 @@ From previous steps:
Build complete diff of all changes for this story. Build complete diff of all changes for this story.
**Determine diff source:** **Step 1a: Read baseline from story file**
If uncommitted changes exist for story files: Extract `Baseline Commit` from the story file's Dev Agent Record section.
- If found and not "NO_GIT": use as `{baseline_commit}`
- If "NO_GIT" or missing: proceed to fallback
**Step 1b: Construct diff (with baseline)**
If `{baseline_commit}` is a valid commit hash:
```bash ```bash
git diff git diff {baseline_commit} -- ':!{implementation_artifacts}'
git diff --cached
``` ```
If story work is already committed, find story-related commits: This captures all changes (committed + uncommitted) since dev-story started.
```bash **Step 1c: Fallback (no baseline)**
# Find commits that reference this story
git log --oneline --all --grep="{story_key}" --format="%H"
# Or find recent commits touching story files
git log --oneline -10 -- {story_file_list}
```
Then construct diff: If no baseline available, review current state of files in `{file_list}`:
```bash - Read each file listed in the story's File List section
git diff {first_story_commit}^..HEAD -- {files} - Review as full file content (not a diff)
```
**Include in `{diff_output}`:** **Include in `{diff_output}`:**

View File

@ -219,6 +219,17 @@
<output> No sprint status file exists - story progress will be tracked in story file only</output> <output> No sprint status file exists - story progress will be tracked in story file only</output>
<action>Set {{current_sprint_status}} = "no-sprint-tracking"</action> <action>Set {{current_sprint_status}} = "no-sprint-tracking"</action>
</check> </check>
<!-- Capture baseline commit for code review -->
<check if="git is available">
<action>Capture current HEAD commit: `git rev-parse HEAD`</action>
<action>Store as {{baseline_commit}}</action>
<action>Write to story file Dev Agent Record: "**Baseline Commit:** {{baseline_commit}}"</action>
</check>
<check if="git is NOT available">
<action>Set {{baseline_commit}} = "NO_GIT"</action>
<action>Write to story file Dev Agent Record: "**Baseline Commit:** NO_GIT"</action>
</check>
</step> </step>
<step n="5" goal="Implement task following red-green-refactor cycle"> <step n="5" goal="Implement task following red-green-refactor cycle">