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

Method short_attribution

atomic-core/src/change/credit.rs:317–340  ·  view source on GitHub ↗

Get a short attribution string (e.g., "alice `[H]`" or "bob `[A:claude]`").

(&self)

Source from the content-addressed store, hash-verified

315
316 /// Get a short attribution string (e.g., "alice `[H]`" or "bob `[A:claude]`").
317 pub fn short_attribution(&self) -> String {
318 let type_code = self.credit_type.short_code();
319 match (&self.ai_vendor, &self.ai_model) {
320 (Some(vendor), Some(model)) => {
321 // Truncate model name for display
322 let short_model = if model.len() > 10 {
323 &model[..10]
324 } else {
325 model
326 };
327 format!(
328 "{} [{}:{}:{}]",
329 self.author_name,
330 type_code,
331 vendor.name(),
332 short_model
333 )
334 }
335 (Some(vendor), None) => {
336 format!("{} [{}:{}]", self.author_name, type_code, vendor.name())
337 }
338 _ => format!("{} [{}]", self.author_name, type_code),
339 }
340 }
341
342 /// Check if AI was involved.
343 #[inline]

Callers 1

format_blameMethod · 0.80

Calls 2

short_codeMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected