feat: Phase 1C OSAL key-value storage abstraction#41
Merged
Conversation
New OSAL KV API (claw_kv.h): set/get for strings, blobs, and u8 values with namespace isolation. Replaces all direct NVS calls scattered across the codebase. Implementations: - ESP-IDF: thin wrapper over nvs_flash (claw_kv_freertos.c) - RT-Thread: RAM-only hash table (claw_kv_rtthread.c), lost on reboot — persistent backend (filesystem) planned later Migrated callers: - ai_memory.c: LTM load/persist via claw_kv (no #ifdef) - ai_skill.c: skill persist/load via claw_kv (no #ifdef) - shell_commands.c: config save/load via claw_kv (no #ifdef) - main.c (C3/S3): nvs_flash_init() replaced by claw_kv_init() No migration needed. Direct replacement. Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
claw_kv.h):set/getfor strings, blobs, and u8 values with namespace isolation — replaces all direct NVS callsclaw_kv_freertos.c): thin wrapper overnvs_flashwith autonvs_flash_init()+ erase-on-corruptclaw_kv_rtthread.c): RAM-only hash table (48 slots) — persistent filesystem backend planned later#ifdef CLAW_PLATFORM_ESP_IDF+ NVS code removednvs_flash_init()replaced byclaw_kv_init()#ifdefremaining inclaw/for storage — fully platform-independentTest plan
meson compilepasses on vexpress-a9 (zero warnings)make build-esp32c3-qemupasses (zero warnings)scripts/check-patch.sh --stagedpasses (only__cplusplusfalse positives)🦞 Generated with Claude Code