Skip to content

feat(storage, workspace, cli): Durable storage with workspace projection#743

Open
JeanMertz wants to merge 1 commit into
mainfrom
RFD031-impl
Open

feat(storage, workspace, cli): Durable storage with workspace projection#743
JeanMertz wants to merge 1 commit into
mainfrom
RFD031-impl

Conversation

@JeanMertz
Copy link
Copy Markdown
Collaborator

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

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFD-031: Durable Conversation Storage with Workspace Projection

1 participant