feat(dev-story): capture baseline commit for code-review diff
This commit is contained in:
parent
6d1d7d0e72
commit
f5d949b922
|
|
@ -22,13 +22,14 @@ nextStepFile: '{workflow_path}/steps/step-05-consolidate-findings.md'
|
|||
From previous steps:
|
||||
|
||||
- `{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
|
||||
|
||||
---
|
||||
|
||||
## STATE VARIABLE (capture now)
|
||||
|
||||
- `{baseline_commit}` - From story file Dev Agent Record
|
||||
- `{diff_output}` - Complete diff of changes
|
||||
- `{asymmetric_findings}` - Findings from adversarial review
|
||||
|
||||
|
|
@ -40,29 +41,29 @@ From previous steps:
|
|||
|
||||
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
|
||||
git diff
|
||||
git diff --cached
|
||||
git diff {baseline_commit} -- ':!{implementation_artifacts}'
|
||||
```
|
||||
|
||||
If story work is already committed, find story-related commits:
|
||||
This captures all changes (committed + uncommitted) since dev-story started.
|
||||
|
||||
```bash
|
||||
# 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}
|
||||
```
|
||||
**Step 1c: Fallback (no baseline)**
|
||||
|
||||
Then construct diff:
|
||||
If no baseline available, review current state of files in `{file_list}`:
|
||||
|
||||
```bash
|
||||
git diff {first_story_commit}^..HEAD -- {files}
|
||||
```
|
||||
- Read each file listed in the story's File List section
|
||||
- Review as full file content (not a diff)
|
||||
|
||||
**Include in `{diff_output}`:**
|
||||
|
||||
|
|
|
|||
|
|
@ -219,6 +219,17 @@
|
|||
<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>
|
||||
</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 n="5" goal="Implement task following red-green-refactor cycle">
|
||||
|
|
|
|||
Loading…
Reference in New Issue