From 0db123dd0b646f10f0866f2c7bae164227fc2b7d Mon Sep 17 00:00:00 2001 From: Maple Date: Sun, 15 Feb 2026 01:31:56 +0800 Subject: [PATCH] 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