richardcase / richardcase/clowder

Do not overwrite corrupt daemon state during mutation

Open
#137 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug priority: high rust
Dominant language
Rust
Stars
0
Forks
0
Avg merge
1h 14m
Merged PRs (30d)
16

Description

Problem

JsonStore.load converts parse/read failures into an empty vector even when called by mutation paths. The next mutation can overwrite a corrupt state file and orphan previously recorded agents, projects, or profiles.

Evidence: https://github.com/richardcase/clowder/blob/b5492d5/crates/clowder-daemon/src/store.rs#L30-L63

Acceptance criteria

  • Keep display/recovery reads tolerant.
  • Refuse mutations when an existing state file is unreadable or invalid.
  • Preserve the original bytes and surface a clear error.
  • Add corruption and mutation regression tests.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in crates/clowder-daemon/src/store.rs at lines 30–63 and trace how JsonStore.load is used by display/recovery versus mutation paths. Add corruption and mutation regression tests that verify unreadable state blocks mutation, preserves the original bytes, and returns a clear error while tolerant reads still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.