feat: add `cprr repair` command for malformed stores
- Dominant language
- Go
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
Add `cprr repair` to auto-fix common corruption in `conjectures.json`.
## Motivation
qwen3-steering has a corrupted `.cprr/conjectures.json` with an extra `{` after the array close and a duplicated conjecture #25 outside the array. The tool currently fails silently or errors on load with no recovery path.
## Proposed Behavior
```bash
cprr repair # fix current store, preview changes
cprr repair --write # apply fixes
cprr repair --backup # save .cprr/conjectures.json.bak first
```
Fixes:
- [ ] Trailing garbage after valid JSON
- [ ] Duplicate conjecture IDs (keep latest `updated_at`)
- [ ] Normalize timestamps to RFC3339
- [ ] Remove entries with missing required fields (with warning)
## Depends On
- `cprr doctor` (#TBD) for validation logic
Contributor guide
Research direction
Start with the .cprr/conjectures.json store and the existing cprr command path, then review how loading currently handles malformed JSON. Define completion against the proposed cprr repair, --write, and --backup behavior: trailing garbage, duplicate IDs, timestamps, and missing fields should be handled with the stated warnings and preview or write semantics. Check how this should depend on cprr doctor (#TBD) for validation logic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100