Skip to content

Add structured metadata to memory modules#4

Open
crlsrldn wants to merge 3 commits into
mainfrom
codex/extend-memorymodule-for-structured-metadata
Open

Add structured metadata to memory modules#4
crlsrldn wants to merge 3 commits into
mainfrom
codex/extend-memorymodule-for-structured-metadata

Conversation

@crlsrldn

Copy link
Copy Markdown
Owner

Summary

  • add a structured MemoryMetadata block capturing algorithm, schema version, and optional user tags
  • populate metadata during module creation, expose it through getters, and validate expanders against the stored algorithm
  • update examples and tests to serialize metadata and use it to select the correct expander

Testing

  • cargo test

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/lib.rs
Comment on lines +58 to +64
/// 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant