Skip to content

cli: malformed or unreadable configuration can be overwritten during setup #400

Open

Description

@DivyamTalwar

Problem

Reproduced on ce30de7ca94115cb73fa991538c6d2595ac2622a.

Installers and first-run configuration migration can mistake malformed or unreadable existing configuration for an empty configuration, then overwrite it or remove installed payloads before reporting the problem.

Focused remediation

Validate Hermes YAML and Codex/Cursor hook JSON before payload mutations. Only ENOENT means missing. Preserve passive user-config reads as non-throwing, while refusing migration or explicit writes against invalid/unreadable state. Keep blank/comment-only Hermes YAML supported.

Reproduction and verification

Final regression tests fail on unchanged source (14 failures, 66 controls passing). The corrected branch passes 80 focused tests and 216 adjacent installer/configuration tests. Real temporary files cover rejected-input bytes and modes, payload preservation, malformed/scalar/array roots, missing files, and injected I/O errors.

I have prepared this focused fix and am taking its implementation; I will link the pull request and exact-commit validation. Tests use isolated fixtures, not user data.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions