merge_for_write

Function merge_for_write 

Source
fn merge_for_write(
    existing: &[u8],
    rec: &NamedAgentRecord,
) -> Result<Option<Vec<u8>>, RegistryError>
Expand description

Merge an in-memory record into an on-disk file’s raw JSON, preserving fields beyond this binary’s struct shape.

Returns Ok(None) when the writer must refuse the merge (corrupt JSON, missing schema_version, or schema_version above MAX_SUPPORTED_SCHEMA). The caller treats None as a skip and leaves the on-disk file intact.