KS78: Fix persistence format bug + CODEX.md#20
Conversation
- Include supported versions (1, 2) and binary update hint in error message - Helps users diagnose stale binary vs data format mismatch (Issue #16) - Updated test to verify all diagnostic fields in error message Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- CODEX.md: OpenAI Codex instructions for code reviewer + 2nd QA role - BACKLOG.md: Update sprint roadmap to reflect actual shipped work (KS74-KS77b marked done, KS78-KS80 replanned) - Mark configurable embedding provider as DONE Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR tightens the persistence-layer diagnostic for Issue #16: when
Confidence Score: 5/5Safe to merge — minimal, focused diagnostic improvement with no logic changes or new panic paths The only Rust change is an error-message string and three additional test assertions. Version detection logic is untouched. No unsafe code, no new unwrap/expect calls, no async changes, and tests pass (391 pass, 0 fail per PR description). The single P2 note about the hardcoded version list is a future-proofing style suggestion, not a correctness issue. No files require special attention Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[load_binary called] --> B{file exists?}
B -- no --> C[return empty EchoStore]
B -- yes --> D[read bytes]
D --> E{data.len >= 5?}
E -- no --> F[Err: File too small]
E -- yes --> G{magic bytes valid?}
G -- no --> H[Err: Invalid magic bytes]
G -- yes --> I[version_byte = data[4]]
I --> J{version_byte == 1\nAND data[5..8] == 0,0,0?}
J -- yes --> K[load_binary_v1]
J -- no --> L{version_byte == 2?}
L -- yes --> M[load_binary_v2]
L -- no --> N["Err: Unsupported format version: X\n(supported: 1, 2).\nUpdate your binary. ← IMPROVED in this PR"]
K --> O[Ok EchoStore]
M --> O
Reviews (1): Last reviewed commit: "KS78: Add CODEX.md + update BACKLOG.md s..." | Re-trigger Greptile |
Summary
~/.local/bin/shrimpk-mcp.exewas compiled from KS9 (Mar 20, FORMAT_VERSION=1 only). Data file is v2 (written by v0.7.0 daemon). Old binary reads bytes[4..8] as u32 LE → 25165826 (0x01800002) instead of single byte[4]=2.Commits
KS78: Improve persistence version error diagnostic— Better error message + test coverageKS78: Add CODEX.md + update BACKLOG.md sprint roadmap— Project infrastructureTest plan
cargo test -p shrimpk-memory— 391 passed, 0 failed, 21 ignoredcargo clippy -p shrimpk-memory -- -D warnings— 0 warningscargo check --workspace— cleanmcp__shrimpk__statsworks (binary rebuild in progress)Closes #16
🤖 Generated with Claude Code