Skip to content

feat(#303): Slice 0 — worktree_isolation enum + execution_wave_mode scaffolding#305

Merged
azalio merged 1 commit into
mainfrom
claude/compassionate-cerf-d20i6w
Jun 29, 2026
Merged

feat(#303): Slice 0 — worktree_isolation enum + execution_wave_mode scaffolding#305
azalio merged 1 commit into
mainfrom
claude/compassionate-cerf-d20i6w

Conversation

@azalio

@azalio azalio commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

Slice 0 of the 7-slice parallel wave rollout (#303). Config scaffolding only — no behavior change in this slice.

  • worktree_isolation migrated from bool = False to str = "off" (enum: off / auto / required). The old boolean false/true in existing YAML configs migrates automatically in load_map_config.
  • execution_wave_mode new field (str = "auto", enum: off / auto / on), aliased from dotted YAML key execution.wave_mode. YAML 1.1 bare off/on (parsed as Python booleans) coerced back to strings.
  • _wt_isolation_enabled in step runner updated to treat "required" and "on" as truthy; "auto" remains falsy until Slice 3/5.
  • Tests: TestWorktreeConfig updated to == "off" / == "required" assertions, new parametrized enum-coverage tests, backward-compat bool-migration tests; new TestWaveModeConfig class covering all execution_wave_mode paths including YAML 1.1 coercion.
  • Fix: test_write_project_mcp_json_permission_error skipped when running as root (pre-existing failure — chmod(0o444) has no effect for root, so OSError is never raised).

Test plan

  • uv run pytest tests/test_worktree_isolation.py -v — 56 passed
  • uv run pytest --tb=short -q — 2982 passed, 4 skipped
  • uv run make check-render — generated trees match templates_src
  • uv run make check (ruff, mypy, pyright, lint-hooks, pytest) — all green

Closes part of #303 (Slice 0 of 7).


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for enum-style worktree isolation settings in project configuration, with clearer options for default, optional, and required behavior.
    • Added a new execution wave mode setting for configuring how work runs in parallel.
  • Bug Fixes

    • Improved compatibility with older boolean-style settings so existing configurations continue to work.
    • Invalid configuration values now fall back to safe defaults instead of causing unexpected behavior.
  • Tests

    • Expanded automated coverage for the new configuration options and migration behavior.

…onfig scaffolding

Migrates `worktree_isolation` from `bool` to a 3-value enum string
(`off` / `auto` / `required`) and adds a new `execution_wave_mode`
field (`off` / `auto` / `on`) to `MapConfig` as no-behavior-change
scaffolding for the parallel wave rollout (#303).

Key changes:
- `project_config.py`: add `VALID_WORKTREE_ISOLATION`, `VALID_WAVE_MODE`
  frozensets; migrate `worktree_isolation: bool = False` to `str = "off"`;
  add `execution_wave_mode: str = "auto"`; alias `execution.wave_mode`
  dotted YAML key; backward-compat bool→str coercion in `load_map_config`;
  post-load enum validation with warning+fallback for both fields;
  update `generate_default_config` comments/examples.
- `map_step_runner.py.jinja` (+ rendered copies): update
  `_wt_isolation_enabled` to handle new enum values — `"required"` and
  YAML-1.1 `"on"` are truthy; `"auto"` and `"off"` remain falsy in
  Slice 0 (sequential everywhere until Slice 3/5).
- `tests/test_worktree_isolation.py`: update all `is False`/`is True`
  assertions to `== "off"` / `== "required"`; add parametrized enum
  coverage, backward-compat bool-migration tests, and a new
  `TestWaveModeConfig` class covering all `execution_wave_mode` paths.
- `tests/test_mapify_cli.py`: skip the read-only-file OSError test when
  running as root (root bypasses POSIX permission enforcement; the skip
  makes the pre-existing root-CI failure disappear cleanly).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TiSdo3Y2J5BtLzGVy2n98C
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 822e972c-33f6-4275-92c9-46e7597980a9

📥 Commits

Reviewing files that changed from the base of the PR and between 5170530 and 031293c.

📒 Files selected for processing (6)
  • .map/scripts/map_step_runner.py
  • src/mapify_cli/config/project_config.py
  • src/mapify_cli/templates/map/scripts/map_step_runner.py
  • src/mapify_cli/templates_src/map/scripts/map_step_runner.py.jinja
  • tests/test_mapify_cli.py
  • tests/test_worktree_isolation.py

📝 Walkthrough

Walkthrough

Converts worktree.isolation from a boolean to a string enum (off/auto/required) and introduces a new execution.wave_mode enum field (off/auto/on). Changes span MapConfig dataclass fields, load_map_config() dotted-key translation and YAML boolean backward-compat coercions, enum validation with fallback defaults, runner script updates, default config template, and expanded tests.

Changes

Enum config for worktree isolation and wave mode

Layer / File(s) Summary
MapConfig enum fields and allowlists
src/mapify_cli/config/project_config.py
Adds VALID_WORKTREE_ISOLATION and VALID_WAVE_MODE frozensets; changes MapConfig.worktree_isolation from bool=False to str="off"; adds MapConfig.execution_wave_mode: str = "auto".
load_map_config() translation, coercions, validation, and template
src/mapify_cli/config/project_config.py
Extends dotted-key mapping for execution.wave_mode, coerces YAML-parsed booleans to enum strings for both fields, adds post-load enum validation with fallback defaults, and updates the generated config.yaml comment template.
_wt_isolation_enabled enum handling in runner scripts
src/mapify_cli/templates_src/map/scripts/map_step_runner.py.jinja, src/mapify_cli/templates/map/scripts/map_step_runner.py, .map/scripts/map_step_runner.py
Replaces _parse_boolish(..., "false") with enum-aware parsing: reads worktree.isolation defaulting to "off", enables isolation only for required or truthy alias strings.
Test updates for enum config and permission-error fix
tests/test_worktree_isolation.py, tests/test_mapify_cli.py
Updates assertions from boolean to enum strings, adds parametrized wave mode tests, adds skipif for root in permission-error test, and wraps assertion in try/finally for cleanup.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 No more true or false for me,
I hop through enums, wild and free!
"required", "auto", "off" I say,
Wave mode joins the enum fray.
Old booleans gently migrate along,
In frozensets where they belong. 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/compassionate-cerf-d20i6w

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@azalio azalio merged commit bb38f43 into main Jun 29, 2026
6 of 7 checks passed
azalio added a commit that referenced this pull request Jun 29, 2026
…lice 0 with #305

#305 landed #303 Slice 0 (worktree_isolation enum + execution_wave_mode) in
MapConfig while #304 was in flight. Reconcile per 'MapConfig = single source':
- Adopt main's _wt_isolation_enabled (auto->False until Slice 5); keep
  _worktree_isolation_mode as the runner-side enum reader for probe/fallback.
- Align _execution_wave_mode default off->auto to match MapConfig; behavior
  stays neutral via the isolation gate.
- select_execution_strategy now gates wave-loop on worktree.isolation != off
  (mirrors #305): default (wave_mode=auto, isolation=off) -> legacy sequential.
- Update decision tables (claude+codex) + neutrality tests for the new defaults.
make check green (3019 passed); render parity clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants