Add structured metadata to memory modules#4
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /// Metadata describing a compressed memory module | ||
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] | ||
| pub struct MemoryMetadata { | ||
| /// Compression algorithm name (e.g., "zlib") | ||
| algorithm: String, | ||
| /// Schema version to support future evolution of the format | ||
| schema_version: u32, |
There was a problem hiding this comment.
Persisted modules from earlier versions cannot be deserialized
The new MemoryMetadata struct (algorithm and schema_version fields with no serde defaults) replaces the previous metadata: String field, but MemoryModule::from_json still just calls serde_json::from_str. Any JSON produced by versions before this change (where metadata was a string) will now fail to deserialize because serde will expect an object with both required fields and no fallback. If compatibility with already stored modules is needed, this change breaks loading them and requires either a backward-compatible deserializer or a format bump/documented migration.
Useful? React with 👍 / 👎.
Summary
MemoryMetadatablock capturing algorithm, schema version, and optional user tagsTesting
Codex Task