Skip to content

Corrupt installed.json bricks all skill operations — add self-heal #55

Description

@anujhydrabadi

Bug

loadReceipt (internal/skillinstall/installer.go:435) hard-errors on invalid JSON in ~/.praxis/installed.json, and the error propagates to every skill operation: list-skills, the login post-auth install, logout. A truncated or hand-edited receipt therefore bricks all skill management until the user figures out they must delete the file manually — there is no self-heal and no actionable error message.

Contrast: the MCP snapshot write is best-effort, and receipt writes are already atomic (temp+rename, saveReceipt installer.go:456) — corruption is rare but possible (crash mid-rename on some filesystems, manual edits, disk issues).

Suggested fix

  1. On parse failure: back up the corrupt file to installed.json.corrupt-<timestamp>, log a clear warning, and continue with an empty receipt. The next login/refresh reinstalls everything and rebuilds the receipt — skills are fully reconstructible state, so losing the receipt is benign compared to bricking.
  2. The orphan sweep makes this safe: unreceipted praxis-* dirs from the lost receipt get cleaned/reinstalled on the next refresh anyway.
  3. Test: corrupt installed.jsonpraxis list-skills works (empty), warning printed, backup file created; login rebuilds the receipt.

Found during the praxis skills/gateway audit (2026-07-06).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions