Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0412be7
fix: set language singleton early so git diff auto-detection works fo…
mashraf-222 Mar 18, 2026
d9dfb0b
fix: set language singleton early so git diff auto-detection works fo…
mashraf-222 Mar 18, 2026
0634b19
feat(07-01): make get_git_diff() language-agnostic using registry ext…
mashraf-222 Mar 18, 2026
23c9f6b
feat(07-02): add LanguageConfig dataclass and find_all_config_files()
mashraf-222 Mar 18, 2026
52894fd
test(07-02): verify find_all_functions_in_file uses registry lookup (…
mashraf-222 Mar 18, 2026
c675fee
feat(08-01): extract apply_language_config and add tests
mashraf-222 Mar 18, 2026
b4ce8be
feat(08-01): wire multi-language orchestration loop into main.py
mashraf-222 Mar 18, 2026
97e21aa
feat(08-02): extract normalize_toml_config and apply in find_all_conf…
mashraf-222 Mar 18, 2026
a3014ec
feat(08-02): add per-language error isolation in orchestration loop
mashraf-222 Mar 18, 2026
dcf366e
test(08-02): add summary logging tests for orchestration results
mashraf-222 Mar 18, 2026
8ca57b2
docs(08-02): complete error isolation and config normalization plan
mashraf-222 Mar 18, 2026
da2704c
docs(08): create gap closure plan for CLI path routing
mashraf-222 Mar 18, 2026
ee7ef5e
docs(08): revise 08-03 plan based on checker feedback
mashraf-222 Mar 18, 2026
87fda32
fix(08): revise plan 03 based on checker feedback
mashraf-222 Mar 18, 2026
983d3bb
feat(08-03): add --file language filtering to multi-language orchestr…
mashraf-222 Mar 18, 2026
1b56fd3
test(08-03): add CLI path routing tests for --file, --all, and no-flags
mashraf-222 Mar 18, 2026
467adfd
test(09-02): add failing tests for unconfigured language detection
mashraf-222 Mar 18, 2026
69a661d
feat(09-02): add unconfigured language auto-detection and config crea…
mashraf-222 Mar 18, 2026
06c33c2
test(10-01): fill Python unit test gaps for multi-language modules
mashraf-222 Mar 19, 2026
e64239d
fix(10-03): resolve test pollution in multi-language orchestration tests
mashraf-222 Mar 19, 2026
275527d
style: auto-fix ruff formatting in config_parser.py
github-actions[bot] Mar 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .planning/STATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Project State

## Current Position
- **Phase:** 08 - Sequential Multi-Language Orchestration
- **Plan:** 02 (Complete)
- **Status:** Complete

## Progress
- Plan 08-01: Complete (apply_language_config + orchestration loop)
- Plan 08-02: Complete (error isolation + config normalization + summary logging)

## Decisions
- Multi-language orchestration uses sequential passes with deep-copied args
- find_all_config_files walks up from CWD collecting per-language configs
- apply_language_config mirrors process_pyproject_config for the multi-config path
- normalize_toml_config is the shared helper for config normalization (path resolution, defaults, key conversion)
- Per-language error isolation: try/except in loop with status tracking dict
- Summary logging: comma-separated "lang: status" pairs via logger.info

## Last Session
- **Stopped at:** Completed 08-02-PLAN.md
- **Timestamp:** 2026-03-18T04:40:02Z
7 changes: 7 additions & 0 deletions .planning/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"executor_model": "opus",
"commit_docs": true,
"parallelization": false,
"branching_strategy": "none",
"verifier_enabled": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
phase: 08-sequential-multi-language-orchestration
plan: 02
type: implementation
autonomous: true
wave: 1
depends_on: [08-01]
---

# Plan 08-02: Error Isolation and Config Normalization for Multi-Language Orchestration

## Objective

Harden the multi-language orchestration loop with per-language error isolation and ensure `find_all_config_files` normalizes config values consistently with `parse_config_file`.

## Context

- @codeflash/main.py — multi-language orchestration loop from 08-01
- @codeflash/cli_cmds/cli.py — apply_language_config from 08-01
- @codeflash/code_utils/config_parser.py — find_all_config_files and parse_config_file
- @tests/test_multi_language_orchestration.py — existing tests from 08-01

## Tasks

### Task 1: Normalize config values in find_all_config_files
type="auto"

`find_all_config_files` reads raw toml data but doesn't normalize it the way `parse_config_file` does (path resolution, hyphen-to-underscore key conversion, defaults for missing keys). Add a helper that normalizes the raw config dict so `apply_language_config` receives consistent data.

**Done criteria:**
- Config values from `find_all_config_files` have paths resolved relative to config file parent
- Hyphenated keys are converted to underscored keys
- Default values are applied for missing keys (formatter_cmds=[], disable_telemetry=False, etc.)
- Tests verify normalization

### Task 2: Add per-language error isolation in main.py orchestration loop
type="auto"

Wrap each language pass in a try/except so one language failure doesn't prevent other languages from being optimized. Log the error and continue.

**Done criteria:**
- Exception in one language pass logs the error and continues to next language
- Test verifies that if optimizer.run_with_args raises for one language, the other language still runs
- Summary logging at end of loop reports which languages succeeded/failed

### Task 3: Add summary logging for multi-language orchestration results
type="auto"

After the orchestration loop completes, log a summary showing which languages were processed and their status (success/failure/skipped).

**Done criteria:**
- Summary log message after loop shows per-language status
- Test verifies summary includes correct language names and statuses

## Verification

- All existing tests in test_multi_language_orchestration.py still pass
- New tests cover normalization, error isolation, and summary logging
- `uv run prek` passes
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
phase: 08-sequential-multi-language-orchestration
plan: 02
subsystem: cli
tags: [multi-language, config-normalization, error-isolation, orchestration]

requires:
- phase: 08-01
provides: apply_language_config, multi-language orchestration loop, find_all_config_files
provides:
- normalize_toml_config helper for consistent config normalization
- Per-language error isolation in orchestration loop
- Orchestration summary logging with per-language status
affects: [config-parser, main-entry-point, multi-language-support]

tech-stack:
added: []
patterns: [shared-normalization-helper, error-isolation-loop, status-tracking-dict]

key-files:
created: []
modified:
- codeflash/code_utils/config_parser.py
- codeflash/main.py
- tests/test_multi_language_orchestration.py

key-decisions:
- "Extract normalize_toml_config as shared helper used by both find_all_config_files and parse_config_file"
- "Track per-language status as dict[str, str] with values success/failed/skipped"
- "Log orchestration summary after loop completes with all statuses"

patterns-established:
- "Config normalization: always use normalize_toml_config for toml-based configs"
- "Error isolation: wrap per-language passes in try/except, track status, continue on failure"

requirements-completed: []

duration: 3min
completed: 2026-03-18
---

# Phase 08 Plan 02: Error Isolation and Config Normalization Summary

**Shared config normalization via normalize_toml_config, per-language error isolation with status tracking, and orchestration summary logging**

## Performance

- **Duration:** 3 min
- **Started:** 2026-03-18T04:36:44Z
- **Completed:** 2026-03-18T04:40:02Z
- **Tasks:** 3
- **Files modified:** 3

## Accomplishments
- Extracted `normalize_toml_config` helper that resolves paths, applies defaults, and converts hyphenated keys -- used by both `find_all_config_files` and `parse_config_file` to eliminate duplication
- Added per-language error isolation so one language failure does not prevent other languages from being optimized
- Added orchestration summary logging showing per-language status (success/failed/skipped) after the loop completes
- 13 new tests covering normalization, error isolation, skipped status, and summary logging format

## Task Commits

Each task was committed atomically:

1. **Task 1: Normalize config values in find_all_config_files** - `97e21aab` (feat)
2. **Task 2: Per-language error isolation in orchestration loop** - `a3014ec0` (feat)
3. **Task 3: Summary logging tests for orchestration results** - `dcf366e2` (test)

## Files Created/Modified
- `codeflash/code_utils/config_parser.py` - Added normalize_toml_config helper, used in find_all_config_files and parse_config_file
- `codeflash/main.py` - Added error isolation try/except, status tracking dict, _log_orchestration_summary helper
- `tests/test_multi_language_orchestration.py` - 13 new tests (6 normalization, 3 error isolation, 4 summary logging)

## Decisions Made
- Extracted normalization into a standalone function rather than keeping it duplicated between parse_config_file and find_all_config_files
- Used a simple dict[str, str] for status tracking rather than a more complex result type
- Summary logging uses logger.info with comma-separated "lang: status" pairs

## Deviations from Plan

None - plan executed exactly as written.

## Issues Encountered
None

## User Setup Required
None - no external service configuration required.

## Next Phase Readiness
- Multi-language orchestration is now robust against per-language failures
- Config normalization is consistent across single-config and multi-config paths
- Ready for further multi-language pipeline enhancements

---
*Phase: 08-sequential-multi-language-orchestration*
*Completed: 2026-03-18*
Loading
Loading