MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / Change

Class Change

atomic-core/src/change/change.rs:125–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123/// per-section zstd compression, and incremental blake3 hashing.
124#[derive(Clone, Debug)]
125pub struct Change {
126 /// The hashed portion (contributes to change hash)
127 pub hashed: HashedChange,
128
129 /// Optional unhashed metadata (JSON)
130 ///
131 /// This can contain arbitrary data that doesn't affect the change hash.
132 /// Useful for storing editor metadata, review comments, AI transcripts, etc.
133 pub unhashed: Option<serde_json::Value>,
134
135 /// Optional Ed25519 signature over the change's content hash.
136 ///
137 /// Excluded from the change hash (the SIGNATURE section is unhashed), so
138 /// re-signing with a different key never changes the change's identity.
139 /// `None` for unsigned (legacy) changes.
140 pub signature: Option<format_v3::ChangeSignature>,
141
142 /// Binary content blob
143 ///
144 /// This contains the actual file content referenced by hunks.
145 /// Hunks reference byte ranges within this blob.
146 pub contents: Vec<u8>,
147
148 /// Wire representation policy, retained on decode so reserialization does
149 /// not silently upgrade historical objects or invalidate their signatures.
150 pub semantic_encoding: format_v3::semantic::SemanticEncoding,
151 /// Historical decode retains Raw; new objects compare field-role encoding.
152 pub graph_encoding: format_v3::graph_fields::GraphEncoding,
153}
154
155impl Change {
156 /// Create a new change.

Callers 1

Calls

no outgoing calls

Tested by 1