Skip to content

config: consolidate starter-config creation on one atomic writer (3 duplicate implementations, none atomic) #144

Closed

Description

@falbany

Problem

Three independent copies of "format template + write" exist:

  • core/config/loader.py:75-79 — STARTER_CONFIG_TEMPLATE.format(...) + write_text
  • core/actions.py:312-316 — write_starter_config
  • app.py:526-531 — init_default_config (re-duplicates the exists-check and error handling that launch/creation.propose_creation already provides)

None of them is atomic (plain write_text): an interrupted --init leaves a truncated .profiles, which then silently loads as defaults (#128) — compounding the damage. Only the editor save path uses write_text_atomic.

Suggested fix

Make write_starter_config the single writer, switch it to write_text_atomic, and have init_default_config / propose_creation (and the /api/config/create + /template endpoints) delegate to it. Fold propose_config_creation's fate into the dead-code sweep (#142).

Activity

  1. added
    code-quality
    on Nov 5, 2026
  2. added a commit that references this issue on Nov 11, 2026
    d14e065
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-quality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions