auto-claude: 152-persist-tasks-during-roadmap-regeneration (#1463)
* auto-claude: subtask-1-1 - Add _load_existing_features() method to FeaturesPhase * auto-claude: subtask-1-2 - Add _merge_features() method to FeaturesPhase class - Adds _merge_features() method that combines preserved features with newly generated AI features while avoiding duplicates by ID - Preserved features take priority - if a new feature has the same ID, the new one is skipped - Includes debug logging for tracking merge statistics - Method returns merged list with preserved features first, then non-conflicting new features Co-Authored-By: Claude Opus 4.5 <[email protected]> * auto-claude: subtask-1-3 - Include preserved features in FeaturesPhase context Modified FeaturesPhase._build_context() to: - Load existing preserved features using _load_existing_features() - Include preserved feature IDs and titles in the AI agent context - Instruct the AI to generate complementary features without duplicating - Add explicit instruction to avoid generating features with same IDs This ensures the AI agent is aware of existing features during roadmap regeneration, helping it create new features that complement rather than duplicate the preserved ones. Co-Authored-By: Claude Opus 4.5 <[email protected]> * auto-claude: subtask-1-4 - Modify FeaturesPhase._validate_features() to call _merge_features() After successful validation, the method now merges preserved features (planned/in_progress/done status, linked specs, internal sources) into the final roadmap.json before returning success. * auto-claude: subtask-2-1 - Add intermediate progress print statements in FeaturesPhase Added granular progress logging in FeaturesPhase.execute() for frontend parsing: - "Generating features..." - shown before running the agent - "Prioritizing features..." - shown after agent completes - "Creating roadmap file..." - shown before validation/merge These print_status calls will be parsed by the frontend for real-time progress updates. Co-Authored-By: Claude Opus 4.5 <[email protected]> * auto-claude: subtask-2-2 - Add intermediate progress print statements in DiscoveryPhase Added 'Analyzing project...' print_status call in DiscoveryPhase.execute() to provide intermediate progress feedback between 40% and 50% of roadmap generation. Co-Authored-By: Claude Opus 4.5 <[email protected]> * auto-claude: subtask-3-1 - Enhance parseRoadmapProgress() in agent-events.ts Add 16 intermediate progress points for granular roadmap generation feedback: - Phase 1 (Project Analysis): 10%, 15%, 20%, 22%, 25% - Phase 2 (Discovery): 30%, 35%, 40%, 45%, 50% - Phase 3 (Feature Generation): 55%, 60%, 65%, 75%, 85%, 90% - Complete: 100% Progress matches backend log messages from phases.py for accurate tracking. Added safeguard to ensure progress only moves forward, never backward. Co-Authored-By: Claude Opus 4.5 <[email protected]> * auto-claude: subtask-4-3 - Add i18n translation keys for roadmap generation progress - Add roadmapGeneration.elapsed and roadmapGeneration.stillWorking keys to both EN and FR common.json files - Update RoadmapGenerationProgress.tsx to use t() for elapsed time and stall detection messages * auto-claude: subtask-5-1 - Run existing tests and fix test regressions Updated agent-events.test.ts to match new granular progress values: - PROJECT ANALYSIS: 20% → 10% - PROJECT DISCOVERY: 40% → 30% - FEATURE GENERATION: 70% → 55% Tests now pass for parseRoadmapProgress. Remaining 4 failing tests are pre-existing issues unrelated to this feature: - agent-process.test.ts: Environment-specific CLI path issue - usage-monitor.test.ts: Race condition prevention tests (3 failures) * fix: PR review issues - feature preservation bug, lint errors, and i18n Critical fixes from PR review: 1. Feature preservation data loss bug (phases.py): - Load preserved features ONCE before agent runs and store in instance var - Use stored features in _build_context() and _validate_features() - Prevents data loss when agent overwrites roadmap.json 2. Lint fixes: - Add radix parameter to parseInt() in app-logger.test.ts - Add biome-ignore for intentional control chars in download-python.cjs - Replace non-null assertions with optional chaining in tests - Add biome-ignore comments for test mock types 3. i18n fixes (RoadmapGenerationProgress.tsx): - Add translation keys for Stop button text - Add translation keys for phase labels and descriptions - Update en/common.json and fr/common.json with new keys Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: ruff errors in phases.py - undefined name and f-string - Remove unnecessary f-string prefix (F541) - Fix undefined `preserved_features` to `self._preserved_features` (F821) Co-Authored-By: Claude Opus 4.5 <[email protected]> * style: fix ruff format - wrap long line in phases.py Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: address PR review findings 1. phases.py: Add try-except for OSError on file write after merge 2. RoadmapGenerationProgress.tsx: - Add isMounted ref pattern to prevent state update on unmounted component - Reset elapsedSeconds when generation ends 3. agent-events.ts: Make discovery progress condition more specific - Exclude error/failed logs from triggering 50% progress Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: address PR review findings - i18n, stall detection, and debug warning - Add i18n translation key for 'Progress' label (NCR-F01 MEDIUM) Added 'common:roadmapGeneration.progress' to en and fr locales - Optimize stall detection interval (NCR-F02 LOW) Use ref instead of state for lastProgressChange to avoid recreating the interval on every progress update - Add debug warning for features without IDs (NCR-F03 LOW) Warn when features lack IDs as they cannot be deduplicated Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: address code quality findings from PR review - Convert startTime state to ref to remove confusing effect dependency - Add title-based fallback deduplication for features without IDs - Add explicit upper bound cap (100) to progress values - Handle write failure gracefully by proceeding with AI-generated version - Only update stall state when value actually changes Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: address PR review quality findings and ruff formatting - Fix stall detection mount edge case with hasInitializedRef - Add preserved feature count to OSError warning message - Add phase regression prevention to parseRoadmapProgress - Fix ruff formatting issues Co-Authored-By: Claude Opus 4.5 <[email protected]> --------- Co-authored-by: Claude Opus 4.5 <[email protected]>
This commit is contained in:
committed by
StillKnotKnown
co-authored by
Claude Opus 4.5
parent
74aaec3cb6
commit
66d5111dca
@@ -510,7 +510,8 @@ Output the complete roadmap to roadmap.json.
|
||||
|
||||
# Write back the merged roadmap
|
||||
try:
|
||||
write_json_atomic(self.roadmap_file, data, indent=2)
|
||||
with open(self.roadmap_file, "w", encoding="utf-8") as f:
|
||||
json.dump(data, f, indent=2)
|
||||
debug_success(
|
||||
"roadmap_phase",
|
||||
"Merged preserved features into roadmap.json",
|
||||
|
||||
Reference in New Issue
Block a user