Add conversation history persistence backend #2
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#7 Conversation panel + search
lyssieth/sermones
Reference
lyssieth/sermones#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implement the conversation-history persistence backend declared in
crates/sermones-runtime/src/lib.rsanddocs/glossary.md:Neither module currently exists. The error kinds
ErrorKind::HistoryCorruptandErrorKind::HistoryUnwritablealready exist incrates/sermones-core/src/error.rswaiting to be produced.Checklist
crates/sermones-runtime/src/persistence/(or equivalent): load + saveConversation(fromsermones-core) to the OS-conventional user-state locationFacet-derived can round-trip throughfacet-format+facet-json— pick a shape (one file per conversation vs. single history file) and document it indocs/components/runtime.mdConfigInvalid/HistoryCorrupt/HistoryUnwritablesite constructions so errors carry the failing path incontext(From<io::Error> for SermonErroralready exists)load_history/save_messageslots; the UI calls them)Refs:
docs/architecture/errors.md— canonical error shape + propagationdocs/components/error.md— howSermonErroris constructed and carriessource+contextdocs/components/runtime.md— current state of the runtime crate's surfacecrates/sermones-runtime/src/lib.rs— module docstring declares this as the runtime's jobdocs/glossary.md— explicitly calls out "Persist on disk and config load are planned"Resolution
Landed in
2112dbc(main):HistoryStoreincrates/sermones-runtime/src/persistence/, one JSON file perConversationatconversations/<id>.json(atomic tmp+rename,.corruptquarantine, id-ordered load).HistoryCorrupt/HistoryUnwritablecarry the failing path incontext["path"];ConfigInvalidstays unproduced until the config loader lands (no config file exists yet). Bridge:load_history/save_conversationslots +history_loaded/error_raisedsignals; typed helpers infrontend/src/lib/bridge.ts. 12 new tempdir tests; 452/452 workspace tests passing, lint clean.Deviations: the slot is
save_conversation, notsave_message— there is no engine-side liveConversationto append messages to. Rendering saved history inApp.svelteis out of scope here; it comes with the UI push.