Conversation
Previously, `events.json` packed the conversation's base config as a synthetic first element — a `ConfigDelta` containing the full `AppConfig`. This made the file difficult to inspect: opening it in an editor meant scrolling past hundreds of lines of config JSON before reaching actual conversation events. The base config is now stored in a separate `base_config.json` file, written once at conversation creation time and never overwritten. `events.json` contains only `InternalEvent` entries (config deltas and conversation events), with no synthetic leading element. The custom `Serialize`/`Deserialize` impls on `ConversationStream` are removed in favour of explicit `from_parts`/`to_parts` methods used by the storage layer. `InternalEvent` is demoted from `pub` to `pub(crate)` since nothing outside `jp_conversation` references it. The `compat` module's `deserialize_config_delta` is renamed to `deserialize_partial_config` and now operates directly on `PartialAppConfig`. A new `deserialize_config_delta` in `stream.rs` delegates to it for the timestamp + delta extraction pattern used when deserializing individual `ConfigDelta` stream events. Backward compatibility is handled transparently in the load path: if `base_config.json` is absent, the loader falls back to extracting the base config from the first element of `events.json`. On the next persist, `base_config.json` is written and `events.json` is rewritten without the leading config entry. Implements RFD 054. 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.
Previously,
events.jsonpacked the conversation's base config as a synthetic first element — aConfigDeltacontaining the fullAppConfig. This made the file difficult to inspect: opening it in an editor meant scrolling past hundreds of lines of config JSON before reaching actual conversation events.The base config is now stored in a separate
base_config.jsonfile, written once at conversation creation time and never overwritten.events.jsoncontains onlyInternalEvententries (config deltas and conversation events), with no synthetic leading element.The custom
Serialize/Deserializeimpls onConversationStreamare removed in favour of explicitfrom_parts/to_partsmethods used by the storage layer.InternalEventis demoted frompubtopub(crate)since nothing outsidejp_conversationreferences it.The
compatmodule'sdeserialize_config_deltais renamed todeserialize_partial_configand now operates directly onPartialAppConfig. A newdeserialize_config_deltainstream.rsdelegates to it for the timestamp + delta extraction pattern used when deserializing individualConfigDeltastream events.Backward compatibility is handled transparently in the load path: if
base_config.jsonis absent, the loader falls back to extracting the base config from the first element ofevents.json. On the next persist,base_config.jsonis written andevents.jsonis rewritten without the leading config entry.Implements RFD 054.