From 6e02497dcb144cc53d93bf85607d3d0ceb664471 Mon Sep 17 00:00:00 2001 From: Jonah Schulte Date: Tue, 27 Jan 2026 00:40:52 -0500 Subject: [PATCH] refactor: delete old validate-* workflows (replaced by unified validate) --- .../validate-all-epics/instructions.xml | 158 ------- .../validate-all-epics/workflow.yaml | 30 -- .../instructions.xml | 338 -------------- .../validate-all-stories-deep/workflow.yaml | 36 -- .../validate-all-stories/instructions.xml | 411 ------------------ .../validate-all-stories/workflow.yaml | 36 -- .../validate-epic-status/instructions.xml | 302 ------------- .../validate-epic-status/workflow.yaml | 34 -- .../validate-story-deep/instructions.xml | 370 ---------------- .../validate-story-deep/workflow.yaml | 29 -- .../validate-story/instructions.xml | 395 ----------------- .../validate-story/workflow.yaml | 29 -- .../validate-all-epics/instructions.xml | 158 ------- .../validate-all-epics/workflow.yaml | 30 -- .../instructions.xml | 338 -------------- .../validate-all-stories-deep/workflow.yaml | 36 -- .../validate-all-stories/instructions.xml | 411 ------------------ .../validate-all-stories/workflow.yaml | 36 -- .../validate-epic-status/instructions.xml | 302 ------------- .../validate-epic-status/workflow.yaml | 34 -- .../validate-story-deep/instructions.xml | 370 ---------------- .../validate-story-deep/workflow.yaml | 29 -- .../validate-story/instructions.xml | 395 ----------------- .../validate-story/workflow.yaml | 29 -- 24 files changed, 4336 deletions(-) delete mode 100644 src/bmm/workflows/4-implementation/validate-all-epics/instructions.xml delete mode 100644 src/bmm/workflows/4-implementation/validate-all-epics/workflow.yaml delete mode 100644 src/bmm/workflows/4-implementation/validate-all-stories-deep/instructions.xml delete mode 100644 src/bmm/workflows/4-implementation/validate-all-stories-deep/workflow.yaml delete mode 100644 src/bmm/workflows/4-implementation/validate-all-stories/instructions.xml delete mode 100644 src/bmm/workflows/4-implementation/validate-all-stories/workflow.yaml delete mode 100644 src/bmm/workflows/4-implementation/validate-epic-status/instructions.xml delete mode 100644 src/bmm/workflows/4-implementation/validate-epic-status/workflow.yaml delete mode 100644 src/bmm/workflows/4-implementation/validate-story-deep/instructions.xml delete mode 100644 src/bmm/workflows/4-implementation/validate-story-deep/workflow.yaml delete mode 100644 src/bmm/workflows/4-implementation/validate-story/instructions.xml delete mode 100644 src/bmm/workflows/4-implementation/validate-story/workflow.yaml delete mode 100644 src/modules/bmm/workflows/4-implementation/validate-all-epics/instructions.xml delete mode 100644 src/modules/bmm/workflows/4-implementation/validate-all-epics/workflow.yaml delete mode 100644 src/modules/bmm/workflows/4-implementation/validate-all-stories-deep/instructions.xml delete mode 100644 src/modules/bmm/workflows/4-implementation/validate-all-stories-deep/workflow.yaml delete mode 100644 src/modules/bmm/workflows/4-implementation/validate-all-stories/instructions.xml delete mode 100644 src/modules/bmm/workflows/4-implementation/validate-all-stories/workflow.yaml delete mode 100644 src/modules/bmm/workflows/4-implementation/validate-epic-status/instructions.xml delete mode 100644 src/modules/bmm/workflows/4-implementation/validate-epic-status/workflow.yaml delete mode 100644 src/modules/bmm/workflows/4-implementation/validate-story-deep/instructions.xml delete mode 100644 src/modules/bmm/workflows/4-implementation/validate-story-deep/workflow.yaml delete mode 100644 src/modules/bmm/workflows/4-implementation/validate-story/instructions.xml delete mode 100644 src/modules/bmm/workflows/4-implementation/validate-story/workflow.yaml diff --git a/src/bmm/workflows/4-implementation/validate-all-epics/instructions.xml b/src/bmm/workflows/4-implementation/validate-all-epics/instructions.xml deleted file mode 100644 index d0969730..00000000 --- a/src/bmm/workflows/4-implementation/validate-all-epics/instructions.xml +++ /dev/null @@ -1,158 +0,0 @@ - - The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - You MUST have already loaded and processed: {installed_path}/workflow.yaml - This validates EVERY epic in the project - comprehensive health check - - - Load {{sprint_status_file}} - - - ❌ sprint-status.yaml not found - -Run /bmad:bmm:workflows:sprint-planning first. - - HALT - - - Parse development_status section - Extract all epic keys (entries starting with "epic-") - Filter out retrospectives (ending with "-retrospective") - Store as {{epic_list}} - - 🔍 **Comprehensive Epic Validation** - -Found {{epic_count}} epics to validate: -{{#each epic_list}} - - {{this}} -{{/each}} - -Starting validation... - - - - - Run validate-epic-status for EACH epic - - Initialize counters: - - total_stories_scanned = 0 - - total_valid_stories = 0 - - total_invalid_stories = 0 - - total_updates_applied = 0 - - epics_validated = [] - - - - Set {{current_epic}} = current loop item - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Validating {{current_epic}}... -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - - - Execute validation script: - python3 scripts/lib/sprint-status-updater.py --epic {{current_epic}} --mode validate - - - Parse script output: - - Story count - - Valid/invalid/missing counts - - Inferred statuses - - Updates needed - - - - Execute fix script: - python3 scripts/lib/sprint-status-updater.py --epic {{current_epic}} --mode fix - - - Count updates applied - Add to total_updates_applied - - - Store validation results for {{current_epic}} - Increment totals - - ✓ {{current_epic}}: {{story_count}} stories, {{valid_count}} valid, {{updates_applied}} updates - - - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -All Epics Validated -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - - - - -📊 **COMPREHENSIVE VALIDATION RESULTS** - -**Epics Validated:** {{epic_count}} - -**Stories Analyzed:** {{total_stories_scanned}} - Valid: {{total_valid_stories}} (>=10KB, >=5 tasks) - Invalid: {{total_invalid_stories}} (<10KB or <5 tasks) - Missing: {{total_missing_files}} - -**Updates Applied:** {{total_updates_applied}} - -**Epic Status Summary:** -{{#each_epic_with_status}} - {{epic_key}}: {{status}} ({{done_count}}/{{total_count}} done) -{{/each}} - -**Top Issues:** -{{#if_invalid_stories_exist}} - âš ī¸ {{total_invalid_stories}} stories need regeneration (/create-story) -{{/if}} -{{#if_missing_files_exist}} - âš ī¸ {{total_missing_files}} story files missing (create or remove from sprint-status.yaml) -{{/if}} -{{#if_conflicting_evidence}} - âš ī¸ {{conflict_count}} stories have conflicting evidence (manual review) -{{/if}} - -**Health Score:** {{health_score}}/100 - (100 = perfect, all stories valid with correct status) - - - Write comprehensive report to {{default_output_file}} - - 💾 Full report: {{default_output_file}} - - - - -đŸŽ¯ **RECOMMENDED ACTIONS** - -{{#if_health_score_lt_80}} -**Priority 1: Fix Invalid Stories ({{total_invalid_stories}})** -{{#each_invalid_story}} - /create-story-with-gap-analysis # Regenerate {{story_id}} -{{/each}} -{{/if}} - -{{#if_missing_files_gt_0}} -**Priority 2: Create Missing Story Files ({{total_missing_files}})** -{{#each_missing}} - /create-story # Create {{story_id}} -{{/each}} -{{/if}} - -{{#if_health_score_gte_80}} -✅ **Sprint status is healthy!** - -Continue with normal development: - /sprint-status # Check what's next -{{/if}} - -**Maintenance:** - - Run /validate-all-epics weekly to catch drift - - After autonomous work, run validation - - Before sprint reviews, validate status accuracy - - - - diff --git a/src/bmm/workflows/4-implementation/validate-all-epics/workflow.yaml b/src/bmm/workflows/4-implementation/validate-all-epics/workflow.yaml deleted file mode 100644 index 4b3109e5..00000000 --- a/src/bmm/workflows/4-implementation/validate-all-epics/workflow.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: validate-all-epics -description: "Validate and fix sprint-status.yaml for ALL epics. Runs validate-epic-status on every epic in parallel, consolidates results, rebuilds accurate sprint-status.yaml." -author: "BMad" -version: "1.0.0" - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -implementation_artifacts: "{config_source}:implementation_artifacts" -story_dir: "{implementation_artifacts}" - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-all-epics" -instructions: "{installed_path}/instructions.xml" - -# Variables -variables: - sprint_status_file: "{implementation_artifacts}/sprint-status.yaml" - validation_mode: "fix" # Options: "report-only", "fix" - parallel_validation: true # Validate epics in parallel for speed - -# Sub-workflow -validate_epic_workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-epic-status/workflow.yaml" - -# Output -default_output_file: "{story_dir}/.all-epics-validation-report.md" - -standalone: true -web_bundle: false diff --git a/src/bmm/workflows/4-implementation/validate-all-stories-deep/instructions.xml b/src/bmm/workflows/4-implementation/validate-all-stories-deep/instructions.xml deleted file mode 100644 index 4f73b8d7..00000000 --- a/src/bmm/workflows/4-implementation/validate-all-stories-deep/instructions.xml +++ /dev/null @@ -1,338 +0,0 @@ - - The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - You MUST have already loaded and processed: {installed_path}/workflow.yaml - This is the COMPREHENSIVE AUDIT - validates all stories using Haiku agents - Cost: ~$76 for 511 stories with Haiku (vs $793 with Sonnet) - - - Find all .md files in {{story_dir}} - - Filter out meta-documents: - - Files starting with "EPIC-" (completion reports) - - Files starting with "." (progress files) - - Files containing: COMPLETION, SUMMARY, REPORT, SESSION-, REVIEW-, README, INDEX - - Files like "atdd-checklist-", "gap-analysis-", "review-" - - - - Filter to stories matching: {{epic_filter}}-*.md - - - Store as {{story_list}} - Count {{story_count}} - - 🔍 **Comprehensive Story Audit** - -{{#if epic_filter}}**Epic Filter:** {{epic_filter}}{{else}}**Scope:** All epics{{/if}} -**Stories to Validate:** {{story_count}} -**Agent Model:** Haiku 4.5 -**Batch Size:** {{batch_size}} - -**Estimated Cost:** ~${{estimated_cost}} ({{story_count}} × $0.15/story) -**Estimated Time:** {{estimated_hours}} hours - -Starting batch validation... - - - - - Initialize counters: - - stories_validated = 0 - - verified_complete = 0 - - needs_rework = 0 - - false_positives = 0 - - in_progress = 0 - - total_false_positive_tasks = 0 - - total_critical_issues = 0 - - - Split {{story_list}} into batches of {{batch_size}} - - - Set {{current_batch}} = current batch - Set {{batch_number}} = loop index + 1 - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Batch {{batch_number}}/{{total_batches}} ({{batch_size}} stories) -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - - - - Set {{story_file}} = current story path - Extract {{story_id}} from filename - - {{stories_validated + 1}}/{{story_count}}: Validating {{story_id}}... - - - - - - - Parse validation results: - - category (VERIFIED_COMPLETE, FALSE_POSITIVE, etc.) - - verification_score - - false_positive_count - - false_negative_count - - critical_issues_count - - - Store results for {{story_id}} - Increment counters based on category - - → {{category}} (Score: {{verification_score}}/100{{#if false_positives > 0}}, {{false_positives}} false positives{{/if}}) - - Increment stories_validated - - - Batch {{batch_number}} complete. {{stories_validated}}/{{story_count}} total validated. - - - Write progress to {{progress_file}}: - - stories_validated - - current_batch - - results_so_far - - - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -All Stories Validated -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -**Total Validated:** {{story_count}} -**Total Tasks Checked:** {{total_tasks_verified}} - - - - - Calculate platform-wide metrics: - - Overall health score: (verified_complete / story_count) × 100 - - False positive rate: (false_positive_stories / story_count) × 100 - - Total rework estimate: false_positive_stories × 3h + needs_rework × 2h - - - Group results by epic - - Identify worst offenders (highest false positive rates) - - -📊 **PLATFORM HEALTH ASSESSMENT** - -**Overall Health Score:** {{health_score}}/100 - -**Story Categories:** -- ✅ VERIFIED_COMPLETE: {{verified_complete}} ({{verified_complete_pct}}%) -- âš ī¸ NEEDS_REWORK: {{needs_rework}} ({{needs_rework_pct}}%) -- ❌ FALSE_POSITIVES: {{false_positives}} ({{false_positives_pct}}%) -- 🔄 IN_PROGRESS: {{in_progress}} ({{in_progress_pct}}%) - -**Task-Level Issues:** -- False positive tasks: {{total_false_positive_tasks}} -- CRITICAL code quality issues: {{total_critical_issues}} - -**Estimated Rework:** {{total_rework_hours}} hours - -**Epic Breakdown:** -{{#each epic_summary}} -- Epic {{this.epic}}: {{this.health_score}}/100 ({{this.false_positives}} false positives) -{{/each}} - -**Worst Offenders (Most False Positives):** -{{#each worst_offenders limit=10}} -- {{this.story_id}}: {{this.false_positive_count}} tasks, score {{this.score}}/100 -{{/each}} - - - - - -# Comprehensive Platform Audit Report - -**Generated:** {{date}} -**Stories Validated:** {{story_count}} -**Agent Model:** Haiku 4.5 -**Total Cost:** ~${{actual_cost}} - ---- - -## Executive Summary - -**Platform Health Score:** {{health_score}}/100 - -{{#if health_score >= 90}} -✅ **EXCELLENT** - Platform is production-ready with high confidence -{{else if health_score >= 75}} -âš ī¸ **GOOD** - Minor issues to address, generally solid -{{else if health_score >= 60}} -âš ī¸ **NEEDS WORK** - Significant rework required before production -{{else}} -❌ **CRITICAL** - Major quality issues found, not production-ready -{{/if}} - -**Key Findings:** -- {{verified_complete}} stories verified complete ({{verified_complete_pct}}%) -- {{false_positives}} stories are false positives ({{false_positives_pct}}%) -- {{total_false_positive_tasks}} tasks claimed done but not implemented -- {{total_critical_issues}} CRITICAL code quality issues found - ---- - -## ❌ False Positive Stories ({{false_positives}} total) - -**These stories are marked "done" but have significant missing/stubbed code:** - -{{#each false_positive_stories}} -### {{this.story_id}} (Score: {{this.score}}/100) - -**Current Status:** {{this.current_status}} -**Should Be:** in-progress or ready-for-dev - -**Missing/Stubbed:** -{{#each this.false_positive_tasks}} -- {{this.task}} - - {{this.evidence}} -{{/each}} - -**Estimated Fix:** {{this.estimated_hours}}h - ---- -{{/each}} - -**Total Rework:** {{false_positive_rework_hours}} hours - ---- - -## âš ī¸ Stories Needing Rework ({{needs_rework}} total) - -{{#each needs_rework_stories}} -### {{this.story_id}} (Score: {{this.score}}/100) - -**Issues:** -- {{this.false_positive_count}} incomplete tasks -- {{this.critical_issues}} CRITICAL quality issues -- {{this.high_issues}} HIGH priority issues - -**Top Issues:** -{{#each this.top_issues limit=5}} -- {{this}} -{{/each}} - ---- -{{/each}} - -**Total Rework:** {{needs_rework_hours}} hours - ---- - -## ✅ Verified Complete Stories ({{verified_complete}} total) - -**These stories are production-ready with verified code:** - -{{#each verified_complete_stories}} -- {{this.story_id}} ({{this.score}}/100) -{{/each}} - ---- - -## 📊 Epic Health Breakdown - -{{#each epic_summary}} -### Epic {{this.epic}} - -**Stories:** {{this.total}} -**Verified Complete:** {{this.verified}} ({{this.verified_pct}}%) -**False Positives:** {{this.false_positives}} -**Needs Rework:** {{this.needs_rework}} - -**Health Score:** {{this.health_score}}/100 - -{{#if this.health_score < 70}} -âš ī¸ **ATTENTION NEEDED** - This epic has quality issues -{{/if}} - -**Top Issues:** -{{#each this.top_issues limit=3}} -- {{this}} -{{/each}} - ---- -{{/each}} - ---- - -## đŸŽ¯ Recommended Action Plan - -### Phase 1: Fix False Positives (CRITICAL - {{false_positive_rework_hours}}h) - -{{#each false_positive_stories limit=20}} -{{@index + 1}}. **{{this.story_id}}** ({{this.estimated_hours}}h) - - {{this.false_positive_count}} tasks to implement - - Update status to in-progress -{{/each}} - -{{#if false_positives > 20}} -... and {{false_positives - 20}} more (see full list above) -{{/if}} - -### Phase 2: Address Rework Items (HIGH - {{needs_rework_hours}}h) - -{{#each needs_rework_stories limit=10}} -{{@index + 1}}. **{{this.story_id}}** ({{this.estimated_hours}}h) - - Fix {{this.critical_issues}} CRITICAL issues - - Complete {{this.false_positive_count}} tasks -{{/each}} - -### Phase 3: Fix False Negatives (LOW - batch update) - -- {{total_false_negative_tasks}} unchecked tasks that are actually complete -- Can batch update checkboxes (low priority) - ---- - -## 💰 Audit Cost Analysis - -**This Validation Run:** -- Stories validated: {{story_count}} -- Agent sessions: {{story_count}} (one Haiku agent per story) -- Tokens used: ~{{tokens_used_millions}}M -- Cost: ~${{actual_cost}} - -**Remediation Cost:** -- Estimated hours: {{total_rework_hours}}h -- At AI velocity: {{ai_velocity_days}} days of work -- Token cost: ~${{remediation_token_cost}} - -**Total Investment:** ${{actual_cost}} (audit) + ${{remediation_token_cost}} (fixes) = ${{total_cost}} - ---- - -## 📅 Next Steps - -1. **Immediate:** Fix {{false_positives}} false positive stories -2. **This Week:** Address {{total_critical_issues}} CRITICAL issues -3. **Next Week:** Rework {{needs_rework}} stories -4. **Ongoing:** Re-validate fixed stories to confirm - -**Commands:** -```bash -# Validate specific story -/validate-story-deep docs/sprint-artifacts/16e-6-ecs-task-definitions-tier3.md - -# Validate specific epic -/validate-all-stories-deep --epic 16e - -# Re-run full audit (after fixes) -/validate-all-stories-deep -``` - ---- - -**Report Generated By:** validate-all-stories-deep workflow -**Validation Method:** LLM-powered (Haiku 4.5 agents read actual code) -**Confidence Level:** Very High (code-based verification, not regex patterns) - - - - diff --git a/src/bmm/workflows/4-implementation/validate-all-stories-deep/workflow.yaml b/src/bmm/workflows/4-implementation/validate-all-stories-deep/workflow.yaml deleted file mode 100644 index 76f00357..00000000 --- a/src/bmm/workflows/4-implementation/validate-all-stories-deep/workflow.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: validate-all-stories-deep -description: "Comprehensive platform audit using Haiku agents. Validates ALL stories by reading actual code. The bulletproof validation for production readiness." -author: "BMad" -version: "1.0.0" - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -implementation_artifacts: "{config_source}:implementation_artifacts" -story_dir: "{implementation_artifacts}" - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-all-stories-deep" -instructions: "{installed_path}/instructions.xml" - -# Input variables -variables: - epic_filter: "" # Optional: Only validate specific epic (e.g., "16e") - batch_size: 5 # Validate 5 stories at a time (prevents spawning 511 agents at once!) - concurrent_limit: 5 # Max 5 agents running concurrently - auto_fix: false # If true, auto-update statuses based on validation - pause_between_batches: 30 # Seconds to wait between batches (rate limiting) - -# Sub-workflow -validate_story_workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-story-deep/workflow.yaml" - -# Agent configuration -agent_model: "haiku" # Cost: ~$66 for 511 stories vs $793 with Sonnet - -# Output -default_output_file: "{story_dir}/.comprehensive-audit-{date}.md" -progress_file: "{story_dir}/.validation-progress-{date}.yaml" - -standalone: true -web_bundle: false diff --git a/src/bmm/workflows/4-implementation/validate-all-stories/instructions.xml b/src/bmm/workflows/4-implementation/validate-all-stories/instructions.xml deleted file mode 100644 index 432e6e6f..00000000 --- a/src/bmm/workflows/4-implementation/validate-all-stories/instructions.xml +++ /dev/null @@ -1,411 +0,0 @@ - - The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - You MUST have already loaded and processed: {installed_path}/workflow.yaml - This is the COMPREHENSIVE AUDIT - validates every story's tasks against actual codebase - - - Find all story files in {{story_dir}} - Filter out meta-documents: - - Files starting with "EPIC-" (completion reports) - - Files with "COMPLETION", "SUMMARY", "REPORT" in name - - Files starting with "." (hidden progress files) - - Files like "README", "INDEX", "SESSION-", "REVIEW-" - - - - Filter to stories starting with {{epic_filter}}- (e.g., "16e-") - - - Store as {{story_list}} - Count {{story_count}} - - 🔍 **Comprehensive Story Validation** - -{{#if epic_filter}} -**Epic Filter:** {{epic_filter}} only -{{/if}} -**Stories to Validate:** {{story_count}} -**Validation Depth:** {{validation_depth}} -**Parallel Mode:** {{parallel_validation}} - -**Estimated Time:** {{estimated_minutes}} minutes -**Estimated Cost:** ~${{estimated_cost}} ({{story_count}} × ~$0.50/story) - -This will: -1. Verify all tasks against actual codebase (task-verification-engine.py) -2. Run code quality reviews on files with issues -3. Check for regressions and integration failures -4. Categorize stories: VERIFIED_COMPLETE, NEEDS_REWORK, FALSE_POSITIVE, etc. -5. Generate comprehensive audit report - -Starting validation... - - - - - Initialize counters: - - stories_validated = 0 - - verified_complete = 0 - - needs_rework = 0 - - false_positives = 0 - - in_progress = 0 - - total_false_positive_tasks = 0 - - total_tasks_verified = 0 - - - - Set {{current_story}} = current story file - Extract {{story_id}} from filename - - Validating {{counter}}/{{story_count}}: {{story_id}}... - - - Execute: python3 {{task_verification_script}} {{current_story}} - - Parse output: - - total_tasks - - checked_tasks - - false_positives - - false_negatives - - verification_score - - task_details (with evidence) - - - Categorize story: - IF verification_score >= 95 AND false_positives == 0 - → category = "VERIFIED_COMPLETE" - ELSE IF verification_score >= 80 AND false_positives <= 2 - → category = "COMPLETE_WITH_MINOR_ISSUES" - ELSE IF false_positives > 5 OR verification_score < 50 - → category = "FALSE_POSITIVE" (claimed done but missing code) - ELSE IF verification_score < 80 - → category = "NEEDS_REWORK" - ELSE IF checked_tasks == 0 - → category = "NOT_STARTED" - ELSE - → category = "IN_PROGRESS" - - - Store result: - - story_id - - verification_score - - category - - false_positive_count - - false_negative_count - - current_status (from sprint-status.yaml) - - recommended_status - - - Increment counters based on category - Add false_positive_count to total - Add total_tasks to total_tasks_verified - - → {{category}} ({{verification_score}}/100, {{false_positives}} false positives) - - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Validation Complete -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -**Stories Validated:** {{story_count}} -**Total Tasks Verified:** {{total_tasks_verified}} -**Total False Positives:** {{total_false_positive_tasks}} - - - - - Filter stories where: - - category = "FALSE_POSITIVE" OR - - category = "NEEDS_REWORK" OR - - false_positives > 3 - - - Count {{problem_story_count}} - - - -đŸ›Ąī¸ **Code Quality Review** - -Found {{problem_story_count}} stories with quality issues. -Running multi-agent review on files from these stories... - - - - Extract file list from story Dev Agent Record - - - Run /multi-agent-review on files: - - Security audit - - Silent failure detection - - Architecture compliance - - Type safety check - - - Categorize review findings by severity - Add to story's issue list - - - - - - ✅ No problem stories found - all code quality looks good! - - - - - -🔗 **Integration Verification** - -Checking for regressions and broken dependencies... - - - For stories marked "VERIFIED_COMPLETE": - 1. Extract service dependencies from story - 2. Check if dependent services still exist - 3. Run integration tests if they exist - 4. Check for API contract breaking changes - - - Detect overlaps: - - Multiple stories implementing same feature - - Duplicate files created - - Conflicting implementations - - - -**Regressions Found:** {{regression_count}} -**Overlaps Detected:** {{overlap_count}} -**Integration Tests:** {{integration_tests_run}} ({{integration_tests_passing}} passing) - - - - - -# Comprehensive Story Validation Report - -**Generated:** {{date}} -**Stories Validated:** {{story_count}} -**Validation Depth:** {{validation_depth}} -**Epic Filter:** {{epic_filter}} {{#if_no_filter}}(all epics){{/if}} - ---- - -## Executive Summary - -**Overall Health Score:** {{overall_health_score}}/100 - -**Story Categories:** -- ✅ **VERIFIED_COMPLETE:** {{verified_complete}} ({{verified_complete_pct}}%) -- âš ī¸ **NEEDS_REWORK:** {{needs_rework}} ({{needs_rework_pct}}%) -- ❌ **FALSE_POSITIVES:** {{false_positives}} ({{false_positives_pct}}%) -- 🔄 **IN_PROGRESS:** {{in_progress}} ({{in_progress_pct}}%) -- 📋 **NOT_STARTED:** {{not_started}} ({{not_started_pct}}%) - -**Task Verification:** -- Total tasks verified: {{total_tasks_verified}} -- False positive tasks: {{total_false_positive_tasks}} ({{false_positive_rate}}%) -- False negative tasks: {{total_false_negative_tasks}} - -**Code Quality:** -- CRITICAL issues: {{critical_issues_total}} -- HIGH issues: {{high_issues_total}} -- Files reviewed: {{files_reviewed}} - ---- - -## ❌ False Positive Stories (Claimed Done, Not Implemented) - -{{#each false_positive_stories}} -### {{this.story_id}} (Score: {{this.verification_score}}/100) - -**Current Status:** {{this.current_status}} -**Recommended:** in-progress or ready-for-dev - -**Issues:** -{{#each this.false_positive_tasks}} -- [ ] {{this.task}} - - Evidence: {{this.evidence}} -{{/each}} - -**Action Required:** -- Uncheck {{this.false_positive_count}} tasks -- Implement missing code -- Update sprint-status.yaml to in-progress -{{/each}} - -**Total:** {{false_positive_stories_count}} stories - ---- - -## âš ī¸ Stories Needing Rework - -{{#each needs_rework_stories}} -### {{this.story_id}} (Score: {{this.verification_score}}/100) - -**Issues:** -- {{this.false_positive_count}} false positive tasks -- {{this.critical_issue_count}} CRITICAL code quality issues -- {{this.high_issue_count}} HIGH priority issues - -**Recommended:** -1. Fix CRITICAL issues first -2. Implement {{this.false_positive_count}} missing tasks -3. Re-run validation -{{/each}} - -**Total:** {{needs_rework_count}} stories - ---- - -## ✅ Verified Complete Stories - -{{#each verified_complete_stories}} -- {{this.story_id}} ({{this.verification_score}}/100) -{{/each}} - -**Total:** {{verified_complete_count}} stories (production-ready) - ---- - -## 📊 Epic Breakdown - -{{#each epic_summary}} -### Epic {{this.epic_num}} - -**Stories:** {{this.total_count}} -**Verified Complete:** {{this.verified_count}} ({{this.verified_pct}}%) -**False Positives:** {{this.false_positive_count}} -**Needs Rework:** {{this.needs_rework_count}} - -**Health Score:** {{this.health_score}}/100 -{{/each}} - ---- - -## đŸŽ¯ Recommended Actions - -### Immediate (CRITICAL) - -{{#if false_positive_stories_count > 0}} -**Fix {{false_positive_stories_count}} False Positive Stories:** - -{{#each false_positive_stories limit=10}} -1. {{this.story_id}}: Update status to in-progress, implement {{this.false_positive_count}} missing tasks -{{/each}} - -{{#if false_positive_stories_count > 10}} -... and {{false_positive_stories_count - 10}} more (see full list above) -{{/if}} -{{/if}} - -### Short-term (HIGH Priority) - -{{#if needs_rework_count > 0}} -**Address {{needs_rework_count}} Stories Needing Rework:** -- Fix {{critical_issues_total}} CRITICAL code quality issues -- Implement missing tasks -- Re-validate after fixes -{{/if}} - -### Maintenance (MEDIUM Priority) - -{{#if false_negative_count > 0}} -**Update {{false_negative_count}} False Negative Tasks:** -- Mark complete (code exists but checkbox unchecked) -- Low impact, can batch update -{{/if}} - ---- - -## 💰 Cost Analysis - -**Validation Run:** -- Stories validated: {{story_count}} -- API tokens used: ~{{tokens_used}}K -- Cost: ~${{cost}} - -**Remediation Estimate:** -- False positives: {{false_positive_stories_count}} × 3h = {{remediation_hours_fp}}h -- Needs rework: {{needs_rework_count}} × 2h = {{remediation_hours_rework}}h -- **Total:** {{total_remediation_hours}}h estimated work - ---- - -## 📅 Next Steps - -1. **Fix false positive stories** ({{false_positive_stories_count}} stories) -2. **Address CRITICAL issues** ({{critical_issues_total}} issues) -3. **Re-run validation** on fixed stories -4. **Update sprint-status.yaml** with verified statuses -5. **Run weekly validation** to prevent future drift - ---- - -**Generated by:** /validate-all-stories workflow -**Validation Engine:** task-verification-engine.py v2.0 -**Multi-Agent Review:** {{multi_agent_review_enabled}} - - - - - -🔧 **Auto-Fix Mode Enabled** - -Applying automatic fixes: -1. Update false negative checkboxes (code exists → mark [x]) -2. Update sprint-status.yaml with verified statuses -3. Add validation scores to story files - - - - Update story file: Change [ ] to [x] for verified tasks - ✓ {{story_id}}: Checked {{task_count}} false negative tasks - - - - Update sprint-status.yaml using sprint-status-updater.py - ✓ {{story_id}}: {{old_status}} → {{new_status}} - - - -✅ Auto-fix complete - - {{false_negatives_fixed}} tasks checked - - {{statuses_updated}} story statuses updated - - - - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -COMPREHENSIVE VALIDATION COMPLETE -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -**Overall Health:** {{overall_health_score}}/100 - -{{#if overall_health_score >= 90}} -✅ **EXCELLENT** - Platform is production-ready -{{else if overall_health_score >= 75}} -âš ī¸ **GOOD** - Minor issues to address before production -{{else if overall_health_score >= 60}} -âš ī¸ **NEEDS WORK** - Significant rework required -{{else}} -❌ **CRITICAL** - Major quality issues found -{{/if}} - -**Top Priorities:** -1. Fix {{false_positive_stories_count}} false positive stories -2. Address {{critical_issues_total}} CRITICAL code quality issues -3. Complete {{in_progress_count}} in-progress stories -4. Re-validate after fixes - -**Full Report:** {{default_output_file}} -**Summary JSON:** {{validation_summary_file}} - -**Next Command:** - /validate-story # Deep-dive on specific story - /validate-all-stories --epic 16e # Re-validate specific epic - - - - diff --git a/src/bmm/workflows/4-implementation/validate-all-stories/workflow.yaml b/src/bmm/workflows/4-implementation/validate-all-stories/workflow.yaml deleted file mode 100644 index 638890fc..00000000 --- a/src/bmm/workflows/4-implementation/validate-all-stories/workflow.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: validate-all-stories -description: "Comprehensive audit of ALL stories: verify tasks against codebase, run code quality reviews, check integrations. The bulletproof audit for production readiness." -author: "BMad" -version: "1.0.0" - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -implementation_artifacts: "{config_source}:implementation_artifacts" -story_dir: "{implementation_artifacts}" - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-all-stories" -instructions: "{installed_path}/instructions.xml" - -# Input variables -variables: - validation_depth: "deep" # Options: "quick" (tasks only), "deep" (tasks + review), "comprehensive" (full integration) - parallel_validation: true # Run story validations in parallel for speed - fix_mode: false # If true, auto-fix false negatives and update statuses - epic_filter: "" # Optional: Only validate stories from specific epic (e.g., "16e") - -# Tools -task_verification_script: "{project-root}/scripts/lib/task-verification-engine.py" -sprint_status_updater: "{project-root}/scripts/lib/sprint-status-updater.py" - -# Sub-workflow -validate_story_workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-story/workflow.yaml" - -# Output -default_output_file: "{story_dir}/.comprehensive-validation-report-{date}.md" -validation_summary_file: "{story_dir}/.validation-summary-{date}.json" - -standalone: true -web_bundle: false diff --git a/src/bmm/workflows/4-implementation/validate-epic-status/instructions.xml b/src/bmm/workflows/4-implementation/validate-epic-status/instructions.xml deleted file mode 100644 index 94b10823..00000000 --- a/src/bmm/workflows/4-implementation/validate-epic-status/instructions.xml +++ /dev/null @@ -1,302 +0,0 @@ - - The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - You MUST have already loaded and processed: {installed_path}/workflow.yaml - This is VALIDATION-ONLY mode - NO implementation, only status correction - Uses same logic as batch-super-dev but READS instead of WRITES code - - - Check if {{epic_num}} was provided - - - Which epic should I validate? (e.g., 19, 16d, 16e, 9b) - Store response as {{epic_num}} - - - Load {{sprint_status_file}} - - - ❌ sprint-status.yaml not found at: {{sprint_status_file}} - -Run /bmad:bmm:workflows:sprint-planning to create it first. - - HALT - - - Search for epic-{{epic_num}} entry in sprint_status_file - Extract all story entries for epic-{{epic_num}} (pattern: {{epic_num}}-*) - Count stories found in sprint-status.yaml for this epic - - 🔍 **Validating Epic {{epic_num}}** - -Found {{story_count}} stories in sprint-status.yaml -Scanning story files for REALITY check... - - - - - This is where we determine TRUTH - not from status fields, but from actual file analysis - - For each story in epic (from sprint-status.yaml): - 1. Build story file path: {{story_dir}}/{{story_key}}.md - 2. Check if file exists - 3. If exists, read FULL file - 4. Analyze file content - - - For each story file, extract: - - File size in KB - - Total task count (count all "- [ ]" and "- [x]" lines) - - Checked task count (count "- [x]" lines) - - Completion rate (checked / total * 100) - - Explicit Status: field (if present) - - Has proper BMAD structure (12 sections) - - Section count (count ## headings) - - - 📊 **Story File Quality Analysis** - -Analyzing {{story_count}} story files... - - - For each story, classify quality: - VALID: - - File size >= 10KB - - Total tasks >= 5 - - Has task list structure - - INVALID: - - File size < 10KB (incomplete story) - - Total tasks < 5 (not detailed enough) - - File missing entirely - - - Store results as {{story_quality_map}} - - Quality Summary: - Valid stories: {{valid_count}}/{{story_count}} - Invalid stories: {{invalid_count}} - Missing files: {{missing_count}} - - - - - Run git log to find commits mentioning epic stories: - Command: git log --oneline --since={{git_commit_lookback_days}} days ago - - - Parse commit messages for story IDs matching pattern: {{epic_num}}-\d+[a-z]? - Build map of story_id → commit_count - - Git Commit Evidence: - Stories with commits: {{stories_with_commits_count}} - Stories without commits: {{stories_without_commits_count}} - - - - - Search {{story_dir}} for files: - - .epic-{{epic_num}}-completion-report.md - - .batch-super-dev-{{epic_num}}-progress.yaml - - - - Parse completed_stories list from progress file OR - Parse ✅ story entries from completion report - Store as {{autonomous_completed_stories}} - - 📋 Autonomous Report Found: - {{autonomous_completed_count}} stories marked complete - - - - - â„šī¸ No autonomous completion report found (manual epic) - - - - - Use MULTIPLE sources of truth, not just Status: field - - For each story in epic, determine correct status using this logic: - - - Priority 1: Autonomous completion report - IF story in autonomous_completed_stories - → Status = "done" (VERY HIGH confidence) - - Priority 2: Task completion rate + file quality - IF completion_rate >= 90% AND file is VALID (>10KB, >5 tasks) - → Status = "done" (HIGH confidence) - - IF completion_rate 50-89% AND file is VALID - → Status = "in-progress" (MEDIUM confidence) - - IF completion_rate < 50% AND file is VALID - → Status = "ready-for-dev" (MEDIUM confidence) - - Priority 3: Explicit Status: field (if no other evidence) - IF Status: field exists AND matches above inferences - → Use it (MEDIUM confidence) - - IF Status: field conflicts with task completion - → Prefer task completion (tasks are ground truth) - - Priority 4: Git commits (supporting evidence) - IF 3+ commits + task completion >=90% - → Upgrade confidence to VERY HIGH - - IF 1-2 commits but task completion <50% - → Status = "in-progress" (work started but not done) - - Quality Gates: - IF file size < 10KB OR total tasks < 5 - → DOWNGRADE status (can't be "done" if file is incomplete) - → Mark as "ready-for-dev" (story needs proper creation) - → Flag for regeneration with /create-story - - Missing Files: - IF story file doesn't exist - → Status = "backlog" (story not created yet) - - - Build map of story_id → inferred_status with evidence and confidence - - 📊 **Status Inference Complete** - -Stories to update: -{{#each_story_needing_update}} - {{story_id}}: - Current: {{current_status_in_yaml}} - Inferred: {{inferred_status}} - Confidence: {{confidence}} - Evidence: {{evidence_summary}} - Quality: {{file_size_kb}}KB, {{total_tasks}} tasks, {{completion_rate}}% done -{{/each}} - - - - - - 📝 **REPORT-ONLY MODE** - No changes will be made - -Recommendations saved to: {{default_output_file}} - - Write detailed report to {{default_output_file}} - EXIT workflow - - - - 🔧 **FIX MODE** - Updating sprint-status.yaml... - -Backing up to: .sprint-status-backups/ - - - Create backup of {{sprint_status_file}} - For each story needing update: - 1. Find story entry in development_status section - 2. Update status to inferred_status - 3. Add comment: "✅ Validated {{date}} - {{evidence_summary}}" - 4. Preserve all other content and structure - - - Update epic-{{epic_num}} status based on story completion: - IF all stories have status "done" AND all are valid files - → epic status = "done" - - IF any stories "in-progress" OR "review" - → epic status = "in-progress" - - IF all stories "backlog" OR "ready-for-dev" - → epic status = "backlog" - - - Update last_verified timestamp in header - Save {{sprint_status_file}} - - ✅ **sprint-status.yaml Updated** - -Applied {{updates_count}} story status corrections -Epic {{epic_num}}: {{old_epic_status}} → {{new_epic_status}} - -Backup: {{backup_path}} - - - - - - Flag stories with issues: - - Missing story files (in sprint-status.yaml but no .md file) - - Invalid files (< 10KB or < 5 tasks) - - Conflicting evidence (Status: says done, tasks unchecked) - - Poor quality (no BMAD sections) - - - âš ī¸ **Problem Stories Requiring Attention:** - -{{#if_missing_files}} -**Missing Files ({{missing_count}}):** -{{#each_missing}} - - {{story_id}}: Referenced in sprint-status.yaml but file not found - Action: Run /create-story OR remove from sprint-status.yaml -{{/each}} -{{/if}} - -{{#if_invalid_quality}} -**Invalid Quality ({{invalid_count}}):** -{{#each_invalid}} - - {{story_id}}: {{file_size_kb}}KB, {{total_tasks}} tasks - Action: Regenerate with /create-story-with-gap-analysis -{{/each}} -{{/if}} - -{{#if_conflicting_evidence}} -**Conflicting Evidence ({{conflict_count}}):** -{{#each_conflict}} - - {{story_id}}: Status: says "{{status_field}}" but {{completion_rate}}% tasks checked - Action: Manual review recommended -{{/each}} -{{/if}} - - - - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Epic {{epic_num}} Validation Complete -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -**Epic Status:** {{epic_status}} - -**Stories:** - Done: {{done_count}} - In-Progress: {{in_progress_count}} - Review: {{review_count}} - Ready-for-Dev: {{ready_count}} - Backlog: {{backlog_count}} - -**Quality:** - Valid: {{valid_count}} (>=10KB, >=5 tasks) - Invalid: {{invalid_count}} (poor quality) - Missing: {{missing_count}} (file not found) - -**Updates Applied:** {{updates_count}} - -**Next Steps:** -{{#if_invalid_count_gt_0}} - 1. Regenerate {{invalid_count}} invalid stories with /create-story -{{/if}} -{{#if_missing_count_gt_0}} - 2. Create {{missing_count}} missing story files OR remove from sprint-status.yaml -{{/if}} -{{#if_done_count_eq_story_count}} - 3. Epic complete! Consider running /retrospective -{{/if}} -{{#if_in_progress_count_gt_0}} - 3. Continue with in-progress stories: /dev-story {{first_in_progress}} -{{/if}} - - - 💾 Detailed report saved to: {{default_output_file}} - - - diff --git a/src/bmm/workflows/4-implementation/validate-epic-status/workflow.yaml b/src/bmm/workflows/4-implementation/validate-epic-status/workflow.yaml deleted file mode 100644 index 620c0db2..00000000 --- a/src/bmm/workflows/4-implementation/validate-epic-status/workflow.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: validate-epic-status -description: "Validate and fix sprint-status.yaml for a single epic. Scans story files for task completion, validates quality (>10KB, proper tasks), checks git commits, updates sprint-status.yaml to match REALITY." -author: "BMad" -version: "1.0.0" - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -implementation_artifacts: "{config_source}:implementation_artifacts" -story_dir: "{implementation_artifacts}" - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-epic-status" -instructions: "{installed_path}/instructions.xml" - -# Inputs -variables: - epic_num: "" # User provides (e.g., "19", "16d", "16e") - sprint_status_file: "{implementation_artifacts}/sprint-status.yaml" - validation_mode: "fix" # Options: "report-only", "fix", "strict" - -# Validation criteria -validation_rules: - min_story_size_kb: 10 # Stories should be >= 10KB - min_tasks_required: 5 # Stories should have >= 5 tasks - completion_threshold: 90 # 90%+ tasks checked = "done" - git_commit_lookback_days: 30 # Search last 30 days for commits - -# Output -default_output_file: "{story_dir}/.epic-{epic_num}-validation-report.md" - -standalone: true -web_bundle: false diff --git a/src/bmm/workflows/4-implementation/validate-story-deep/instructions.xml b/src/bmm/workflows/4-implementation/validate-story-deep/instructions.xml deleted file mode 100644 index 7b9825f1..00000000 --- a/src/bmm/workflows/4-implementation/validate-story-deep/instructions.xml +++ /dev/null @@ -1,370 +0,0 @@ - - The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - You MUST have already loaded and processed: {installed_path}/workflow.yaml - This uses HAIKU AGENTS to read actual code and verify task completion - NOT regex patterns - - - Load story file from {{story_file}} - - - ❌ Story file not found: {{story_file}} - HALT - - - Extract story metadata: - - Story ID from filename - - Epic number from "Epic:" field - - Current status from "Status:" or "**Status:**" field - - Files created/modified from Dev Agent Record section - - - Extract ALL tasks (pattern: "- [ ]" or "- [x]"): - - Parse checkbox state (checked/unchecked) - - Extract task text - - Count total, checked, unchecked - - - 📋 **Deep Story Validation: {{story_id}}** - -**Epic:** {{epic_num}} -**Current Status:** {{current_status}} -**Tasks:** {{checked_count}}/{{total_count}} checked -**Files Referenced:** {{file_count}} - -**Validation Method:** Haiku agents read actual code -**Cost Estimate:** ~$0.13 for this story - -Starting task-by-task verification... - - - - - Spawn ONE Haiku agent to verify ALL tasks (avoids 50x agent startup overhead!) - - Spawning Haiku verification agent for {{total_count}} tasks... - - - - Verify all {{total_count}} story tasks - -You are verifying ALL tasks for this user story by reading actual code. - -**Story:** {{story_id}} -**Epic:** {{epic_num}} -**Total Tasks:** {{total_count}} - -**Files from Story (Dev Agent Record):** -{{#each file_list}} -- {{this}} -{{/each}} - -**Tasks to Verify:** - -{{#each task_list}} -{{@index}}. [{{#if this.checked}}x{{else}} {{/if}}] {{this.text}} -{{/each}} - ---- - -**Your Job:** - -For EACH task above: - -1. **Find relevant files** - Use Glob to find files mentioned in task -2. **Read the files** - Use Read tool to examine actual code -3. **Verify implementation:** - - Is code real or stubs/TODOs? - - Is there error handling? - - Multi-tenant isolation (dealerId filters)? - - Are there tests? - - Does it match task description? - -4. **Make judgment for each task** - -**Output Format - JSON array with one entry per task:** - -```json -{ - "story_id": "{{story_id}}", - "total_tasks": {{total_count}}, - "tasks": [ - { - "task_number": 0, - "task_text": "Implement UserService", - "is_checked": true, - "actually_complete": false, - "confidence": "high", - "evidence": "File exists but has 'TODO: Implement findById' on line 45, tests not found", - "issues_found": ["Stub implementation", "Missing tests", "No dealerId filter"], - "recommendation": "Implement real logic, add tests, add multi-tenant isolation" - }, - { - "task_number": 1, - "task_text": "Add error handling", - "is_checked": true, - "actually_complete": true, - "confidence": "very_high", - "evidence": "Try-catch blocks in UserService.ts:67-89, proper error logging, tests verify error cases", - "issues_found": [], - "recommendation": "None - task complete" - } - ] -} -``` - -**Be efficient:** Read files once, verify all tasks, return comprehensive JSON. - - general-purpose - - - Parse agent response (extract JSON) - - For each task result: - - Determine verification_status (correct/false_positive/false_negative) - - Categorize into verified_complete, false_positives, false_negatives lists - - Count totals - - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Task Verification Complete -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -**✅ Verified Complete:** {{verified_complete_count}} -**❌ False Positives:** {{false_positive_count}} (checked but code missing/poor) -**âš ī¸ False Negatives:** {{false_negative_count}} (unchecked but code exists) -**❓ Uncertain:** {{uncertain_count}} - -**Verification Score:** {{verification_score}}/100 - - - - - Calculate scores: - - Task accuracy: (correct / total) × 100 - - False positive penalty: false_positive_count × -5 - - Overall score: max(0, task_accuracy + penalty) - - - Determine story category: - IF score >= 95 AND false_positives == 0 - → VERIFIED_COMPLETE - ELSE IF score >= 80 AND false_positives <= 2 - → COMPLETE_WITH_MINOR_ISSUES - ELSE IF false_positives > 5 OR score < 50 - → FALSE_POSITIVE (story claimed done but significant missing code) - ELSE IF false_positives > 0 - → NEEDS_REWORK - ELSE - → IN_PROGRESS - - - Determine recommended status: - VERIFIED_COMPLETE → "done" - COMPLETE_WITH_MINOR_ISSUES → "review" - FALSE_POSITIVE → "in-progress" or "ready-for-dev" - NEEDS_REWORK → "in-progress" - IN_PROGRESS → "in-progress" - - - -📊 **STORY HEALTH ASSESSMENT** - -**Current Status:** {{current_status}} -**Recommended Status:** {{recommended_status}} -**Overall Score:** {{overall_score}}/100 - -**Category:** {{category}} - -{{#if category == "VERIFIED_COMPLETE"}} -✅ **Story is production-ready** -- All tasks verified complete -- Code quality confirmed -- No significant issues found -{{/if}} - -{{#if category == "FALSE_POSITIVE"}} -❌ **Story claimed done but has significant missing code** -- {{false_positive_count}} tasks checked but not implemented -- Verification score: {{overall_score}}/100 (< 50% = false positive) -- Action: Update status to in-progress, implement missing tasks -{{/if}} - -{{#if category == "NEEDS_REWORK"}} -âš ī¸ **Story needs rework before marking complete** -- {{false_positive_count}} tasks with missing/poor code -- Issues found in verification -- Action: Fix issues, re-verify -{{/if}} - - - - - -# Story Validation Report: {{story_id}} - -**Generated:** {{date}} -**Validation Method:** LLM-powered deep verification (Haiku 4.5) -**Overall Score:** {{overall_score}}/100 -**Category:** {{category}} - ---- - -## Summary - -**Story:** {{story_id}} -**Epic:** {{epic_num}} -**Current Status:** {{current_status}} -**Recommended Status:** {{recommended_status}} - -**Task Verification:** -- Total: {{total_count}} -- Checked: {{checked_count}} -- Verified Complete: {{verified_complete_count}} -- False Positives: {{false_positive_count}} -- False Negatives: {{false_negative_count}} - ---- - -## Verification Details - -{{#if false_positive_count > 0}} -### ❌ False Positives (CRITICAL - Code Claims vs Reality) - -{{#each false_positives}} -**Task {{@index + 1}}:** {{this.task}} -**Claimed:** [x] Complete -**Reality:** Code missing or stub implementation - -**Evidence:** -{{this.evidence}} - -**Issues Found:** -{{#each this.issues_found}} -- {{this}} -{{/each}} - -**Recommendation:** {{this.recommendation}} - ---- -{{/each}} -{{/if}} - -{{#if false_negative_count > 0}} -### âš ī¸ False Negatives (Unchecked But Working) - -{{#each false_negatives}} -**Task {{@index + 1}}:** {{this.task}} -**Status:** [ ] Unchecked -**Reality:** Code exists and working - -**Evidence:** -{{this.evidence}} - -**Recommendation:** Mark task as complete [x] - ---- -{{/each}} -{{/if}} - -{{#if verified_complete_count > 0}} -### ✅ Verified Complete Tasks - -{{verified_complete_count}} tasks verified with actual code review. - -{{#if show_all_verified}} -{{#each verified_complete}} -- {{this.task}} ({{this.confidence}} confidence) -{{/each}} -{{/if}} -{{/if}} - ---- - -## Final Verdict - -**Overall Score:** {{overall_score}}/100 - -{{#if category == "VERIFIED_COMPLETE"}} -✅ **VERIFIED COMPLETE** - -This story is production-ready: -- All {{total_count}} tasks verified complete -- Code quality confirmed through review -- No significant issues found -- Status "done" is accurate - -**Action:** None needed - story is solid -{{/if}} - -{{#if category == "FALSE_POSITIVE"}} -❌ **FALSE POSITIVE - Story NOT Actually Complete** - -**Problems:** -- {{false_positive_count}} tasks checked but code missing/stubbed -- Verification score: {{overall_score}}/100 (< 50%) -- Story marked "{{current_status}}" but significant work remains - -**Required Actions:** -1. Update sprint-status.yaml: {{story_id}} → in-progress -2. Uncheck {{false_positive_count}} false positive tasks -3. Implement missing code -4. Re-run validation after implementation - -**Estimated Rework:** {{estimated_rework_hours}} hours -{{/if}} - -{{#if category == "NEEDS_REWORK"}} -âš ī¸ **NEEDS REWORK** - -**Problems:** -- {{false_positive_count}} tasks with quality issues -- Some code exists but has problems (TODOs, missing features, poor quality) - -**Required Actions:** -{{#each action_items}} -- [ ] {{this}} -{{/each}} - -**Estimated Fix Time:** {{estimated_fix_hours}} hours -{{/if}} - -{{#if category == "IN_PROGRESS"}} -🔄 **IN PROGRESS** (accurate status) - -- {{checked_count}}/{{total_count}} tasks complete -- {{unchecked_count}} tasks remaining -- Current status reflects reality - -**No action needed** - continue implementation -{{/if}} - ---- - -**Validation Cost:** ~${{validation_cost}} -**Agent Model:** {{agent_model}} -**Tasks Verified:** {{total_count}} - - - - - - Story status should be updated from "{{current_status}}" to "{{recommended_status}}". Update sprint-status.yaml? (y/n) - - - Update sprint-status.yaml: - python3 scripts/lib/sprint-status-updater.py --epic {{epic_num}} --mode fix - - - Add validation note to story file Dev Agent Record - - ✅ Updated {{story_id}}: {{current_status}} → {{recommended_status}} - - - - - ✅ Story status is accurate - no changes needed - - - - diff --git a/src/bmm/workflows/4-implementation/validate-story-deep/workflow.yaml b/src/bmm/workflows/4-implementation/validate-story-deep/workflow.yaml deleted file mode 100644 index 7560a449..00000000 --- a/src/bmm/workflows/4-implementation/validate-story-deep/workflow.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: validate-story-deep -description: "Deep story validation using Haiku agents to read and verify actual code. Each task gets micro code review to verify implementation quality." -author: "BMad" -version: "1.0.0" - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -implementation_artifacts: "{config_source}:implementation_artifacts" -story_dir: "{implementation_artifacts}" - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-story-deep" -instructions: "{installed_path}/instructions.xml" - -# Input variables -variables: - story_file: "" # Path to story file to validate - -# Agent configuration -agent_model: "haiku" # Use Haiku 4.5 for cost efficiency ($0.13/story vs $1.50) -parallel_tasks: true # Validate tasks in parallel (faster) - -# Output -default_output_file: "{story_dir}/.validation-{story_id}-{date}.md" - -standalone: true -web_bundle: false diff --git a/src/bmm/workflows/4-implementation/validate-story/instructions.xml b/src/bmm/workflows/4-implementation/validate-story/instructions.xml deleted file mode 100644 index 977e5de8..00000000 --- a/src/bmm/workflows/4-implementation/validate-story/instructions.xml +++ /dev/null @@ -1,395 +0,0 @@ - - The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - You MUST have already loaded and processed: {installed_path}/workflow.yaml - This performs DEEP validation - not just checkbox counting, but verifying code actually exists and works - - - Load story file from {{story_file}} - - - ❌ Story file not found: {{story_file}} - -Please provide a valid story file path. - - HALT - - - Extract story metadata: - - Story ID (from filename) - - Epic number - - Current status from Status: field - - Priority - - Estimated effort - - - Extract all tasks: - - Pattern: "- [ ]" or "- [x]" - - Count total tasks - - Count checked tasks - - Count unchecked tasks - - Calculate completion percentage - - - Extract file references from Dev Agent Record: - - Files created - - Files modified - - Files deleted - - - 📋 **Story Validation: {{story_id}}** - -**Epic:** {{epic_num}} -**Current Status:** {{current_status}} -**Tasks:** {{checked_count}}/{{total_count}} complete ({{completion_pct}}%) -**Files Referenced:** {{file_count}} - -Starting deep validation... - - - - - Use task-verification-engine.py for DEEP verification (not just file existence) - - For each task in story: - 1. Extract task text - 2. Note if checked [x] or unchecked [ ] - 3. Pass to task-verification-engine.py - 4. Receive verification result with: - - should_be_checked: true/false - - confidence: very high/high/medium/low - - evidence: list of findings - - verification_status: correct/false_positive/false_negative/uncertain - - - Categorize tasks by verification status: - - ✅ CORRECT: Checkbox matches reality - - ❌ FALSE POSITIVE: Checked but code missing/stubbed - - âš ī¸ FALSE NEGATIVE: Unchecked but code exists - - ❓ UNCERTAIN: Cannot verify (low confidence) - - - Calculate verification score: - - (correct_tasks / total_tasks) × 100 - - Penalize false positives heavily (-5 points each) - - Penalize false negatives lightly (-2 points each) - - - -🔍 **Task Verification Results** - -**Total Tasks:** {{total_count}} - -**✅ CORRECT:** {{correct_count}} tasks (checkbox matches reality) -**❌ FALSE POSITIVES:** {{false_positive_count}} tasks (checked but code missing/stubbed) -**âš ī¸ FALSE NEGATIVES:** {{false_negative_count}} tasks (unchecked but code exists) -**❓ UNCERTAIN:** {{uncertain_count}} tasks (cannot verify) - -**Verification Score:** {{verification_score}}/100 - -{{#if false_positive_count > 0}} -### ❌ False Positives (CRITICAL - Code Claims vs Reality) - -{{#each false_positives}} -**Task:** {{this.task}} -**Claimed:** [x] Complete -**Reality:** {{this.evidence}} -**Action Required:** {{this.recommended_action}} -{{/each}} -{{/if}} - -{{#if false_negative_count > 0}} -### âš ī¸ False Negatives (Unchecked but Working) - -{{#each false_negatives}} -**Task:** {{this.task}} -**Status:** [ ] Unchecked -**Reality:** {{this.evidence}} -**Recommendation:** Mark as complete [x] -{{/each}} -{{/if}} - - - - - Extract all files from Dev Agent Record file list - - - âš ī¸ No files listed in Dev Agent Record - cannot perform code review - Skip to step 4 - - - For each file: - 1. Check if file exists - 2. Read file content - 3. Check for quality issues: - - TODO/FIXME comments without GitHub issues - - any types in TypeScript - - Hardcoded values (siteId, dealerId, API keys) - - Missing error handling - - Missing multi-tenant isolation (dealerId filters) - - Missing audit logging on mutations - - Security vulnerabilities (SQL injection, XSS) - - - Run multi-agent review if files exist: - - Security audit - - Silent failure detection - - Architecture compliance - - Performance analysis - - - Categorize issues by severity: - - CRITICAL: Security, data loss, breaking changes - - HIGH: Missing features, poor quality, technical debt - - MEDIUM: Code smells, minor violations - - LOW: Style issues, nice-to-haves - - - -đŸ›Ąī¸ **Code Quality Review** - -**Files Reviewed:** {{files_reviewed}} -**Files Missing:** {{files_missing}} - -**Issues Found:** {{total_issues}} - CRITICAL: {{critical_count}} - HIGH: {{high_count}} - MEDIUM: {{medium_count}} - LOW: {{low_count}} - -{{#if critical_count > 0}} -### 🚨 CRITICAL Issues (Must Fix) - -{{#each critical_issues}} -**File:** {{this.file}} -**Issue:** {{this.description}} -**Impact:** {{this.impact}} -**Fix:** {{this.recommended_fix}} -{{/each}} -{{/if}} - -{{#if high_count > 0}} -### âš ī¸ HIGH Priority Issues - -{{#each high_issues}} -**File:** {{this.file}} -**Issue:** {{this.description}} -{{/each}} -{{/if}} - -**Code Quality Score:** {{quality_score}}/100 - - - - - Extract dependencies from story: - - Services called - - APIs consumed - - Database tables used - - Cache keys accessed - - - For each dependency: - 1. Check if dependency still exists - 2. Check if API contract is still valid - 3. Run integration tests if they exist - 4. Check for breaking changes in dependent stories - - - -🔗 **Integration Verification** - -**Dependencies Checked:** {{dependency_count}} - -{{#if broken_integrations}} -### ❌ Broken Integrations - -{{#each broken_integrations}} -**Dependency:** {{this.name}} -**Issue:** {{this.problem}} -**Likely Cause:** {{this.cause}} -**Fix:** {{this.fix}} -{{/each}} -{{/if}} - -{{#if all_integrations_ok}} -✅ All integrations verified working -{{/if}} - - - - - Calculate overall story health: - - Task verification score (0-100) - - Code quality score (0-100) - - Integration score (0-100) - - Overall score = weighted average - - - Determine recommended status: - IF verification_score >= 95 AND quality_score >= 90 AND no CRITICAL issues - → VERIFIED_COMPLETE - ELSE IF verification_score >= 80 AND quality_score >= 70 - → COMPLETE_WITH_ISSUES (document issues) - ELSE IF false_positives > 0 OR critical_issues > 0 - → NEEDS_REWORK (code missing or broken) - ELSE IF verification_score < 50 - → FALSE_POSITIVE (claimed done but not implemented) - ELSE - → IN_PROGRESS (partially complete) - - - -📊 **FINAL VERDICT** - -**Story:** {{story_id}} -**Current Status:** {{current_status}} -**Recommended Status:** {{recommended_status}} - -**Scores:** - Task Verification: {{verification_score}}/100 - Code Quality: {{quality_score}}/100 - Integration: {{integration_score}}/100 - **Overall: {{overall_score}}/100** - -**Confidence:** {{confidence_level}} - -{{#if recommended_status != current_status}} -### âš ī¸ Status Change Recommended - -**Current:** {{current_status}} -**Should Be:** {{recommended_status}} - -**Reason:** -{{status_change_reason}} -{{/if}} - - - - - -# Story Validation Report: {{story_id}} - -**Validation Date:** {{date}} -**Validation Depth:** {{validation_depth}} -**Overall Score:** {{overall_score}}/100 - ---- - -## Summary - -**Story:** {{story_id}} - {{story_title}} -**Epic:** {{epic_num}} -**Current Status:** {{current_status}} -**Recommended Status:** {{recommended_status}} - -**Task Completion:** {{checked_count}}/{{total_count}} ({{completion_pct}}%) -**Verification Score:** {{verification_score}}/100 -**Code Quality Score:** {{quality_score}}/100 - ---- - -## Task Verification Details - -{{task_verification_output}} - ---- - -## Code Quality Review - -{{code_quality_output}} - ---- - -## Integration Verification - -{{integration_output}} - ---- - -## Recommended Actions - -{{#if critical_issues}} -### Priority 1: Fix Critical Issues (BLOCKING) -{{#each critical_issues}} -- [ ] {{this.file}}: {{this.description}} -{{/each}} -{{/if}} - -{{#if false_positives}} -### Priority 2: Fix False Positives (Code Claims vs Reality) -{{#each false_positives}} -- [ ] {{this.task}} - {{this.evidence}} -{{/each}} -{{/if}} - -{{#if high_issues}} -### Priority 3: Address High Priority Issues -{{#each high_issues}} -- [ ] {{this.file}}: {{this.description}} -{{/each}} -{{/if}} - -{{#if false_negatives}} -### Priority 4: Update Task Checkboxes (Low Impact) -{{#each false_negatives}} -- [ ] Mark complete: {{this.task}} -{{/each}} -{{/if}} - ---- - -## Next Steps - -{{#if recommended_status == "VERIFIED_COMPLETE"}} -✅ **Story is verified complete and production-ready** -- Update sprint-status.yaml: {{story_id}} = done -- No further action required -{{/if}} - -{{#if recommended_status == "NEEDS_REWORK"}} -âš ī¸ **Story requires rework before marking complete** -- Fix {{critical_count}} CRITICAL issues -- Address {{false_positive_count}} false positive tasks -- Re-run validation after fixes -{{/if}} - -{{#if recommended_status == "FALSE_POSITIVE"}} -❌ **Story is marked done but not actually implemented** -- Verification score: {{verification_score}}/100 (< 50%) -- Update sprint-status.yaml: {{story_id}} = in-progress or ready-for-dev -- Implement missing tasks before claiming done -{{/if}} - ---- - -**Generated by:** /validate-story workflow -**Validation Engine:** task-verification-engine.py v2.0 - - - - - Apply recommended status change to sprint-status.yaml? (y/n) - - - Update sprint-status.yaml: - - Use sprint-status-updater.py - - Update {{story_id}} to {{recommended_status}} - - Add comment: "Validated {{date}}, score {{overall_score}}/100" - - - Update story file: - - Add validation report link to Dev Agent Record - - Add validation score to completion notes - - Update Status: field if changed - - - ✅ Updated {{story_id}} status: {{current_status}} → {{recommended_status}} - - - - â„šī¸ Status not updated. Validation report saved for reference. - - - - diff --git a/src/bmm/workflows/4-implementation/validate-story/workflow.yaml b/src/bmm/workflows/4-implementation/validate-story/workflow.yaml deleted file mode 100644 index 4ea2ee47..00000000 --- a/src/bmm/workflows/4-implementation/validate-story/workflow.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: validate-story -description: "Deep validation of a single story: verify tasks against codebase, run code quality review, check for regressions. Produces verification report with actionable findings." -author: "BMad" -version: "1.0.0" - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -implementation_artifacts: "{config_source}:implementation_artifacts" -story_dir: "{implementation_artifacts}" - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-story" -instructions: "{installed_path}/instructions.xml" - -# Input variables -variables: - story_file: "" # Path to story file (e.g., docs/sprint-artifacts/16e-6-ecs-task-definitions-tier3.md) - validation_depth: "deep" # Options: "quick" (tasks only), "deep" (tasks + code review), "comprehensive" (tasks + review + integration tests) - -# Tools -task_verification_script: "{project-root}/scripts/lib/task-verification-engine.py" - -# Output -default_output_file: "{story_dir}/.validation-{story_id}-{date}.md" - -standalone: true -web_bundle: false diff --git a/src/modules/bmm/workflows/4-implementation/validate-all-epics/instructions.xml b/src/modules/bmm/workflows/4-implementation/validate-all-epics/instructions.xml deleted file mode 100644 index d0969730..00000000 --- a/src/modules/bmm/workflows/4-implementation/validate-all-epics/instructions.xml +++ /dev/null @@ -1,158 +0,0 @@ - - The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - You MUST have already loaded and processed: {installed_path}/workflow.yaml - This validates EVERY epic in the project - comprehensive health check - - - Load {{sprint_status_file}} - - - ❌ sprint-status.yaml not found - -Run /bmad:bmm:workflows:sprint-planning first. - - HALT - - - Parse development_status section - Extract all epic keys (entries starting with "epic-") - Filter out retrospectives (ending with "-retrospective") - Store as {{epic_list}} - - 🔍 **Comprehensive Epic Validation** - -Found {{epic_count}} epics to validate: -{{#each epic_list}} - - {{this}} -{{/each}} - -Starting validation... - - - - - Run validate-epic-status for EACH epic - - Initialize counters: - - total_stories_scanned = 0 - - total_valid_stories = 0 - - total_invalid_stories = 0 - - total_updates_applied = 0 - - epics_validated = [] - - - - Set {{current_epic}} = current loop item - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Validating {{current_epic}}... -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - - - Execute validation script: - python3 scripts/lib/sprint-status-updater.py --epic {{current_epic}} --mode validate - - - Parse script output: - - Story count - - Valid/invalid/missing counts - - Inferred statuses - - Updates needed - - - - Execute fix script: - python3 scripts/lib/sprint-status-updater.py --epic {{current_epic}} --mode fix - - - Count updates applied - Add to total_updates_applied - - - Store validation results for {{current_epic}} - Increment totals - - ✓ {{current_epic}}: {{story_count}} stories, {{valid_count}} valid, {{updates_applied}} updates - - - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -All Epics Validated -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - - - - -📊 **COMPREHENSIVE VALIDATION RESULTS** - -**Epics Validated:** {{epic_count}} - -**Stories Analyzed:** {{total_stories_scanned}} - Valid: {{total_valid_stories}} (>=10KB, >=5 tasks) - Invalid: {{total_invalid_stories}} (<10KB or <5 tasks) - Missing: {{total_missing_files}} - -**Updates Applied:** {{total_updates_applied}} - -**Epic Status Summary:** -{{#each_epic_with_status}} - {{epic_key}}: {{status}} ({{done_count}}/{{total_count}} done) -{{/each}} - -**Top Issues:** -{{#if_invalid_stories_exist}} - âš ī¸ {{total_invalid_stories}} stories need regeneration (/create-story) -{{/if}} -{{#if_missing_files_exist}} - âš ī¸ {{total_missing_files}} story files missing (create or remove from sprint-status.yaml) -{{/if}} -{{#if_conflicting_evidence}} - âš ī¸ {{conflict_count}} stories have conflicting evidence (manual review) -{{/if}} - -**Health Score:** {{health_score}}/100 - (100 = perfect, all stories valid with correct status) - - - Write comprehensive report to {{default_output_file}} - - 💾 Full report: {{default_output_file}} - - - - -đŸŽ¯ **RECOMMENDED ACTIONS** - -{{#if_health_score_lt_80}} -**Priority 1: Fix Invalid Stories ({{total_invalid_stories}})** -{{#each_invalid_story}} - /create-story-with-gap-analysis # Regenerate {{story_id}} -{{/each}} -{{/if}} - -{{#if_missing_files_gt_0}} -**Priority 2: Create Missing Story Files ({{total_missing_files}})** -{{#each_missing}} - /create-story # Create {{story_id}} -{{/each}} -{{/if}} - -{{#if_health_score_gte_80}} -✅ **Sprint status is healthy!** - -Continue with normal development: - /sprint-status # Check what's next -{{/if}} - -**Maintenance:** - - Run /validate-all-epics weekly to catch drift - - After autonomous work, run validation - - Before sprint reviews, validate status accuracy - - - - diff --git a/src/modules/bmm/workflows/4-implementation/validate-all-epics/workflow.yaml b/src/modules/bmm/workflows/4-implementation/validate-all-epics/workflow.yaml deleted file mode 100644 index 4b3109e5..00000000 --- a/src/modules/bmm/workflows/4-implementation/validate-all-epics/workflow.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: validate-all-epics -description: "Validate and fix sprint-status.yaml for ALL epics. Runs validate-epic-status on every epic in parallel, consolidates results, rebuilds accurate sprint-status.yaml." -author: "BMad" -version: "1.0.0" - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -implementation_artifacts: "{config_source}:implementation_artifacts" -story_dir: "{implementation_artifacts}" - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-all-epics" -instructions: "{installed_path}/instructions.xml" - -# Variables -variables: - sprint_status_file: "{implementation_artifacts}/sprint-status.yaml" - validation_mode: "fix" # Options: "report-only", "fix" - parallel_validation: true # Validate epics in parallel for speed - -# Sub-workflow -validate_epic_workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-epic-status/workflow.yaml" - -# Output -default_output_file: "{story_dir}/.all-epics-validation-report.md" - -standalone: true -web_bundle: false diff --git a/src/modules/bmm/workflows/4-implementation/validate-all-stories-deep/instructions.xml b/src/modules/bmm/workflows/4-implementation/validate-all-stories-deep/instructions.xml deleted file mode 100644 index 4f73b8d7..00000000 --- a/src/modules/bmm/workflows/4-implementation/validate-all-stories-deep/instructions.xml +++ /dev/null @@ -1,338 +0,0 @@ - - The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - You MUST have already loaded and processed: {installed_path}/workflow.yaml - This is the COMPREHENSIVE AUDIT - validates all stories using Haiku agents - Cost: ~$76 for 511 stories with Haiku (vs $793 with Sonnet) - - - Find all .md files in {{story_dir}} - - Filter out meta-documents: - - Files starting with "EPIC-" (completion reports) - - Files starting with "." (progress files) - - Files containing: COMPLETION, SUMMARY, REPORT, SESSION-, REVIEW-, README, INDEX - - Files like "atdd-checklist-", "gap-analysis-", "review-" - - - - Filter to stories matching: {{epic_filter}}-*.md - - - Store as {{story_list}} - Count {{story_count}} - - 🔍 **Comprehensive Story Audit** - -{{#if epic_filter}}**Epic Filter:** {{epic_filter}}{{else}}**Scope:** All epics{{/if}} -**Stories to Validate:** {{story_count}} -**Agent Model:** Haiku 4.5 -**Batch Size:** {{batch_size}} - -**Estimated Cost:** ~${{estimated_cost}} ({{story_count}} × $0.15/story) -**Estimated Time:** {{estimated_hours}} hours - -Starting batch validation... - - - - - Initialize counters: - - stories_validated = 0 - - verified_complete = 0 - - needs_rework = 0 - - false_positives = 0 - - in_progress = 0 - - total_false_positive_tasks = 0 - - total_critical_issues = 0 - - - Split {{story_list}} into batches of {{batch_size}} - - - Set {{current_batch}} = current batch - Set {{batch_number}} = loop index + 1 - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Batch {{batch_number}}/{{total_batches}} ({{batch_size}} stories) -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - - - - Set {{story_file}} = current story path - Extract {{story_id}} from filename - - {{stories_validated + 1}}/{{story_count}}: Validating {{story_id}}... - - - - - - - Parse validation results: - - category (VERIFIED_COMPLETE, FALSE_POSITIVE, etc.) - - verification_score - - false_positive_count - - false_negative_count - - critical_issues_count - - - Store results for {{story_id}} - Increment counters based on category - - → {{category}} (Score: {{verification_score}}/100{{#if false_positives > 0}}, {{false_positives}} false positives{{/if}}) - - Increment stories_validated - - - Batch {{batch_number}} complete. {{stories_validated}}/{{story_count}} total validated. - - - Write progress to {{progress_file}}: - - stories_validated - - current_batch - - results_so_far - - - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -All Stories Validated -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -**Total Validated:** {{story_count}} -**Total Tasks Checked:** {{total_tasks_verified}} - - - - - Calculate platform-wide metrics: - - Overall health score: (verified_complete / story_count) × 100 - - False positive rate: (false_positive_stories / story_count) × 100 - - Total rework estimate: false_positive_stories × 3h + needs_rework × 2h - - - Group results by epic - - Identify worst offenders (highest false positive rates) - - -📊 **PLATFORM HEALTH ASSESSMENT** - -**Overall Health Score:** {{health_score}}/100 - -**Story Categories:** -- ✅ VERIFIED_COMPLETE: {{verified_complete}} ({{verified_complete_pct}}%) -- âš ī¸ NEEDS_REWORK: {{needs_rework}} ({{needs_rework_pct}}%) -- ❌ FALSE_POSITIVES: {{false_positives}} ({{false_positives_pct}}%) -- 🔄 IN_PROGRESS: {{in_progress}} ({{in_progress_pct}}%) - -**Task-Level Issues:** -- False positive tasks: {{total_false_positive_tasks}} -- CRITICAL code quality issues: {{total_critical_issues}} - -**Estimated Rework:** {{total_rework_hours}} hours - -**Epic Breakdown:** -{{#each epic_summary}} -- Epic {{this.epic}}: {{this.health_score}}/100 ({{this.false_positives}} false positives) -{{/each}} - -**Worst Offenders (Most False Positives):** -{{#each worst_offenders limit=10}} -- {{this.story_id}}: {{this.false_positive_count}} tasks, score {{this.score}}/100 -{{/each}} - - - - - -# Comprehensive Platform Audit Report - -**Generated:** {{date}} -**Stories Validated:** {{story_count}} -**Agent Model:** Haiku 4.5 -**Total Cost:** ~${{actual_cost}} - ---- - -## Executive Summary - -**Platform Health Score:** {{health_score}}/100 - -{{#if health_score >= 90}} -✅ **EXCELLENT** - Platform is production-ready with high confidence -{{else if health_score >= 75}} -âš ī¸ **GOOD** - Minor issues to address, generally solid -{{else if health_score >= 60}} -âš ī¸ **NEEDS WORK** - Significant rework required before production -{{else}} -❌ **CRITICAL** - Major quality issues found, not production-ready -{{/if}} - -**Key Findings:** -- {{verified_complete}} stories verified complete ({{verified_complete_pct}}%) -- {{false_positives}} stories are false positives ({{false_positives_pct}}%) -- {{total_false_positive_tasks}} tasks claimed done but not implemented -- {{total_critical_issues}} CRITICAL code quality issues found - ---- - -## ❌ False Positive Stories ({{false_positives}} total) - -**These stories are marked "done" but have significant missing/stubbed code:** - -{{#each false_positive_stories}} -### {{this.story_id}} (Score: {{this.score}}/100) - -**Current Status:** {{this.current_status}} -**Should Be:** in-progress or ready-for-dev - -**Missing/Stubbed:** -{{#each this.false_positive_tasks}} -- {{this.task}} - - {{this.evidence}} -{{/each}} - -**Estimated Fix:** {{this.estimated_hours}}h - ---- -{{/each}} - -**Total Rework:** {{false_positive_rework_hours}} hours - ---- - -## âš ī¸ Stories Needing Rework ({{needs_rework}} total) - -{{#each needs_rework_stories}} -### {{this.story_id}} (Score: {{this.score}}/100) - -**Issues:** -- {{this.false_positive_count}} incomplete tasks -- {{this.critical_issues}} CRITICAL quality issues -- {{this.high_issues}} HIGH priority issues - -**Top Issues:** -{{#each this.top_issues limit=5}} -- {{this}} -{{/each}} - ---- -{{/each}} - -**Total Rework:** {{needs_rework_hours}} hours - ---- - -## ✅ Verified Complete Stories ({{verified_complete}} total) - -**These stories are production-ready with verified code:** - -{{#each verified_complete_stories}} -- {{this.story_id}} ({{this.score}}/100) -{{/each}} - ---- - -## 📊 Epic Health Breakdown - -{{#each epic_summary}} -### Epic {{this.epic}} - -**Stories:** {{this.total}} -**Verified Complete:** {{this.verified}} ({{this.verified_pct}}%) -**False Positives:** {{this.false_positives}} -**Needs Rework:** {{this.needs_rework}} - -**Health Score:** {{this.health_score}}/100 - -{{#if this.health_score < 70}} -âš ī¸ **ATTENTION NEEDED** - This epic has quality issues -{{/if}} - -**Top Issues:** -{{#each this.top_issues limit=3}} -- {{this}} -{{/each}} - ---- -{{/each}} - ---- - -## đŸŽ¯ Recommended Action Plan - -### Phase 1: Fix False Positives (CRITICAL - {{false_positive_rework_hours}}h) - -{{#each false_positive_stories limit=20}} -{{@index + 1}}. **{{this.story_id}}** ({{this.estimated_hours}}h) - - {{this.false_positive_count}} tasks to implement - - Update status to in-progress -{{/each}} - -{{#if false_positives > 20}} -... and {{false_positives - 20}} more (see full list above) -{{/if}} - -### Phase 2: Address Rework Items (HIGH - {{needs_rework_hours}}h) - -{{#each needs_rework_stories limit=10}} -{{@index + 1}}. **{{this.story_id}}** ({{this.estimated_hours}}h) - - Fix {{this.critical_issues}} CRITICAL issues - - Complete {{this.false_positive_count}} tasks -{{/each}} - -### Phase 3: Fix False Negatives (LOW - batch update) - -- {{total_false_negative_tasks}} unchecked tasks that are actually complete -- Can batch update checkboxes (low priority) - ---- - -## 💰 Audit Cost Analysis - -**This Validation Run:** -- Stories validated: {{story_count}} -- Agent sessions: {{story_count}} (one Haiku agent per story) -- Tokens used: ~{{tokens_used_millions}}M -- Cost: ~${{actual_cost}} - -**Remediation Cost:** -- Estimated hours: {{total_rework_hours}}h -- At AI velocity: {{ai_velocity_days}} days of work -- Token cost: ~${{remediation_token_cost}} - -**Total Investment:** ${{actual_cost}} (audit) + ${{remediation_token_cost}} (fixes) = ${{total_cost}} - ---- - -## 📅 Next Steps - -1. **Immediate:** Fix {{false_positives}} false positive stories -2. **This Week:** Address {{total_critical_issues}} CRITICAL issues -3. **Next Week:** Rework {{needs_rework}} stories -4. **Ongoing:** Re-validate fixed stories to confirm - -**Commands:** -```bash -# Validate specific story -/validate-story-deep docs/sprint-artifacts/16e-6-ecs-task-definitions-tier3.md - -# Validate specific epic -/validate-all-stories-deep --epic 16e - -# Re-run full audit (after fixes) -/validate-all-stories-deep -``` - ---- - -**Report Generated By:** validate-all-stories-deep workflow -**Validation Method:** LLM-powered (Haiku 4.5 agents read actual code) -**Confidence Level:** Very High (code-based verification, not regex patterns) - - - - diff --git a/src/modules/bmm/workflows/4-implementation/validate-all-stories-deep/workflow.yaml b/src/modules/bmm/workflows/4-implementation/validate-all-stories-deep/workflow.yaml deleted file mode 100644 index 76f00357..00000000 --- a/src/modules/bmm/workflows/4-implementation/validate-all-stories-deep/workflow.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: validate-all-stories-deep -description: "Comprehensive platform audit using Haiku agents. Validates ALL stories by reading actual code. The bulletproof validation for production readiness." -author: "BMad" -version: "1.0.0" - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -implementation_artifacts: "{config_source}:implementation_artifacts" -story_dir: "{implementation_artifacts}" - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-all-stories-deep" -instructions: "{installed_path}/instructions.xml" - -# Input variables -variables: - epic_filter: "" # Optional: Only validate specific epic (e.g., "16e") - batch_size: 5 # Validate 5 stories at a time (prevents spawning 511 agents at once!) - concurrent_limit: 5 # Max 5 agents running concurrently - auto_fix: false # If true, auto-update statuses based on validation - pause_between_batches: 30 # Seconds to wait between batches (rate limiting) - -# Sub-workflow -validate_story_workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-story-deep/workflow.yaml" - -# Agent configuration -agent_model: "haiku" # Cost: ~$66 for 511 stories vs $793 with Sonnet - -# Output -default_output_file: "{story_dir}/.comprehensive-audit-{date}.md" -progress_file: "{story_dir}/.validation-progress-{date}.yaml" - -standalone: true -web_bundle: false diff --git a/src/modules/bmm/workflows/4-implementation/validate-all-stories/instructions.xml b/src/modules/bmm/workflows/4-implementation/validate-all-stories/instructions.xml deleted file mode 100644 index 432e6e6f..00000000 --- a/src/modules/bmm/workflows/4-implementation/validate-all-stories/instructions.xml +++ /dev/null @@ -1,411 +0,0 @@ - - The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - You MUST have already loaded and processed: {installed_path}/workflow.yaml - This is the COMPREHENSIVE AUDIT - validates every story's tasks against actual codebase - - - Find all story files in {{story_dir}} - Filter out meta-documents: - - Files starting with "EPIC-" (completion reports) - - Files with "COMPLETION", "SUMMARY", "REPORT" in name - - Files starting with "." (hidden progress files) - - Files like "README", "INDEX", "SESSION-", "REVIEW-" - - - - Filter to stories starting with {{epic_filter}}- (e.g., "16e-") - - - Store as {{story_list}} - Count {{story_count}} - - 🔍 **Comprehensive Story Validation** - -{{#if epic_filter}} -**Epic Filter:** {{epic_filter}} only -{{/if}} -**Stories to Validate:** {{story_count}} -**Validation Depth:** {{validation_depth}} -**Parallel Mode:** {{parallel_validation}} - -**Estimated Time:** {{estimated_minutes}} minutes -**Estimated Cost:** ~${{estimated_cost}} ({{story_count}} × ~$0.50/story) - -This will: -1. Verify all tasks against actual codebase (task-verification-engine.py) -2. Run code quality reviews on files with issues -3. Check for regressions and integration failures -4. Categorize stories: VERIFIED_COMPLETE, NEEDS_REWORK, FALSE_POSITIVE, etc. -5. Generate comprehensive audit report - -Starting validation... - - - - - Initialize counters: - - stories_validated = 0 - - verified_complete = 0 - - needs_rework = 0 - - false_positives = 0 - - in_progress = 0 - - total_false_positive_tasks = 0 - - total_tasks_verified = 0 - - - - Set {{current_story}} = current story file - Extract {{story_id}} from filename - - Validating {{counter}}/{{story_count}}: {{story_id}}... - - - Execute: python3 {{task_verification_script}} {{current_story}} - - Parse output: - - total_tasks - - checked_tasks - - false_positives - - false_negatives - - verification_score - - task_details (with evidence) - - - Categorize story: - IF verification_score >= 95 AND false_positives == 0 - → category = "VERIFIED_COMPLETE" - ELSE IF verification_score >= 80 AND false_positives <= 2 - → category = "COMPLETE_WITH_MINOR_ISSUES" - ELSE IF false_positives > 5 OR verification_score < 50 - → category = "FALSE_POSITIVE" (claimed done but missing code) - ELSE IF verification_score < 80 - → category = "NEEDS_REWORK" - ELSE IF checked_tasks == 0 - → category = "NOT_STARTED" - ELSE - → category = "IN_PROGRESS" - - - Store result: - - story_id - - verification_score - - category - - false_positive_count - - false_negative_count - - current_status (from sprint-status.yaml) - - recommended_status - - - Increment counters based on category - Add false_positive_count to total - Add total_tasks to total_tasks_verified - - → {{category}} ({{verification_score}}/100, {{false_positives}} false positives) - - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Validation Complete -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -**Stories Validated:** {{story_count}} -**Total Tasks Verified:** {{total_tasks_verified}} -**Total False Positives:** {{total_false_positive_tasks}} - - - - - Filter stories where: - - category = "FALSE_POSITIVE" OR - - category = "NEEDS_REWORK" OR - - false_positives > 3 - - - Count {{problem_story_count}} - - - -đŸ›Ąī¸ **Code Quality Review** - -Found {{problem_story_count}} stories with quality issues. -Running multi-agent review on files from these stories... - - - - Extract file list from story Dev Agent Record - - - Run /multi-agent-review on files: - - Security audit - - Silent failure detection - - Architecture compliance - - Type safety check - - - Categorize review findings by severity - Add to story's issue list - - - - - - ✅ No problem stories found - all code quality looks good! - - - - - -🔗 **Integration Verification** - -Checking for regressions and broken dependencies... - - - For stories marked "VERIFIED_COMPLETE": - 1. Extract service dependencies from story - 2. Check if dependent services still exist - 3. Run integration tests if they exist - 4. Check for API contract breaking changes - - - Detect overlaps: - - Multiple stories implementing same feature - - Duplicate files created - - Conflicting implementations - - - -**Regressions Found:** {{regression_count}} -**Overlaps Detected:** {{overlap_count}} -**Integration Tests:** {{integration_tests_run}} ({{integration_tests_passing}} passing) - - - - - -# Comprehensive Story Validation Report - -**Generated:** {{date}} -**Stories Validated:** {{story_count}} -**Validation Depth:** {{validation_depth}} -**Epic Filter:** {{epic_filter}} {{#if_no_filter}}(all epics){{/if}} - ---- - -## Executive Summary - -**Overall Health Score:** {{overall_health_score}}/100 - -**Story Categories:** -- ✅ **VERIFIED_COMPLETE:** {{verified_complete}} ({{verified_complete_pct}}%) -- âš ī¸ **NEEDS_REWORK:** {{needs_rework}} ({{needs_rework_pct}}%) -- ❌ **FALSE_POSITIVES:** {{false_positives}} ({{false_positives_pct}}%) -- 🔄 **IN_PROGRESS:** {{in_progress}} ({{in_progress_pct}}%) -- 📋 **NOT_STARTED:** {{not_started}} ({{not_started_pct}}%) - -**Task Verification:** -- Total tasks verified: {{total_tasks_verified}} -- False positive tasks: {{total_false_positive_tasks}} ({{false_positive_rate}}%) -- False negative tasks: {{total_false_negative_tasks}} - -**Code Quality:** -- CRITICAL issues: {{critical_issues_total}} -- HIGH issues: {{high_issues_total}} -- Files reviewed: {{files_reviewed}} - ---- - -## ❌ False Positive Stories (Claimed Done, Not Implemented) - -{{#each false_positive_stories}} -### {{this.story_id}} (Score: {{this.verification_score}}/100) - -**Current Status:** {{this.current_status}} -**Recommended:** in-progress or ready-for-dev - -**Issues:** -{{#each this.false_positive_tasks}} -- [ ] {{this.task}} - - Evidence: {{this.evidence}} -{{/each}} - -**Action Required:** -- Uncheck {{this.false_positive_count}} tasks -- Implement missing code -- Update sprint-status.yaml to in-progress -{{/each}} - -**Total:** {{false_positive_stories_count}} stories - ---- - -## âš ī¸ Stories Needing Rework - -{{#each needs_rework_stories}} -### {{this.story_id}} (Score: {{this.verification_score}}/100) - -**Issues:** -- {{this.false_positive_count}} false positive tasks -- {{this.critical_issue_count}} CRITICAL code quality issues -- {{this.high_issue_count}} HIGH priority issues - -**Recommended:** -1. Fix CRITICAL issues first -2. Implement {{this.false_positive_count}} missing tasks -3. Re-run validation -{{/each}} - -**Total:** {{needs_rework_count}} stories - ---- - -## ✅ Verified Complete Stories - -{{#each verified_complete_stories}} -- {{this.story_id}} ({{this.verification_score}}/100) -{{/each}} - -**Total:** {{verified_complete_count}} stories (production-ready) - ---- - -## 📊 Epic Breakdown - -{{#each epic_summary}} -### Epic {{this.epic_num}} - -**Stories:** {{this.total_count}} -**Verified Complete:** {{this.verified_count}} ({{this.verified_pct}}%) -**False Positives:** {{this.false_positive_count}} -**Needs Rework:** {{this.needs_rework_count}} - -**Health Score:** {{this.health_score}}/100 -{{/each}} - ---- - -## đŸŽ¯ Recommended Actions - -### Immediate (CRITICAL) - -{{#if false_positive_stories_count > 0}} -**Fix {{false_positive_stories_count}} False Positive Stories:** - -{{#each false_positive_stories limit=10}} -1. {{this.story_id}}: Update status to in-progress, implement {{this.false_positive_count}} missing tasks -{{/each}} - -{{#if false_positive_stories_count > 10}} -... and {{false_positive_stories_count - 10}} more (see full list above) -{{/if}} -{{/if}} - -### Short-term (HIGH Priority) - -{{#if needs_rework_count > 0}} -**Address {{needs_rework_count}} Stories Needing Rework:** -- Fix {{critical_issues_total}} CRITICAL code quality issues -- Implement missing tasks -- Re-validate after fixes -{{/if}} - -### Maintenance (MEDIUM Priority) - -{{#if false_negative_count > 0}} -**Update {{false_negative_count}} False Negative Tasks:** -- Mark complete (code exists but checkbox unchecked) -- Low impact, can batch update -{{/if}} - ---- - -## 💰 Cost Analysis - -**Validation Run:** -- Stories validated: {{story_count}} -- API tokens used: ~{{tokens_used}}K -- Cost: ~${{cost}} - -**Remediation Estimate:** -- False positives: {{false_positive_stories_count}} × 3h = {{remediation_hours_fp}}h -- Needs rework: {{needs_rework_count}} × 2h = {{remediation_hours_rework}}h -- **Total:** {{total_remediation_hours}}h estimated work - ---- - -## 📅 Next Steps - -1. **Fix false positive stories** ({{false_positive_stories_count}} stories) -2. **Address CRITICAL issues** ({{critical_issues_total}} issues) -3. **Re-run validation** on fixed stories -4. **Update sprint-status.yaml** with verified statuses -5. **Run weekly validation** to prevent future drift - ---- - -**Generated by:** /validate-all-stories workflow -**Validation Engine:** task-verification-engine.py v2.0 -**Multi-Agent Review:** {{multi_agent_review_enabled}} - - - - - -🔧 **Auto-Fix Mode Enabled** - -Applying automatic fixes: -1. Update false negative checkboxes (code exists → mark [x]) -2. Update sprint-status.yaml with verified statuses -3. Add validation scores to story files - - - - Update story file: Change [ ] to [x] for verified tasks - ✓ {{story_id}}: Checked {{task_count}} false negative tasks - - - - Update sprint-status.yaml using sprint-status-updater.py - ✓ {{story_id}}: {{old_status}} → {{new_status}} - - - -✅ Auto-fix complete - - {{false_negatives_fixed}} tasks checked - - {{statuses_updated}} story statuses updated - - - - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -COMPREHENSIVE VALIDATION COMPLETE -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -**Overall Health:** {{overall_health_score}}/100 - -{{#if overall_health_score >= 90}} -✅ **EXCELLENT** - Platform is production-ready -{{else if overall_health_score >= 75}} -âš ī¸ **GOOD** - Minor issues to address before production -{{else if overall_health_score >= 60}} -âš ī¸ **NEEDS WORK** - Significant rework required -{{else}} -❌ **CRITICAL** - Major quality issues found -{{/if}} - -**Top Priorities:** -1. Fix {{false_positive_stories_count}} false positive stories -2. Address {{critical_issues_total}} CRITICAL code quality issues -3. Complete {{in_progress_count}} in-progress stories -4. Re-validate after fixes - -**Full Report:** {{default_output_file}} -**Summary JSON:** {{validation_summary_file}} - -**Next Command:** - /validate-story # Deep-dive on specific story - /validate-all-stories --epic 16e # Re-validate specific epic - - - - diff --git a/src/modules/bmm/workflows/4-implementation/validate-all-stories/workflow.yaml b/src/modules/bmm/workflows/4-implementation/validate-all-stories/workflow.yaml deleted file mode 100644 index 638890fc..00000000 --- a/src/modules/bmm/workflows/4-implementation/validate-all-stories/workflow.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: validate-all-stories -description: "Comprehensive audit of ALL stories: verify tasks against codebase, run code quality reviews, check integrations. The bulletproof audit for production readiness." -author: "BMad" -version: "1.0.0" - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -implementation_artifacts: "{config_source}:implementation_artifacts" -story_dir: "{implementation_artifacts}" - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-all-stories" -instructions: "{installed_path}/instructions.xml" - -# Input variables -variables: - validation_depth: "deep" # Options: "quick" (tasks only), "deep" (tasks + review), "comprehensive" (full integration) - parallel_validation: true # Run story validations in parallel for speed - fix_mode: false # If true, auto-fix false negatives and update statuses - epic_filter: "" # Optional: Only validate stories from specific epic (e.g., "16e") - -# Tools -task_verification_script: "{project-root}/scripts/lib/task-verification-engine.py" -sprint_status_updater: "{project-root}/scripts/lib/sprint-status-updater.py" - -# Sub-workflow -validate_story_workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-story/workflow.yaml" - -# Output -default_output_file: "{story_dir}/.comprehensive-validation-report-{date}.md" -validation_summary_file: "{story_dir}/.validation-summary-{date}.json" - -standalone: true -web_bundle: false diff --git a/src/modules/bmm/workflows/4-implementation/validate-epic-status/instructions.xml b/src/modules/bmm/workflows/4-implementation/validate-epic-status/instructions.xml deleted file mode 100644 index 94b10823..00000000 --- a/src/modules/bmm/workflows/4-implementation/validate-epic-status/instructions.xml +++ /dev/null @@ -1,302 +0,0 @@ - - The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - You MUST have already loaded and processed: {installed_path}/workflow.yaml - This is VALIDATION-ONLY mode - NO implementation, only status correction - Uses same logic as batch-super-dev but READS instead of WRITES code - - - Check if {{epic_num}} was provided - - - Which epic should I validate? (e.g., 19, 16d, 16e, 9b) - Store response as {{epic_num}} - - - Load {{sprint_status_file}} - - - ❌ sprint-status.yaml not found at: {{sprint_status_file}} - -Run /bmad:bmm:workflows:sprint-planning to create it first. - - HALT - - - Search for epic-{{epic_num}} entry in sprint_status_file - Extract all story entries for epic-{{epic_num}} (pattern: {{epic_num}}-*) - Count stories found in sprint-status.yaml for this epic - - 🔍 **Validating Epic {{epic_num}}** - -Found {{story_count}} stories in sprint-status.yaml -Scanning story files for REALITY check... - - - - - This is where we determine TRUTH - not from status fields, but from actual file analysis - - For each story in epic (from sprint-status.yaml): - 1. Build story file path: {{story_dir}}/{{story_key}}.md - 2. Check if file exists - 3. If exists, read FULL file - 4. Analyze file content - - - For each story file, extract: - - File size in KB - - Total task count (count all "- [ ]" and "- [x]" lines) - - Checked task count (count "- [x]" lines) - - Completion rate (checked / total * 100) - - Explicit Status: field (if present) - - Has proper BMAD structure (12 sections) - - Section count (count ## headings) - - - 📊 **Story File Quality Analysis** - -Analyzing {{story_count}} story files... - - - For each story, classify quality: - VALID: - - File size >= 10KB - - Total tasks >= 5 - - Has task list structure - - INVALID: - - File size < 10KB (incomplete story) - - Total tasks < 5 (not detailed enough) - - File missing entirely - - - Store results as {{story_quality_map}} - - Quality Summary: - Valid stories: {{valid_count}}/{{story_count}} - Invalid stories: {{invalid_count}} - Missing files: {{missing_count}} - - - - - Run git log to find commits mentioning epic stories: - Command: git log --oneline --since={{git_commit_lookback_days}} days ago - - - Parse commit messages for story IDs matching pattern: {{epic_num}}-\d+[a-z]? - Build map of story_id → commit_count - - Git Commit Evidence: - Stories with commits: {{stories_with_commits_count}} - Stories without commits: {{stories_without_commits_count}} - - - - - Search {{story_dir}} for files: - - .epic-{{epic_num}}-completion-report.md - - .batch-super-dev-{{epic_num}}-progress.yaml - - - - Parse completed_stories list from progress file OR - Parse ✅ story entries from completion report - Store as {{autonomous_completed_stories}} - - 📋 Autonomous Report Found: - {{autonomous_completed_count}} stories marked complete - - - - - â„šī¸ No autonomous completion report found (manual epic) - - - - - Use MULTIPLE sources of truth, not just Status: field - - For each story in epic, determine correct status using this logic: - - - Priority 1: Autonomous completion report - IF story in autonomous_completed_stories - → Status = "done" (VERY HIGH confidence) - - Priority 2: Task completion rate + file quality - IF completion_rate >= 90% AND file is VALID (>10KB, >5 tasks) - → Status = "done" (HIGH confidence) - - IF completion_rate 50-89% AND file is VALID - → Status = "in-progress" (MEDIUM confidence) - - IF completion_rate < 50% AND file is VALID - → Status = "ready-for-dev" (MEDIUM confidence) - - Priority 3: Explicit Status: field (if no other evidence) - IF Status: field exists AND matches above inferences - → Use it (MEDIUM confidence) - - IF Status: field conflicts with task completion - → Prefer task completion (tasks are ground truth) - - Priority 4: Git commits (supporting evidence) - IF 3+ commits + task completion >=90% - → Upgrade confidence to VERY HIGH - - IF 1-2 commits but task completion <50% - → Status = "in-progress" (work started but not done) - - Quality Gates: - IF file size < 10KB OR total tasks < 5 - → DOWNGRADE status (can't be "done" if file is incomplete) - → Mark as "ready-for-dev" (story needs proper creation) - → Flag for regeneration with /create-story - - Missing Files: - IF story file doesn't exist - → Status = "backlog" (story not created yet) - - - Build map of story_id → inferred_status with evidence and confidence - - 📊 **Status Inference Complete** - -Stories to update: -{{#each_story_needing_update}} - {{story_id}}: - Current: {{current_status_in_yaml}} - Inferred: {{inferred_status}} - Confidence: {{confidence}} - Evidence: {{evidence_summary}} - Quality: {{file_size_kb}}KB, {{total_tasks}} tasks, {{completion_rate}}% done -{{/each}} - - - - - - 📝 **REPORT-ONLY MODE** - No changes will be made - -Recommendations saved to: {{default_output_file}} - - Write detailed report to {{default_output_file}} - EXIT workflow - - - - 🔧 **FIX MODE** - Updating sprint-status.yaml... - -Backing up to: .sprint-status-backups/ - - - Create backup of {{sprint_status_file}} - For each story needing update: - 1. Find story entry in development_status section - 2. Update status to inferred_status - 3. Add comment: "✅ Validated {{date}} - {{evidence_summary}}" - 4. Preserve all other content and structure - - - Update epic-{{epic_num}} status based on story completion: - IF all stories have status "done" AND all are valid files - → epic status = "done" - - IF any stories "in-progress" OR "review" - → epic status = "in-progress" - - IF all stories "backlog" OR "ready-for-dev" - → epic status = "backlog" - - - Update last_verified timestamp in header - Save {{sprint_status_file}} - - ✅ **sprint-status.yaml Updated** - -Applied {{updates_count}} story status corrections -Epic {{epic_num}}: {{old_epic_status}} → {{new_epic_status}} - -Backup: {{backup_path}} - - - - - - Flag stories with issues: - - Missing story files (in sprint-status.yaml but no .md file) - - Invalid files (< 10KB or < 5 tasks) - - Conflicting evidence (Status: says done, tasks unchecked) - - Poor quality (no BMAD sections) - - - âš ī¸ **Problem Stories Requiring Attention:** - -{{#if_missing_files}} -**Missing Files ({{missing_count}}):** -{{#each_missing}} - - {{story_id}}: Referenced in sprint-status.yaml but file not found - Action: Run /create-story OR remove from sprint-status.yaml -{{/each}} -{{/if}} - -{{#if_invalid_quality}} -**Invalid Quality ({{invalid_count}}):** -{{#each_invalid}} - - {{story_id}}: {{file_size_kb}}KB, {{total_tasks}} tasks - Action: Regenerate with /create-story-with-gap-analysis -{{/each}} -{{/if}} - -{{#if_conflicting_evidence}} -**Conflicting Evidence ({{conflict_count}}):** -{{#each_conflict}} - - {{story_id}}: Status: says "{{status_field}}" but {{completion_rate}}% tasks checked - Action: Manual review recommended -{{/each}} -{{/if}} - - - - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Epic {{epic_num}} Validation Complete -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -**Epic Status:** {{epic_status}} - -**Stories:** - Done: {{done_count}} - In-Progress: {{in_progress_count}} - Review: {{review_count}} - Ready-for-Dev: {{ready_count}} - Backlog: {{backlog_count}} - -**Quality:** - Valid: {{valid_count}} (>=10KB, >=5 tasks) - Invalid: {{invalid_count}} (poor quality) - Missing: {{missing_count}} (file not found) - -**Updates Applied:** {{updates_count}} - -**Next Steps:** -{{#if_invalid_count_gt_0}} - 1. Regenerate {{invalid_count}} invalid stories with /create-story -{{/if}} -{{#if_missing_count_gt_0}} - 2. Create {{missing_count}} missing story files OR remove from sprint-status.yaml -{{/if}} -{{#if_done_count_eq_story_count}} - 3. Epic complete! Consider running /retrospective -{{/if}} -{{#if_in_progress_count_gt_0}} - 3. Continue with in-progress stories: /dev-story {{first_in_progress}} -{{/if}} - - - 💾 Detailed report saved to: {{default_output_file}} - - - diff --git a/src/modules/bmm/workflows/4-implementation/validate-epic-status/workflow.yaml b/src/modules/bmm/workflows/4-implementation/validate-epic-status/workflow.yaml deleted file mode 100644 index 620c0db2..00000000 --- a/src/modules/bmm/workflows/4-implementation/validate-epic-status/workflow.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: validate-epic-status -description: "Validate and fix sprint-status.yaml for a single epic. Scans story files for task completion, validates quality (>10KB, proper tasks), checks git commits, updates sprint-status.yaml to match REALITY." -author: "BMad" -version: "1.0.0" - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -implementation_artifacts: "{config_source}:implementation_artifacts" -story_dir: "{implementation_artifacts}" - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-epic-status" -instructions: "{installed_path}/instructions.xml" - -# Inputs -variables: - epic_num: "" # User provides (e.g., "19", "16d", "16e") - sprint_status_file: "{implementation_artifacts}/sprint-status.yaml" - validation_mode: "fix" # Options: "report-only", "fix", "strict" - -# Validation criteria -validation_rules: - min_story_size_kb: 10 # Stories should be >= 10KB - min_tasks_required: 5 # Stories should have >= 5 tasks - completion_threshold: 90 # 90%+ tasks checked = "done" - git_commit_lookback_days: 30 # Search last 30 days for commits - -# Output -default_output_file: "{story_dir}/.epic-{epic_num}-validation-report.md" - -standalone: true -web_bundle: false diff --git a/src/modules/bmm/workflows/4-implementation/validate-story-deep/instructions.xml b/src/modules/bmm/workflows/4-implementation/validate-story-deep/instructions.xml deleted file mode 100644 index 7b9825f1..00000000 --- a/src/modules/bmm/workflows/4-implementation/validate-story-deep/instructions.xml +++ /dev/null @@ -1,370 +0,0 @@ - - The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - You MUST have already loaded and processed: {installed_path}/workflow.yaml - This uses HAIKU AGENTS to read actual code and verify task completion - NOT regex patterns - - - Load story file from {{story_file}} - - - ❌ Story file not found: {{story_file}} - HALT - - - Extract story metadata: - - Story ID from filename - - Epic number from "Epic:" field - - Current status from "Status:" or "**Status:**" field - - Files created/modified from Dev Agent Record section - - - Extract ALL tasks (pattern: "- [ ]" or "- [x]"): - - Parse checkbox state (checked/unchecked) - - Extract task text - - Count total, checked, unchecked - - - 📋 **Deep Story Validation: {{story_id}}** - -**Epic:** {{epic_num}} -**Current Status:** {{current_status}} -**Tasks:** {{checked_count}}/{{total_count}} checked -**Files Referenced:** {{file_count}} - -**Validation Method:** Haiku agents read actual code -**Cost Estimate:** ~$0.13 for this story - -Starting task-by-task verification... - - - - - Spawn ONE Haiku agent to verify ALL tasks (avoids 50x agent startup overhead!) - - Spawning Haiku verification agent for {{total_count}} tasks... - - - - Verify all {{total_count}} story tasks - -You are verifying ALL tasks for this user story by reading actual code. - -**Story:** {{story_id}} -**Epic:** {{epic_num}} -**Total Tasks:** {{total_count}} - -**Files from Story (Dev Agent Record):** -{{#each file_list}} -- {{this}} -{{/each}} - -**Tasks to Verify:** - -{{#each task_list}} -{{@index}}. [{{#if this.checked}}x{{else}} {{/if}}] {{this.text}} -{{/each}} - ---- - -**Your Job:** - -For EACH task above: - -1. **Find relevant files** - Use Glob to find files mentioned in task -2. **Read the files** - Use Read tool to examine actual code -3. **Verify implementation:** - - Is code real or stubs/TODOs? - - Is there error handling? - - Multi-tenant isolation (dealerId filters)? - - Are there tests? - - Does it match task description? - -4. **Make judgment for each task** - -**Output Format - JSON array with one entry per task:** - -```json -{ - "story_id": "{{story_id}}", - "total_tasks": {{total_count}}, - "tasks": [ - { - "task_number": 0, - "task_text": "Implement UserService", - "is_checked": true, - "actually_complete": false, - "confidence": "high", - "evidence": "File exists but has 'TODO: Implement findById' on line 45, tests not found", - "issues_found": ["Stub implementation", "Missing tests", "No dealerId filter"], - "recommendation": "Implement real logic, add tests, add multi-tenant isolation" - }, - { - "task_number": 1, - "task_text": "Add error handling", - "is_checked": true, - "actually_complete": true, - "confidence": "very_high", - "evidence": "Try-catch blocks in UserService.ts:67-89, proper error logging, tests verify error cases", - "issues_found": [], - "recommendation": "None - task complete" - } - ] -} -``` - -**Be efficient:** Read files once, verify all tasks, return comprehensive JSON. - - general-purpose - - - Parse agent response (extract JSON) - - For each task result: - - Determine verification_status (correct/false_positive/false_negative) - - Categorize into verified_complete, false_positives, false_negatives lists - - Count totals - - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Task Verification Complete -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -**✅ Verified Complete:** {{verified_complete_count}} -**❌ False Positives:** {{false_positive_count}} (checked but code missing/poor) -**âš ī¸ False Negatives:** {{false_negative_count}} (unchecked but code exists) -**❓ Uncertain:** {{uncertain_count}} - -**Verification Score:** {{verification_score}}/100 - - - - - Calculate scores: - - Task accuracy: (correct / total) × 100 - - False positive penalty: false_positive_count × -5 - - Overall score: max(0, task_accuracy + penalty) - - - Determine story category: - IF score >= 95 AND false_positives == 0 - → VERIFIED_COMPLETE - ELSE IF score >= 80 AND false_positives <= 2 - → COMPLETE_WITH_MINOR_ISSUES - ELSE IF false_positives > 5 OR score < 50 - → FALSE_POSITIVE (story claimed done but significant missing code) - ELSE IF false_positives > 0 - → NEEDS_REWORK - ELSE - → IN_PROGRESS - - - Determine recommended status: - VERIFIED_COMPLETE → "done" - COMPLETE_WITH_MINOR_ISSUES → "review" - FALSE_POSITIVE → "in-progress" or "ready-for-dev" - NEEDS_REWORK → "in-progress" - IN_PROGRESS → "in-progress" - - - -📊 **STORY HEALTH ASSESSMENT** - -**Current Status:** {{current_status}} -**Recommended Status:** {{recommended_status}} -**Overall Score:** {{overall_score}}/100 - -**Category:** {{category}} - -{{#if category == "VERIFIED_COMPLETE"}} -✅ **Story is production-ready** -- All tasks verified complete -- Code quality confirmed -- No significant issues found -{{/if}} - -{{#if category == "FALSE_POSITIVE"}} -❌ **Story claimed done but has significant missing code** -- {{false_positive_count}} tasks checked but not implemented -- Verification score: {{overall_score}}/100 (< 50% = false positive) -- Action: Update status to in-progress, implement missing tasks -{{/if}} - -{{#if category == "NEEDS_REWORK"}} -âš ī¸ **Story needs rework before marking complete** -- {{false_positive_count}} tasks with missing/poor code -- Issues found in verification -- Action: Fix issues, re-verify -{{/if}} - - - - - -# Story Validation Report: {{story_id}} - -**Generated:** {{date}} -**Validation Method:** LLM-powered deep verification (Haiku 4.5) -**Overall Score:** {{overall_score}}/100 -**Category:** {{category}} - ---- - -## Summary - -**Story:** {{story_id}} -**Epic:** {{epic_num}} -**Current Status:** {{current_status}} -**Recommended Status:** {{recommended_status}} - -**Task Verification:** -- Total: {{total_count}} -- Checked: {{checked_count}} -- Verified Complete: {{verified_complete_count}} -- False Positives: {{false_positive_count}} -- False Negatives: {{false_negative_count}} - ---- - -## Verification Details - -{{#if false_positive_count > 0}} -### ❌ False Positives (CRITICAL - Code Claims vs Reality) - -{{#each false_positives}} -**Task {{@index + 1}}:** {{this.task}} -**Claimed:** [x] Complete -**Reality:** Code missing or stub implementation - -**Evidence:** -{{this.evidence}} - -**Issues Found:** -{{#each this.issues_found}} -- {{this}} -{{/each}} - -**Recommendation:** {{this.recommendation}} - ---- -{{/each}} -{{/if}} - -{{#if false_negative_count > 0}} -### âš ī¸ False Negatives (Unchecked But Working) - -{{#each false_negatives}} -**Task {{@index + 1}}:** {{this.task}} -**Status:** [ ] Unchecked -**Reality:** Code exists and working - -**Evidence:** -{{this.evidence}} - -**Recommendation:** Mark task as complete [x] - ---- -{{/each}} -{{/if}} - -{{#if verified_complete_count > 0}} -### ✅ Verified Complete Tasks - -{{verified_complete_count}} tasks verified with actual code review. - -{{#if show_all_verified}} -{{#each verified_complete}} -- {{this.task}} ({{this.confidence}} confidence) -{{/each}} -{{/if}} -{{/if}} - ---- - -## Final Verdict - -**Overall Score:** {{overall_score}}/100 - -{{#if category == "VERIFIED_COMPLETE"}} -✅ **VERIFIED COMPLETE** - -This story is production-ready: -- All {{total_count}} tasks verified complete -- Code quality confirmed through review -- No significant issues found -- Status "done" is accurate - -**Action:** None needed - story is solid -{{/if}} - -{{#if category == "FALSE_POSITIVE"}} -❌ **FALSE POSITIVE - Story NOT Actually Complete** - -**Problems:** -- {{false_positive_count}} tasks checked but code missing/stubbed -- Verification score: {{overall_score}}/100 (< 50%) -- Story marked "{{current_status}}" but significant work remains - -**Required Actions:** -1. Update sprint-status.yaml: {{story_id}} → in-progress -2. Uncheck {{false_positive_count}} false positive tasks -3. Implement missing code -4. Re-run validation after implementation - -**Estimated Rework:** {{estimated_rework_hours}} hours -{{/if}} - -{{#if category == "NEEDS_REWORK"}} -âš ī¸ **NEEDS REWORK** - -**Problems:** -- {{false_positive_count}} tasks with quality issues -- Some code exists but has problems (TODOs, missing features, poor quality) - -**Required Actions:** -{{#each action_items}} -- [ ] {{this}} -{{/each}} - -**Estimated Fix Time:** {{estimated_fix_hours}} hours -{{/if}} - -{{#if category == "IN_PROGRESS"}} -🔄 **IN PROGRESS** (accurate status) - -- {{checked_count}}/{{total_count}} tasks complete -- {{unchecked_count}} tasks remaining -- Current status reflects reality - -**No action needed** - continue implementation -{{/if}} - ---- - -**Validation Cost:** ~${{validation_cost}} -**Agent Model:** {{agent_model}} -**Tasks Verified:** {{total_count}} - - - - - - Story status should be updated from "{{current_status}}" to "{{recommended_status}}". Update sprint-status.yaml? (y/n) - - - Update sprint-status.yaml: - python3 scripts/lib/sprint-status-updater.py --epic {{epic_num}} --mode fix - - - Add validation note to story file Dev Agent Record - - ✅ Updated {{story_id}}: {{current_status}} → {{recommended_status}} - - - - - ✅ Story status is accurate - no changes needed - - - - diff --git a/src/modules/bmm/workflows/4-implementation/validate-story-deep/workflow.yaml b/src/modules/bmm/workflows/4-implementation/validate-story-deep/workflow.yaml deleted file mode 100644 index 7560a449..00000000 --- a/src/modules/bmm/workflows/4-implementation/validate-story-deep/workflow.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: validate-story-deep -description: "Deep story validation using Haiku agents to read and verify actual code. Each task gets micro code review to verify implementation quality." -author: "BMad" -version: "1.0.0" - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -implementation_artifacts: "{config_source}:implementation_artifacts" -story_dir: "{implementation_artifacts}" - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-story-deep" -instructions: "{installed_path}/instructions.xml" - -# Input variables -variables: - story_file: "" # Path to story file to validate - -# Agent configuration -agent_model: "haiku" # Use Haiku 4.5 for cost efficiency ($0.13/story vs $1.50) -parallel_tasks: true # Validate tasks in parallel (faster) - -# Output -default_output_file: "{story_dir}/.validation-{story_id}-{date}.md" - -standalone: true -web_bundle: false diff --git a/src/modules/bmm/workflows/4-implementation/validate-story/instructions.xml b/src/modules/bmm/workflows/4-implementation/validate-story/instructions.xml deleted file mode 100644 index 977e5de8..00000000 --- a/src/modules/bmm/workflows/4-implementation/validate-story/instructions.xml +++ /dev/null @@ -1,395 +0,0 @@ - - The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - You MUST have already loaded and processed: {installed_path}/workflow.yaml - This performs DEEP validation - not just checkbox counting, but verifying code actually exists and works - - - Load story file from {{story_file}} - - - ❌ Story file not found: {{story_file}} - -Please provide a valid story file path. - - HALT - - - Extract story metadata: - - Story ID (from filename) - - Epic number - - Current status from Status: field - - Priority - - Estimated effort - - - Extract all tasks: - - Pattern: "- [ ]" or "- [x]" - - Count total tasks - - Count checked tasks - - Count unchecked tasks - - Calculate completion percentage - - - Extract file references from Dev Agent Record: - - Files created - - Files modified - - Files deleted - - - 📋 **Story Validation: {{story_id}}** - -**Epic:** {{epic_num}} -**Current Status:** {{current_status}} -**Tasks:** {{checked_count}}/{{total_count}} complete ({{completion_pct}}%) -**Files Referenced:** {{file_count}} - -Starting deep validation... - - - - - Use task-verification-engine.py for DEEP verification (not just file existence) - - For each task in story: - 1. Extract task text - 2. Note if checked [x] or unchecked [ ] - 3. Pass to task-verification-engine.py - 4. Receive verification result with: - - should_be_checked: true/false - - confidence: very high/high/medium/low - - evidence: list of findings - - verification_status: correct/false_positive/false_negative/uncertain - - - Categorize tasks by verification status: - - ✅ CORRECT: Checkbox matches reality - - ❌ FALSE POSITIVE: Checked but code missing/stubbed - - âš ī¸ FALSE NEGATIVE: Unchecked but code exists - - ❓ UNCERTAIN: Cannot verify (low confidence) - - - Calculate verification score: - - (correct_tasks / total_tasks) × 100 - - Penalize false positives heavily (-5 points each) - - Penalize false negatives lightly (-2 points each) - - - -🔍 **Task Verification Results** - -**Total Tasks:** {{total_count}} - -**✅ CORRECT:** {{correct_count}} tasks (checkbox matches reality) -**❌ FALSE POSITIVES:** {{false_positive_count}} tasks (checked but code missing/stubbed) -**âš ī¸ FALSE NEGATIVES:** {{false_negative_count}} tasks (unchecked but code exists) -**❓ UNCERTAIN:** {{uncertain_count}} tasks (cannot verify) - -**Verification Score:** {{verification_score}}/100 - -{{#if false_positive_count > 0}} -### ❌ False Positives (CRITICAL - Code Claims vs Reality) - -{{#each false_positives}} -**Task:** {{this.task}} -**Claimed:** [x] Complete -**Reality:** {{this.evidence}} -**Action Required:** {{this.recommended_action}} -{{/each}} -{{/if}} - -{{#if false_negative_count > 0}} -### âš ī¸ False Negatives (Unchecked but Working) - -{{#each false_negatives}} -**Task:** {{this.task}} -**Status:** [ ] Unchecked -**Reality:** {{this.evidence}} -**Recommendation:** Mark as complete [x] -{{/each}} -{{/if}} - - - - - Extract all files from Dev Agent Record file list - - - âš ī¸ No files listed in Dev Agent Record - cannot perform code review - Skip to step 4 - - - For each file: - 1. Check if file exists - 2. Read file content - 3. Check for quality issues: - - TODO/FIXME comments without GitHub issues - - any types in TypeScript - - Hardcoded values (siteId, dealerId, API keys) - - Missing error handling - - Missing multi-tenant isolation (dealerId filters) - - Missing audit logging on mutations - - Security vulnerabilities (SQL injection, XSS) - - - Run multi-agent review if files exist: - - Security audit - - Silent failure detection - - Architecture compliance - - Performance analysis - - - Categorize issues by severity: - - CRITICAL: Security, data loss, breaking changes - - HIGH: Missing features, poor quality, technical debt - - MEDIUM: Code smells, minor violations - - LOW: Style issues, nice-to-haves - - - -đŸ›Ąī¸ **Code Quality Review** - -**Files Reviewed:** {{files_reviewed}} -**Files Missing:** {{files_missing}} - -**Issues Found:** {{total_issues}} - CRITICAL: {{critical_count}} - HIGH: {{high_count}} - MEDIUM: {{medium_count}} - LOW: {{low_count}} - -{{#if critical_count > 0}} -### 🚨 CRITICAL Issues (Must Fix) - -{{#each critical_issues}} -**File:** {{this.file}} -**Issue:** {{this.description}} -**Impact:** {{this.impact}} -**Fix:** {{this.recommended_fix}} -{{/each}} -{{/if}} - -{{#if high_count > 0}} -### âš ī¸ HIGH Priority Issues - -{{#each high_issues}} -**File:** {{this.file}} -**Issue:** {{this.description}} -{{/each}} -{{/if}} - -**Code Quality Score:** {{quality_score}}/100 - - - - - Extract dependencies from story: - - Services called - - APIs consumed - - Database tables used - - Cache keys accessed - - - For each dependency: - 1. Check if dependency still exists - 2. Check if API contract is still valid - 3. Run integration tests if they exist - 4. Check for breaking changes in dependent stories - - - -🔗 **Integration Verification** - -**Dependencies Checked:** {{dependency_count}} - -{{#if broken_integrations}} -### ❌ Broken Integrations - -{{#each broken_integrations}} -**Dependency:** {{this.name}} -**Issue:** {{this.problem}} -**Likely Cause:** {{this.cause}} -**Fix:** {{this.fix}} -{{/each}} -{{/if}} - -{{#if all_integrations_ok}} -✅ All integrations verified working -{{/if}} - - - - - Calculate overall story health: - - Task verification score (0-100) - - Code quality score (0-100) - - Integration score (0-100) - - Overall score = weighted average - - - Determine recommended status: - IF verification_score >= 95 AND quality_score >= 90 AND no CRITICAL issues - → VERIFIED_COMPLETE - ELSE IF verification_score >= 80 AND quality_score >= 70 - → COMPLETE_WITH_ISSUES (document issues) - ELSE IF false_positives > 0 OR critical_issues > 0 - → NEEDS_REWORK (code missing or broken) - ELSE IF verification_score < 50 - → FALSE_POSITIVE (claimed done but not implemented) - ELSE - → IN_PROGRESS (partially complete) - - - -📊 **FINAL VERDICT** - -**Story:** {{story_id}} -**Current Status:** {{current_status}} -**Recommended Status:** {{recommended_status}} - -**Scores:** - Task Verification: {{verification_score}}/100 - Code Quality: {{quality_score}}/100 - Integration: {{integration_score}}/100 - **Overall: {{overall_score}}/100** - -**Confidence:** {{confidence_level}} - -{{#if recommended_status != current_status}} -### âš ī¸ Status Change Recommended - -**Current:** {{current_status}} -**Should Be:** {{recommended_status}} - -**Reason:** -{{status_change_reason}} -{{/if}} - - - - - -# Story Validation Report: {{story_id}} - -**Validation Date:** {{date}} -**Validation Depth:** {{validation_depth}} -**Overall Score:** {{overall_score}}/100 - ---- - -## Summary - -**Story:** {{story_id}} - {{story_title}} -**Epic:** {{epic_num}} -**Current Status:** {{current_status}} -**Recommended Status:** {{recommended_status}} - -**Task Completion:** {{checked_count}}/{{total_count}} ({{completion_pct}}%) -**Verification Score:** {{verification_score}}/100 -**Code Quality Score:** {{quality_score}}/100 - ---- - -## Task Verification Details - -{{task_verification_output}} - ---- - -## Code Quality Review - -{{code_quality_output}} - ---- - -## Integration Verification - -{{integration_output}} - ---- - -## Recommended Actions - -{{#if critical_issues}} -### Priority 1: Fix Critical Issues (BLOCKING) -{{#each critical_issues}} -- [ ] {{this.file}}: {{this.description}} -{{/each}} -{{/if}} - -{{#if false_positives}} -### Priority 2: Fix False Positives (Code Claims vs Reality) -{{#each false_positives}} -- [ ] {{this.task}} - {{this.evidence}} -{{/each}} -{{/if}} - -{{#if high_issues}} -### Priority 3: Address High Priority Issues -{{#each high_issues}} -- [ ] {{this.file}}: {{this.description}} -{{/each}} -{{/if}} - -{{#if false_negatives}} -### Priority 4: Update Task Checkboxes (Low Impact) -{{#each false_negatives}} -- [ ] Mark complete: {{this.task}} -{{/each}} -{{/if}} - ---- - -## Next Steps - -{{#if recommended_status == "VERIFIED_COMPLETE"}} -✅ **Story is verified complete and production-ready** -- Update sprint-status.yaml: {{story_id}} = done -- No further action required -{{/if}} - -{{#if recommended_status == "NEEDS_REWORK"}} -âš ī¸ **Story requires rework before marking complete** -- Fix {{critical_count}} CRITICAL issues -- Address {{false_positive_count}} false positive tasks -- Re-run validation after fixes -{{/if}} - -{{#if recommended_status == "FALSE_POSITIVE"}} -❌ **Story is marked done but not actually implemented** -- Verification score: {{verification_score}}/100 (< 50%) -- Update sprint-status.yaml: {{story_id}} = in-progress or ready-for-dev -- Implement missing tasks before claiming done -{{/if}} - ---- - -**Generated by:** /validate-story workflow -**Validation Engine:** task-verification-engine.py v2.0 - - - - - Apply recommended status change to sprint-status.yaml? (y/n) - - - Update sprint-status.yaml: - - Use sprint-status-updater.py - - Update {{story_id}} to {{recommended_status}} - - Add comment: "Validated {{date}}, score {{overall_score}}/100" - - - Update story file: - - Add validation report link to Dev Agent Record - - Add validation score to completion notes - - Update Status: field if changed - - - ✅ Updated {{story_id}} status: {{current_status}} → {{recommended_status}} - - - - â„šī¸ Status not updated. Validation report saved for reference. - - - - diff --git a/src/modules/bmm/workflows/4-implementation/validate-story/workflow.yaml b/src/modules/bmm/workflows/4-implementation/validate-story/workflow.yaml deleted file mode 100644 index 4ea2ee47..00000000 --- a/src/modules/bmm/workflows/4-implementation/validate-story/workflow.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: validate-story -description: "Deep validation of a single story: verify tasks against codebase, run code quality review, check for regressions. Produces verification report with actionable findings." -author: "BMad" -version: "1.0.0" - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -implementation_artifacts: "{config_source}:implementation_artifacts" -story_dir: "{implementation_artifacts}" - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/validate-story" -instructions: "{installed_path}/instructions.xml" - -# Input variables -variables: - story_file: "" # Path to story file (e.g., docs/sprint-artifacts/16e-6-ecs-task-definitions-tier3.md) - validation_depth: "deep" # Options: "quick" (tasks only), "deep" (tasks + code review), "comprehensive" (tasks + review + integration tests) - -# Tools -task_verification_script: "{project-root}/scripts/lib/task-verification-engine.py" - -# Output -default_output_file: "{story_dir}/.validation-{story_id}-{date}.md" - -standalone: true -web_bundle: false