feat(storage, workspace, cli): Durable storage with workspace projection#743
Open
JeanMertz wants to merge 1 commit into
Open
feat(storage, workspace, cli): Durable storage with workspace projection#743JeanMertz wants to merge 1 commit into
JeanMertz wants to merge 1 commit into
Conversation
…ce projection Every conversation now has a durable user-local copy stored under `<user-data-dir>/workspace/<workspace-id>/`. Non-local conversations are additionally *projected* into the workspace's `.jp/conversations/` directory so they can be committed to version control alongside code. Local-only conversations (`--local`) are kept exclusively in user-local storage and never appear in the workspace directory. The `local` indicator in `jp conversation ls` now shows three states: `N` for projected, `Y` (blue) for user-local only, and `ext` (magenta) for conversations present only in the workspace (committed by another contributor but not yet imported locally). Archive and unarchive operations now act on every storage root that holds the conversation, keeping both copies consistent. On first startup for a workspace, JP migrates any legacy `<name>-<id>` user directories into the new workspace-ID layout (`<id>`) and imports existing workspace conversations into user-local storage. Conversations committed by other contributors after the one-time migration appear as `ext` and are imported lazily on first write. When both roots hold a conversation, metadata and stream are resolved independently by file mtime, with ties broken in favour of the durable user-local copy. The `Conversation::user` field is removed; storage locality is now carried by `Projection` (the write intent on a lock) and derived at load time from `StoragePresence`. `PersistBackend::write` gains a `Projection` argument, and `LoadBackend::load_conversation_ids` is replaced by `load_conversation_index` which returns `ConversationIndexEntry` values pairing each ID with its presence. `FsStorageBackend::with_user_storage` no longer accepts a `name` parameter. Closes: #733 Signed-off-by: Jean Mertz <git@jeanmertz.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.
Every conversation now has a durable user-local copy stored under
<user-data-dir>/workspace/<workspace-id>/. Non-local conversations are additionally projected into the workspace's.jp/conversations/directory so they can be committed to version control alongside code. Local-only conversations (--local) are kept exclusively in user-local storage and never appear in the workspace directory.The
localindicator injp conversation lsnow shows three states:Nfor projected,Y(blue) for user-local only, andext(magenta) for conversations present only in the workspace (committed by another contributor but not yet imported locally). Archive and unarchive operations now act on every storage root that holds the conversation, keeping both copies consistent.On first startup for a workspace, JP migrates any legacy
<name>-<id>user directories into the new workspace-ID layout (<id>) and imports existing workspace conversations into user-local storage. Conversations committed by other contributors after the one-time migration appear asextand are imported lazily on first write. When both roots hold a conversation, metadata and stream are resolved independently by file mtime, with ties broken in favour of the durable user-local copy.The
Conversation::userfield is removed; storage locality is now carried byProjection(the write intent on a lock) and derived at load time fromStoragePresence.PersistBackend::writegains aProjectionargument, andLoadBackend::load_conversation_idsis replaced byload_conversation_indexwhich returnsConversationIndexEntryvalues pairing each ID with its presence.FsStorageBackend::with_user_storageno longer accepts anameparameter.Closes: #733