Sync functional improvements developed in revive-dev into BMAD-METHOD
fork while preserving repo-specific paths:
- Add memory-safe Claude helpers (run_claude_to_file, read_phase_tail)
that pipe output to temp files instead of bash variables, preventing
GB-scale RAM usage during long epic executions
- Add kill_orphaned_test_processes() to clean up zombie jest/vitest/
playwright/pytest processes between stories and on exit
- Replace per-call `env -u CLAUDECODE` with global `unset CLAUDECODE`
at script start for cleaner nested session support
- Port metrics resume/accumulation logic that restores counters from
existing YAML on resumed runs and accumulates duration
- Add log truncation between stories (64KB cap) to prevent unbounded
log growth across multi-story runs
- Add log persistence and cleanup trap to epic-chain.sh
- Revert regression-gate.sh test commands to direct execution (matching
revive-dev pattern)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Wrap all Claude CLI subprocess calls with `env -u CLAUDECODE` to prevent
parent env var interference with child processes (17 sites across 7 files)
- Add `flush_log_to_repo()` to epic-execute.sh for incremental log persistence
after each story completes or fails (prevents log loss on interruption)
- Add portable `run_with_timeout` utility to utils.sh and wrap all test
invocations in epic-execute.sh and regression-gate.sh with configurable
timeout (default 120s via REGRESSION_TEST_TIMEOUT)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- L1: Add checkpoint/resume capability with --resume flag
- load_checkpoint(), save_checkpoint(), clear_checkpoint() in utils.sh
- Auto-saves progress after each story, 7-day expiration
- L2: Add comprehensive --help option with grouped options and examples
- show_help() function with environment variables and file locations
- L3: Add verbose Claude output streaming
- execute_claude_verbose() for real-time output when --verbose set
- L4: Add metrics file archival to prevent unbounded growth
- Archives to metrics/archive/, keeps last 10 per epic
- L5: Add workflow file content validation
- validate_yaml_content(), validate_xml_content() with fallbacks
- Integrated into validate_workflows()
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add new utils.sh module with cross-platform support and reliability improvements:
- M1: execute_with_retry() with exponential backoff for transient failures
- M2: validate_yq() to detect Go vs Python yq versions with fallback
- M3: check_phase_completion_fuzzy() for case-insensitive signal detection
- M4: sed_inplace() for cross-platform sed (macOS/Linux compatibility)
- M5: check_branch_protection() to prevent commits to main/master
Update json-output.sh with enhanced JSON extraction using awk for multi-block
handling, normalized status comparison, and fuzzy matching fallback.
Update epic-execute.sh to source utils.sh and use cross-platform sed functions.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>