Skip to content

Plan-Execute Phase 2: retrofit ghtraf init with plan-execute pattern #56

@djdarcy

Description

@djdarcy

Retrofit ghtraf init with plan-execute pattern

Problem

init.py has 4+ if dry_run: branches for file copying and conflict detection. The dry-run path for existing files shows "Would prompt" but the real path prompts interactively — a divergence that could mislead users about what will happen.

Proposed solution

Extract plan_init(args) -> Plan that scans the template directory and produces actions:

  • COPY_FILE — new file, no conflict
  • SKIP_FILE — file exists + --skip-existing
  • PROMPT_OVERWRITE — file exists, needs user decision (requires_input=True)
  • FORCE_OVERWRITE — file exists + --force

Remove dry_run from configure.py functions — they become pure executors.

Acceptance criteria

  • plan_init() returns a Plan with per-file actions
  • Conflict detection (existing files) is part of planning, not execution
  • configure.py functions no longer accept dry_run parameter
  • --skip-existing and --force flags affect plan contents, not execution branches
  • Tests verify plan for empty target, existing files, and force mode

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    clightraf CLI tool and command-line interfaceenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions