Compare commits
20 Commits
060d5562a4
...
b73670700b
| Author | SHA1 | Date |
|---|---|---|
|
|
b73670700b | |
|
|
5a16c3a102 | |
|
|
58e0b6a634 | |
|
|
2785d382d5 | |
|
|
551a2ccb53 | |
|
|
3fc411d9c9 | |
|
|
ec30b580e7 | |
|
|
9e6e991b53 | |
|
|
dbdaae1be7 | |
|
|
1636bd5a55 | |
|
|
53045d35b1 | |
|
|
b3643af6dc | |
|
|
4ba6e19303 | |
|
|
38ab12da85 | |
|
|
0ae6799cb6 | |
|
|
e479b4164c | |
|
|
71a1c325f7 | |
|
|
59c58b2e2c | |
|
|
18ac3c931a | |
|
|
8fc7db7b97 |
|
|
@ -13,6 +13,7 @@ These variables MUST be set in this step and available to all subsequent steps:
|
||||||
|
|
||||||
- `story_path` - Path to the story file being reviewed
|
- `story_path` - Path to the story file being reviewed
|
||||||
- `story_key` - Story identifier (e.g., "1-2-user-authentication")
|
- `story_key` - Story identifier (e.g., "1-2-user-authentication")
|
||||||
|
- `story_content` - Complete, unmodified file content from story_path (loaded in substep 2)
|
||||||
- `story_file_list` - Files claimed in story's Dev Agent Record → File List
|
- `story_file_list` - Files claimed in story's Dev Agent Record → File List
|
||||||
- `git_changed_files` - Files actually changed according to git
|
- `git_changed_files` - Files actually changed according to git
|
||||||
- `git_discrepancies` - Mismatches between `story_file_list` and `git_changed_files`
|
- `git_discrepancies` - Mismatches between `story_file_list` and `git_changed_files`
|
||||||
|
|
@ -27,13 +28,13 @@ Ask user: "Which story would you like to review?"
|
||||||
|
|
||||||
**Try input as direct file path first:**
|
**Try input as direct file path first:**
|
||||||
If input resolves to an existing file:
|
If input resolves to an existing file:
|
||||||
- Verify it's in `sprint_status` with status `review` or `done`
|
- Verify it's in {sprint_status} with status `review` or `done`
|
||||||
- If verified → set `story_path` to that file path
|
- If verified → set `story_path` to that file path
|
||||||
- If NOT verified → Warn user the file is not in sprint_status (or wrong status). Ask: "Continue anyway?"
|
- If NOT verified → Warn user the file is not in {sprint_status} (or wrong status). Ask: "Continue anyway?"
|
||||||
- If yes → set `story_path`
|
- If yes → set `story_path`
|
||||||
- If no → return to user prompt (ask "Which story would you like to review?" again)
|
- If no → return to user prompt (ask "Which story would you like to review?" again)
|
||||||
|
|
||||||
**Search sprint_status** (if input is not a direct file):
|
**Search {sprint_status}** (if input is not a direct file):
|
||||||
Search for stories with status `review` or `done`. Match by priority:
|
Search for stories with status `review` or `done`. Match by priority:
|
||||||
1. Story number resembles input closely enough (e.g., "1-2" matches "1 2", "1.2", "one dash two", "one two"; "1-32" matches "one thirty two"). Do NOT match if numbers differ (e.g., "1-33" does not match "1-32")
|
1. Story number resembles input closely enough (e.g., "1-2" matches "1 2", "1.2", "one dash two", "one two"; "1-32" matches "one thirty two"). Do NOT match if numbers differ (e.g., "1-33" does not match "1-32")
|
||||||
2. Exact story name/key (e.g., "1-2-user-auth-api")
|
2. Exact story name/key (e.g., "1-2-user-auth-api")
|
||||||
|
|
@ -47,50 +48,69 @@ Search for stories with status `review` or `done`. Match by priority:
|
||||||
|
|
||||||
### 2. Load Story File
|
### 2. Load Story File
|
||||||
|
|
||||||
- Read COMPLETE story file from {story_path}
|
**Load file content:**
|
||||||
- Extract `story_key` from filename (e.g., "1-2-user-authentication.md" → "1-2-user-authentication") or story metadata
|
Read the complete contents of {story_path} and assign to `story_content` WITHOUT filtering, truncating or summarizing. If {story_path} cannot be read, is empty, or obviously doesn't have the story: report the error to the user and HALT the workflow.
|
||||||
|
|
||||||
### 3. Parse Story Sections
|
**Extract story identifier:**
|
||||||
|
Verify the filename ends with `.md` extension. Remove `.md` to get `story_key` (e.g., "1-2-user-authentication.md" → "1-2-user-authentication"). If filename doesn't end with `.md` or the result is empty: report the error to the user and HALT the workflow.
|
||||||
|
|
||||||
Extract and store:
|
### 3. Extract File List from Story
|
||||||
|
|
||||||
- **Story**: Title, description, status
|
Extract `story_file_list` from the Dev Agent Record → File List section of {story_content}.
|
||||||
- **Acceptance Criteria**: All ACs with their requirements
|
|
||||||
- **Tasks/Subtasks**: All tasks with completion status ([x] vs [ ])
|
|
||||||
- **Dev Agent Record → File List**: Claimed file changes
|
|
||||||
- **Change Log**: History of modifications
|
|
||||||
|
|
||||||
Set `story_file_list` = list of files from Dev Agent Record → File List
|
**If Dev Agent Record or File List section not found:** Report to user and set `story_file_list` = NO_FILE_LIST.
|
||||||
|
|
||||||
### 4. Discover Git Changes
|
### 4. Discover Git Changes
|
||||||
|
|
||||||
Check if git repository exists.
|
Check if git repository exists.
|
||||||
|
|
||||||
**If NOT a git repo:** Set `git_changed_files` = NO_GIT, `git_discrepancies` = NO_GIT. Skip to substep 6.
|
**If NOT a git repo:** Set `git_changed_files` = NO_GIT, `git_discrepancies` = NO_GIT. Skip to substep 5.
|
||||||
|
|
||||||
**If git repo detected:**
|
**If git repo detected:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git status --porcelain
|
git status --porcelain
|
||||||
git diff --name-only
|
git diff -M --name-only
|
||||||
git diff --cached --name-only
|
git diff -M --cached --name-only
|
||||||
```
|
```
|
||||||
|
|
||||||
Compile `git_changed_files` = union of modified, staged, and new files.
|
If any git command fails: Report the error to the user and HALT the workflow.
|
||||||
|
|
||||||
|
Compile `git_changed_files` = union of modified, staged, new, deleted, and renamed files.
|
||||||
|
|
||||||
### 5. Cross-Reference Story vs Git
|
### 5. Cross-Reference Story vs Git
|
||||||
|
|
||||||
Compare {story_file_list} with {git_changed_files}:
|
**If {git_changed_files} is empty:**
|
||||||
|
|
||||||
|
Ask user: "No git changes detected. Continue anyway?"
|
||||||
|
|
||||||
|
- If **no**: HALT the workflow
|
||||||
|
- If **yes**: Continue to comparison
|
||||||
|
|
||||||
|
**Compare {story_file_list} with {git_changed_files}:**
|
||||||
|
|
||||||
|
Exclude git-ignored files from the comparison (run `git check-ignore` if needed).
|
||||||
|
|
||||||
Set `git_discrepancies` with categories:
|
Set `git_discrepancies` with categories:
|
||||||
|
|
||||||
- **files_in_git_not_story**: Files changed in git but not in story File List
|
- **files_in_git_not_story**: Files changed in git but not in story File List
|
||||||
- **files_in_story_not_git**: Files in story File List but no git changes
|
- **files_in_story_not_git**: Files in story File List but no git changes (excluding git-ignored)
|
||||||
- **uncommitted_undocumented**: Uncommitted changes not tracked in story
|
- **uncommitted_undocumented**: Uncommitted changes not tracked in story
|
||||||
|
|
||||||
### 6. Load Project Context
|
---
|
||||||
|
|
||||||
- Load {project_context} if exists (**/project-context.md) for coding standards
|
## COMPLETION CHECKLIST
|
||||||
|
|
||||||
|
Before proceeding to the next step, verify ALL of the following:
|
||||||
|
|
||||||
|
- `story_path` identified and loaded
|
||||||
|
- `story_key` extracted
|
||||||
|
- `story_content` captured completely and unmodified
|
||||||
|
- `story_file_list` compiled from Dev Agent Record (or NO_FILE_LIST if not found)
|
||||||
|
- `git_changed_files` discovered via git commands (or NO_GIT if not a git repo)
|
||||||
|
- `git_discrepancies` calculated
|
||||||
|
|
||||||
|
**If any criterion is not met:** Report to the user and HALT the workflow.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -100,24 +120,3 @@ Set `git_discrepancies` with categories:
|
||||||
|
|
||||||
"**NEXT:** Loading `step-02-build-attack-plan.md`"
|
"**NEXT:** Loading `step-02-build-attack-plan.md`"
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## SUCCESS METRICS
|
|
||||||
|
|
||||||
- `story_path` identified and loaded
|
|
||||||
- `story_key` extracted
|
|
||||||
- All story sections parsed
|
|
||||||
- `story_file_list` compiled from Dev Agent Record
|
|
||||||
- `git_changed_files` discovered via git commands
|
|
||||||
- `git_discrepancies` calculated
|
|
||||||
- `project_context` loaded if exists
|
|
||||||
- Explicit NEXT directive provided
|
|
||||||
|
|
||||||
## FAILURE MODES
|
|
||||||
|
|
||||||
- Proceeding without story file loaded
|
|
||||||
- Missing `story_key` extraction
|
|
||||||
- Not parsing all story sections
|
|
||||||
- Skipping git change discovery
|
|
||||||
- Not calculating discrepancies
|
|
||||||
- No explicit NEXT directive at step completion
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue