From 1b57ae9c6673f50285f90828805e1b20ffd8987c Mon Sep 17 00:00:00 2001 From: Maple Codex Date: Sun, 15 Feb 2026 00:39:34 +0800 Subject: [PATCH 1/6] fix(create-story): restore validate-workflow executor and conditional checklist handling --- .../create-story/checklist.md | 10 +- .../create-story/instructions.xml | 14 +- src/core/tasks/validate-workflow.xml | 135 ++++++++++++++++++ 3 files changed, 147 insertions(+), 12 deletions(-) create mode 100644 src/core/tasks/validate-workflow.xml diff --git a/src/bmm/workflows/4-implementation/create-story/checklist.md b/src/bmm/workflows/4-implementation/create-story/checklist.md index 6fc678994..1fe7c2d5c 100644 --- a/src/bmm/workflows/4-implementation/create-story/checklist.md +++ b/src/bmm/workflows/4-implementation/create-story/checklist.md @@ -51,7 +51,7 @@ This is a COMPETITION to create the **ULTIMATE story context** that makes LLM de - **Story file**: The story file to review and improve - **Workflow variables**: From workflow.yaml (implementation_artifacts, epics_file, etc.) - **Source documents**: Epics, architecture, etc. (discovered or provided) -- **Validation framework**: `validate-workflow.xml` (handles checklist execution) +- **Validation framework**: `validate-workflow.xml` (handles checklist execution and report generation) --- @@ -64,8 +64,12 @@ You will systematically re-do the entire story creation process, but with a crit 1. **Load the workflow configuration**: `{installed_path}/workflow.yaml` for variable inclusion 2. **Load the story file**: `{story_file_path}` (provided by user or discovered) 3. **Load validation framework**: `{project-root}/_bmad/core/tasks/validate-workflow.xml` -4. **Extract metadata**: epic_num, story_num, story_key, story_title from story file -5. **Resolve all workflow variables**: implementation_artifacts, epics_file, architecture_file, etc. +4. **Resolve variables deterministically**: + - Parse workflow.yaml key/value pairs + - For any value matching `{config_source}:key`, load the referenced config file and resolve `key` + - Resolve system path variables (for example `{project-root}`, `{installed_path}`) in every path value + - If any required variable remains unresolved, stop and request explicit user input before continuing +5. **Extract metadata**: epic_num, story_num, story_key, story_title from story file 6. **Understand current status**: What story implementation guidance is currently provided? **Note:** If running in fresh context, user should provide the story file path being reviewed. If running from create-story workflow, the validation framework will automatically discover the checklist and story file. diff --git a/src/bmm/workflows/4-implementation/create-story/instructions.xml b/src/bmm/workflows/4-implementation/create-story/instructions.xml index f9433371f..2f67a9004 100644 --- a/src/bmm/workflows/4-implementation/create-story/instructions.xml +++ b/src/bmm/workflows/4-implementation/create-story/instructions.xml @@ -280,16 +280,12 @@ testing_requirements - - previous_story_intelligence - + If previous story learnings are unavailable (for example this is story 1 in epic), set previous_story_intelligence to an explicit N/A note with reason + previous_story_intelligence - - git_intelligence_summary - + If git analysis is unavailable or not relevant, set git_intelligence_summary to an explicit N/A note with reason + git_intelligence_summary @@ -311,7 +307,7 @@ - Validate against checklist at {installed_path}/checklist.md using _bmad/core/tasks/validate-workflow.xml + Validate against checklist at {installed_path}/checklist.md using _bmad/core/tasks/validate-workflow.xml and target file {default_output_file} Save story document unconditionally diff --git a/src/core/tasks/validate-workflow.xml b/src/core/tasks/validate-workflow.xml new file mode 100644 index 000000000..7d6edccec --- /dev/null +++ b/src/core/tasks/validate-workflow.xml @@ -0,0 +1,135 @@ + + + Validate a generated document against checklist requirements with deterministic variable resolution and produce an actionable pass/fail report + + + + + + + + + + MANDATORY: Execute ALL steps in order. Do not skip any checklist item. + Always read COMPLETE files; do not sample with offsets. + Every non-N/A judgment must include concrete evidence from the document. + If a required path cannot be resolved, stop and ask for explicit user input. + Be strict and objective: no assumptions without evidence. + + + + + Load workflow yaml from input {workflow} + Resolve variables in this order: + 1) load config_source file if present + 2) resolve all {config_source}:key references + 3) resolve system path variables ({project-root}, {installed_path}) + 4) resolve system-generated values (date) + + Determine checklist path in priority order: + - explicit input {checklist} + - workflow.yaml field "validation" + - sibling file checklist.md in workflow directory + + Determine document path in priority order: + - explicit input {document} + - resolved variable {story_file} if present + - resolved variable {default_output_file} if present + + Try fuzzy discovery in implementation_artifacts: pick most likely recent .md output and state this inference explicitly + Ask user: "Which document should I validate?" and WAIT + + + + Load full checklist content + Load full target document content + Extract story metadata when available (epic_num, story_num, story_id) from document title or filename for conditional checks + Parse checklist into sections and atomic validation items + Mark items containing terms like "critical", "must", "required", "blocking" as critical checks + HALT with error: "Checklist is empty or unparsable" + + + + For every checklist item, evaluate one of: PASS, PARTIAL, FAIL, N/A + For each item: + - restate requirement in one short sentence + - if item contains explicit condition (for example "If story_num > 1") and condition is false, mark N/A with the exact reason + - locate explicit evidence in document (include line references when possible) + - consider implied coverage only when explicit text is absent + - assign verdict and rationale + - if PARTIAL/FAIL, describe impact and a concrete fix + + DO NOT SKIP ANY ITEM OR SECTION + + + + Set report path: + - use explicit input {report} when provided + - else save to target document folder as validation-report-{timestamp}.md + + Write report with the format below + + + # Validation Report + + - Document: {document} + - Checklist: {checklist} + - Workflow: {workflow} + - Date: {timestamp} + + ## Summary + - Overall pass rate: {pass_count}/{applicable_count} ({pass_percent}%) + - Critical failures: {critical_fail_count} + - Critical partials: {critical_partial_count} + - Gate decision: {PASS|FAIL} + + ## Section Results + ### {Section Name} + - PASS: {count} + - PARTIAL: {count} + - FAIL: {count} + - N/A: {count} + + For each checklist item: + - [MARK] {item} + - Evidence: {quote or line reference} + - Analysis: {why mark is correct} + - Action (if PARTIAL/FAIL): {specific remediation} + + ## Must Fix Before Proceeding + - {all critical FAIL items} + + ## Should Improve + - {all non-critical FAIL and PARTIAL items} + + ## Final Recommendation + 1. {highest-priority fix} + 2. {second-priority fix} + 3. {third-priority fix} + + + + + Present concise summary with counts and gate decision + Provide report path + State clearly that workflow should not proceed until fixes are applied + HALT and wait for user direction + + + + + HALT if workflow file cannot be loaded + HALT if checklist file cannot be loaded + HALT if target document cannot be determined after user prompt + HALT if any checklist section is skipped + + + + Never skip checklist items + Every PASS/PARTIAL/FAIL must have evidence + Use deterministic variable resolution before asking the user + Always save a validation report file + + From 9e4e37666f4538fa797c8d73624031f90d83b581 Mon Sep 17 00:00:00 2001 From: Maple Date: Sun, 15 Feb 2026 01:04:24 +0800 Subject: [PATCH 2/6] fix(create-story): address validator determinism and bot feedback --- .../create-story/checklist.md | 4 +- .../create-story/instructions.xml | 7 ++- src/core/tasks/validate-workflow.xml | 50 +++++++++++++++---- 3 files changed, 45 insertions(+), 16 deletions(-) diff --git a/src/bmm/workflows/4-implementation/create-story/checklist.md b/src/bmm/workflows/4-implementation/create-story/checklist.md index 1fe7c2d5c..545b0a7a1 100644 --- a/src/bmm/workflows/4-implementation/create-story/checklist.md +++ b/src/bmm/workflows/4-implementation/create-story/checklist.md @@ -35,7 +35,7 @@ This is a COMPETITION to create the **ULTIMATE story context** that makes LLM de - The `{project-root}/_bmad/core/tasks/validate-workflow.xml` framework will automatically: - Load this checklist file - - Load the newly created story file (`{story_file_path}`) + - Load the newly created story file (`{default_output_file}`) - Load workflow variables from `{installed_path}/workflow.yaml` - Execute the validation process @@ -62,7 +62,7 @@ You will systematically re-do the entire story creation process, but with a crit ### **Step 1: Load and Understand the Target** 1. **Load the workflow configuration**: `{installed_path}/workflow.yaml` for variable inclusion -2. **Load the story file**: `{story_file_path}` (provided by user or discovered) +2. **Load the story file**: `{default_output_file}` (or explicit `{document}` input) 3. **Load validation framework**: `{project-root}/_bmad/core/tasks/validate-workflow.xml` 4. **Resolve variables deterministically**: - Parse workflow.yaml key/value pairs diff --git a/src/bmm/workflows/4-implementation/create-story/instructions.xml b/src/bmm/workflows/4-implementation/create-story/instructions.xml index 2f67a9004..0f3ef5b78 100644 --- a/src/bmm/workflows/4-implementation/create-story/instructions.xml +++ b/src/bmm/workflows/4-implementation/create-story/instructions.xml @@ -288,9 +288,8 @@ git_intelligence_summary - - latest_tech_information - + If web research was not completed or not needed, set latest_tech_information to an explicit N/A note with reason + latest_tech_information - Validate against checklist at {installed_path}/checklist.md using _bmad/core/tasks/validate-workflow.xml and target file {default_output_file} + Run _bmad/core/tasks/validate-workflow.xml with workflow={installed_path}/workflow.yaml checklist={installed_path}/checklist.md document={default_output_file} Save story document unconditionally diff --git a/src/core/tasks/validate-workflow.xml b/src/core/tasks/validate-workflow.xml index 7d6edccec..7db351faf 100644 --- a/src/core/tasks/validate-workflow.xml +++ b/src/core/tasks/validate-workflow.xml @@ -7,16 +7,18 @@ - - + + MANDATORY: Execute ALL steps in order. Do not skip any checklist item. Always read COMPLETE files; do not sample with offsets. + If a file cannot be loaded in one read, read it in deterministic sequential chunks until full coverage is achieved and recorded. Every non-N/A judgment must include concrete evidence from the document. If a required path cannot be resolved, stop and ask for explicit user input. Be strict and objective: no assumptions without evidence. + N/A is allowed only when an explicit conditional requirement is not applicable; never use N/A due to missing evidence. @@ -38,36 +40,61 @@ - resolved variable {story_file} if present - resolved variable {default_output_file} if present - Try fuzzy discovery in implementation_artifacts: pick most likely recent .md output and state this inference explicitly Ask user: "Which document should I validate?" and WAIT + Normalize resolved workflow/checklist/document paths to absolute paths before loading files - Load full checklist content - Load full target document content - Extract story metadata when available (epic_num, story_num, story_id) from document title or filename for conditional checks - Parse checklist into sections and atomic validation items - Mark items containing terms like "critical", "must", "required", "blocking" as critical checks + Load full checklist content (use chunked sequential reads only when needed for large files, and record covered ranges) + Load full target document content (use chunked sequential reads only when needed for large files, and record covered ranges) + Extract story metadata when available (epic_num, story_num, story_id, story_key, title) from filename, heading, or frontmatter + Parse checklist into ordered sections and atomic validation items; assign each item a stable id (section_index.item_index) + Determine critical checks from explicit signals only: item-level markers ([CRITICAL], critical:true, MUST FIX) or critical section labels; do not infer criticality from generic keywords alone + Detect conditional expressions in checklist items (for example: if/when/unless + variable references) HALT with error: "Checklist is empty or unparsable" + Record metadata_gap=true and list missing metadata fields for explicit PARTIAL decisions in step 3 For every checklist item, evaluate one of: PASS, PARTIAL, FAIL, N/A + Initialize counters to zero before evaluation: + - pass_count, partial_count, fail_count, na_count + - critical_fail_count, critical_partial_count + - applicable_count, total_item_count, processed_item_count + - total_section_count, processed_section_count + For each item: - restate requirement in one short sentence - if item contains explicit condition (for example "If story_num > 1") and condition is false, mark N/A with the exact reason + - if item condition depends on missing metadata, mark PARTIAL (not N/A) and specify required metadata - locate explicit evidence in document (include line references when possible) - consider implied coverage only when explicit text is absent - assign verdict and rationale - if PARTIAL/FAIL, describe impact and a concrete fix + - update all counters immediately after each verdict + + Process sections in deterministic order and increment processed_section_count after each section completes + HALT with error: "Validation incomplete: one or more checklist sections were not processed" + HALT with error: "Validation incomplete: one or more checklist items were not processed" + Compute applicable_count = pass_count + partial_count + fail_count + Compute pass_percent using applicable_count (if 0, set pass_percent=0) + Set gate decision deterministically: + - FAIL if critical_fail_count > 0 + - FAIL if critical_partial_count > 0 + - FAIL if fail_count > 0 + - PASS otherwise DO NOT SKIP ANY ITEM OR SECTION + Generate timestamp values: + - timestamp_utc for filenames in YYYYMMDD-HHmmss (UTC) + - generated_at_utc for report display in ISO-8601 UTC + Set report path: - use explicit input {report} when provided - - else save to target document folder as validation-report-{timestamp}.md + - else save to target document folder as validation-report-{timestamp_utc}.md Write report with the format below @@ -77,7 +104,7 @@ - Document: {document} - Checklist: {checklist} - Workflow: {workflow} - - Date: {timestamp} + - Date: {generated_at_utc} ## Summary - Overall pass rate: {pass_count}/{applicable_count} ({pass_percent}%) @@ -114,6 +141,7 @@ Present concise summary with counts and gate decision Provide report path + Call out missing metadata fields that caused PARTIAL results and how to supply them State clearly that workflow should not proceed until fixes are applied HALT and wait for user direction @@ -131,5 +159,7 @@ Every PASS/PARTIAL/FAIL must have evidence Use deterministic variable resolution before asking the user Always save a validation report file + N/A is valid only for explicit conditional non-applicability + Criticality must come from explicit checklist markers or critical sections From d0985170c978b6acf3c66747c609850e54413f68 Mon Sep 17 00:00:00 2001 From: Maple Date: Sun, 15 Feb 2026 01:06:57 +0800 Subject: [PATCH 3/6] fix(create-story): clarify required vars and metadata prompt flow --- src/bmm/workflows/4-implementation/create-story/checklist.md | 5 ++++- .../workflows/4-implementation/create-story/instructions.xml | 2 +- src/core/tasks/validate-workflow.xml | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bmm/workflows/4-implementation/create-story/checklist.md b/src/bmm/workflows/4-implementation/create-story/checklist.md index 545b0a7a1..0f5075e9f 100644 --- a/src/bmm/workflows/4-implementation/create-story/checklist.md +++ b/src/bmm/workflows/4-implementation/create-story/checklist.md @@ -68,7 +68,10 @@ You will systematically re-do the entire story creation process, but with a crit - Parse workflow.yaml key/value pairs - For any value matching `{config_source}:key`, load the referenced config file and resolve `key` - Resolve system path variables (for example `{project-root}`, `{installed_path}`) in every path value - - If any required variable remains unresolved, stop and request explicit user input before continuing + - Required for this checklist flow: `{default_output_file}`, `{epics_file}`, `{architecture_file}`, `{implementation_artifacts}`, `{project-root}`, `{installed_path}` + - Optional/fallback-capable values: `{story_file}`, validation `{checklist}` input, validation `{report}` input + - Validation task input contract: `workflow` is required; `checklist`, `document`, and `report` are optional with deterministic fallback + - If any required value remains unresolved, stop and request explicit user input before continuing 5. **Extract metadata**: epic_num, story_num, story_key, story_title from story file 6. **Understand current status**: What story implementation guidance is currently provided? diff --git a/src/bmm/workflows/4-implementation/create-story/instructions.xml b/src/bmm/workflows/4-implementation/create-story/instructions.xml index 0f3ef5b78..0612001de 100644 --- a/src/bmm/workflows/4-implementation/create-story/instructions.xml +++ b/src/bmm/workflows/4-implementation/create-story/instructions.xml @@ -306,7 +306,7 @@ - Run _bmad/core/tasks/validate-workflow.xml with workflow={installed_path}/workflow.yaml checklist={installed_path}/checklist.md document={default_output_file} + Run {project-root}/_bmad/core/tasks/validate-workflow.xml with workflow={installed_path}/workflow.yaml checklist={installed_path}/checklist.md document={default_output_file} Save story document unconditionally diff --git a/src/core/tasks/validate-workflow.xml b/src/core/tasks/validate-workflow.xml index 7db351faf..773115fe3 100644 --- a/src/core/tasks/validate-workflow.xml +++ b/src/core/tasks/validate-workflow.xml @@ -52,7 +52,7 @@ Determine critical checks from explicit signals only: item-level markers ([CRITICAL], critical:true, MUST FIX) or critical section labels; do not infer criticality from generic keywords alone Detect conditional expressions in checklist items (for example: if/when/unless + variable references) HALT with error: "Checklist is empty or unparsable" - Record metadata_gap=true and list missing metadata fields for explicit PARTIAL decisions in step 3 + Ask user to provide missing metadata fields (epic_num, story_num, story_id/story_key) and WAIT before evaluating checklist items @@ -141,7 +141,6 @@ Present concise summary with counts and gate decision Provide report path - Call out missing metadata fields that caused PARTIAL results and how to supply them State clearly that workflow should not proceed until fixes are applied HALT and wait for user direction From 99c78835fb26600f7037814b5a43700b37312f54 Mon Sep 17 00:00:00 2001 From: Maple Date: Sun, 15 Feb 2026 01:28:29 +0800 Subject: [PATCH 4/6] fix(create-story): address coderabbit full-review findings --- .../create-story/checklist.md | 12 ++++++---- .../create-story/instructions.xml | 8 +++---- src/core/tasks/validate-workflow.xml | 24 ++++++++++++++----- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/bmm/workflows/4-implementation/create-story/checklist.md b/src/bmm/workflows/4-implementation/create-story/checklist.md index 0f5075e9f..991f651c2 100644 --- a/src/bmm/workflows/4-implementation/create-story/checklist.md +++ b/src/bmm/workflows/4-implementation/create-story/checklist.md @@ -35,7 +35,7 @@ This is a COMPETITION to create the **ULTIMATE story context** that makes LLM de - The `{project-root}/_bmad/core/tasks/validate-workflow.xml` framework will automatically: - Load this checklist file - - Load the newly created story file (`{default_output_file}`) + - Load the story file (`{story_file}` when provided, otherwise `{default_output_file}`) - Load workflow variables from `{installed_path}/workflow.yaml` - Execute the validation process @@ -62,15 +62,17 @@ You will systematically re-do the entire story creation process, but with a crit ### **Step 1: Load and Understand the Target** 1. **Load the workflow configuration**: `{installed_path}/workflow.yaml` for variable inclusion -2. **Load the story file**: `{default_output_file}` (or explicit `{document}` input) +2. **Load the story file**: `{story_file}` first, fallback to `{default_output_file}` (or explicit `{document}` input) 3. **Load validation framework**: `{project-root}/_bmad/core/tasks/validate-workflow.xml` 4. **Resolve variables deterministically**: + - Load config_source file if present - Parse workflow.yaml key/value pairs - - For any value matching `{config_source}:key`, load the referenced config file and resolve `key` + - For any value matching `{config_source}:key`, resolve from the loaded config source - Resolve system path variables (for example `{project-root}`, `{installed_path}`) in every path value - - Required for this checklist flow: `{default_output_file}`, `{epics_file}`, `{architecture_file}`, `{implementation_artifacts}`, `{project-root}`, `{installed_path}` - - Optional/fallback-capable values: `{story_file}`, validation `{checklist}` input, validation `{report}` input + - Required for this checklist flow: `{epics_file}`, `{architecture_file}`, `{implementation_artifacts}`, `{project-root}`, `{installed_path}`, and at least one story locator (`{story_file}` or `{default_output_file}`) + - Optional/fallback-capable values: validation `{checklist}` input and validation `{report}` input - Validation task input contract: `workflow` is required; `checklist`, `document`, and `report` are optional with deterministic fallback + - Note: create-story invoke-task passes `document={default_output_file}` explicitly, which overrides fallback discovery - If any required value remains unresolved, stop and request explicit user input before continuing 5. **Extract metadata**: epic_num, story_num, story_key, story_title from story file 6. **Understand current status**: What story implementation guidance is currently provided? diff --git a/src/bmm/workflows/4-implementation/create-story/instructions.xml b/src/bmm/workflows/4-implementation/create-story/instructions.xml index 0612001de..8ddc1c08c 100644 --- a/src/bmm/workflows/4-implementation/create-story/instructions.xml +++ b/src/bmm/workflows/4-implementation/create-story/instructions.xml @@ -280,15 +280,15 @@ testing_requirements - If previous story learnings are unavailable (for example this is story 1 in epic), set previous_story_intelligence to an explicit N/A note with reason + If previous story learnings are unavailable (for example this is story 1 in epic), set previous_story_intelligence to the canonical format: N/A: {one-line reason} previous_story_intelligence - If git analysis is unavailable or not relevant, set git_intelligence_summary to an explicit N/A note with reason + If git analysis is unavailable or not relevant, set git_intelligence_summary to the canonical format: N/A: {one-line reason} git_intelligence_summary - If web research was not completed or not needed, set latest_tech_information to an explicit N/A note with reason + If web research was not completed or not needed, set latest_tech_information to the canonical format: N/A: {one-line reason} latest_tech_information @@ -306,8 +306,8 @@ - Run {project-root}/_bmad/core/tasks/validate-workflow.xml with workflow={installed_path}/workflow.yaml checklist={installed_path}/checklist.md document={default_output_file} Save story document unconditionally + Run {project-root}/_bmad/core/tasks/validate-workflow.xml with workflow={installed_path}/workflow.yaml checklist={installed_path}/checklist.md document={default_output_file} diff --git a/src/core/tasks/validate-workflow.xml b/src/core/tasks/validate-workflow.xml index 773115fe3..82d23ac27 100644 --- a/src/core/tasks/validate-workflow.xml +++ b/src/core/tasks/validate-workflow.xml @@ -9,6 +9,7 @@ + @@ -49,10 +50,15 @@ Load full target document content (use chunked sequential reads only when needed for large files, and record covered ranges) Extract story metadata when available (epic_num, story_num, story_id, story_key, title) from filename, heading, or frontmatter Parse checklist into ordered sections and atomic validation items; assign each item a stable id (section_index.item_index) - Determine critical checks from explicit signals only: item-level markers ([CRITICAL], critical:true, MUST FIX) or critical section labels; do not infer criticality from generic keywords alone + Determine critical checks from explicit signals only: + - item-level markers: [CRITICAL], critical:true, MUST FIX + - section-level markers: headings containing CRITICAL (case-insensitive), MUST FIX, MUST-FIX, or the exact phrase "Must Fix Before Proceeding" + - XML section attributes: critical="true" or critical="yes" + - do not infer criticality from generic keywords alone + Detect conditional expressions in checklist items (for example: if/when/unless + variable references) HALT with error: "Checklist is empty or unparsable" - Ask user to provide missing metadata fields (epic_num, story_num, story_id/story_key) and WAIT before evaluating checklist items + Ask user to provide all missing referenced metadata fields (epic_num, story_num, story_id, story_key, title/story_title) and WAIT before evaluating checklist items @@ -66,7 +72,6 @@ For each item: - restate requirement in one short sentence - if item contains explicit condition (for example "If story_num > 1") and condition is false, mark N/A with the exact reason - - if item condition depends on missing metadata, mark PARTIAL (not N/A) and specify required metadata - locate explicit evidence in document (include line references when possible) - consider implied coverage only when explicit text is absent - assign verdict and rationale @@ -78,7 +83,12 @@ HALT with error: "Validation incomplete: one or more checklist items were not processed" Compute applicable_count = pass_count + partial_count + fail_count Compute pass_percent using applicable_count (if 0, set pass_percent=0) + Set gate_warning: + - "No applicable checklist items were evaluated; manual confirmation required" if applicable_count == 0 + - "N/A" otherwise + Set gate decision deterministically: + - NEEDS_REVIEW if applicable_count == 0 - FAIL if critical_fail_count > 0 - FAIL if critical_partial_count > 0 - FAIL if fail_count > 0 @@ -110,7 +120,8 @@ - Overall pass rate: {pass_count}/{applicable_count} ({pass_percent}%) - Critical failures: {critical_fail_count} - Critical partials: {critical_partial_count} - - Gate decision: {PASS|FAIL} + - Gate decision: {PASS|FAIL|NEEDS_REVIEW} + - Gate warning: {gate_warning} ## Section Results ### {Section Name} @@ -126,7 +137,7 @@ - Action (if PARTIAL/FAIL): {specific remediation} ## Must Fix Before Proceeding - - {all critical FAIL items} + - {all critical FAIL and PARTIAL items} ## Should Improve - {all non-critical FAIL and PARTIAL items} @@ -142,7 +153,8 @@ Present concise summary with counts and gate decision Provide report path State clearly that workflow should not proceed until fixes are applied - HALT and wait for user direction + Return control immediately without waiting for user direction + HALT and wait for user direction From bcb2ec5dfc65ca612f2b2e579b5c85afbe23fb87 Mon Sep 17 00:00:00 2001 From: Maple Date: Sun, 15 Feb 2026 01:29:11 +0800 Subject: [PATCH 5/6] fix(validate-workflow): clarify critical vs non-critical remediation buckets --- src/core/tasks/validate-workflow.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/tasks/validate-workflow.xml b/src/core/tasks/validate-workflow.xml index 82d23ac27..803d62679 100644 --- a/src/core/tasks/validate-workflow.xml +++ b/src/core/tasks/validate-workflow.xml @@ -137,10 +137,10 @@ - Action (if PARTIAL/FAIL): {specific remediation} ## Must Fix Before Proceeding - - {all critical FAIL and PARTIAL items} + - {all critical FAIL and critical PARTIAL items} ## Should Improve - - {all non-critical FAIL and PARTIAL items} + - {all non-critical FAIL and non-critical PARTIAL items} ## Final Recommendation 1. {highest-priority fix} From 0db123dd0b646f10f0866f2c7bae164227fc2b7d Mon Sep 17 00:00:00 2001 From: Maple Date: Sun, 15 Feb 2026 01:31:56 +0800 Subject: [PATCH 6/6] fix(validate): remove pass halt and add parse/report failure safeguards --- .../workflows/4-implementation/create-story/checklist.md | 1 + src/core/tasks/validate-workflow.xml | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bmm/workflows/4-implementation/create-story/checklist.md b/src/bmm/workflows/4-implementation/create-story/checklist.md index 991f651c2..bab1afb4e 100644 --- a/src/bmm/workflows/4-implementation/create-story/checklist.md +++ b/src/bmm/workflows/4-implementation/create-story/checklist.md @@ -69,6 +69,7 @@ You will systematically re-do the entire story creation process, but with a crit - Parse workflow.yaml key/value pairs - For any value matching `{config_source}:key`, resolve from the loaded config source - Resolve system path variables (for example `{project-root}`, `{installed_path}`) in every path value + - Resolve system-generated values (for example `{date}`) using current execution context - Required for this checklist flow: `{epics_file}`, `{architecture_file}`, `{implementation_artifacts}`, `{project-root}`, `{installed_path}`, and at least one story locator (`{story_file}` or `{default_output_file}`) - Optional/fallback-capable values: validation `{checklist}` input and validation `{report}` input - Validation task input contract: `workflow` is required; `checklist`, `document`, and `report` are optional with deterministic fallback diff --git a/src/core/tasks/validate-workflow.xml b/src/core/tasks/validate-workflow.xml index 803d62679..1463ddb70 100644 --- a/src/core/tasks/validate-workflow.xml +++ b/src/core/tasks/validate-workflow.xml @@ -9,7 +9,6 @@ - @@ -50,6 +49,8 @@ Load full target document content (use chunked sequential reads only when needed for large files, and record covered ranges) Extract story metadata when available (epic_num, story_num, story_id, story_key, title) from filename, heading, or frontmatter Parse checklist into ordered sections and atomic validation items; assign each item a stable id (section_index.item_index) + Compute parsed_item_count and expected_item_count (from raw checklist requirement markers such as - [ ], - [x], and requirement list lines) + HALT with error: "Checklist parse divergence too large (parsed={parsed_item_count}, expected~={expected_item_count}); fix checklist formatting before validation" Determine critical checks from explicit signals only: - item-level markers: [CRITICAL], critical:true, MUST FIX - section-level markers: headings containing CRITICAL (case-insensitive), MUST FIX, MUST-FIX, or the exact phrase "Must Fix Before Proceeding" @@ -107,6 +108,7 @@ - else save to target document folder as validation-report-{timestamp_utc}.md Write report with the format below + HALT with error: "Validation report could not be saved" # Validation Report @@ -153,8 +155,8 @@ Present concise summary with counts and gate decision Provide report path State clearly that workflow should not proceed until fixes are applied - Return control immediately without waiting for user direction - HALT and wait for user direction + Return control immediately and continue calling workflow execution + HALT and wait for user direction @@ -163,6 +165,7 @@ HALT if checklist file cannot be loaded HALT if target document cannot be determined after user prompt HALT if any checklist section is skipped + HALT if validation report cannot be saved