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

Function needs_semantic_regen

atomic-repository/src/semantic_regen.rs:342–356  ·  view source on GitHub ↗

Check whether a change needs semantic regeneration. Returns `true` if the change has GRAPH sections but no SEMANTIC sections in the redb store. Returns `false` if semantic sections already exist (unless `force` is true in the options). # Arguments `store` - The redb change store. `hash` - The change's content hash. # Errors Returns an error if the change doesn't exist or the store can't be re

(store: &RedbChangeStore, hash: &[u8; 32])

Source from the content-addressed store, hash-verified

340/// }
341/// ```
342pub fn needs_semantic_regen(store: &RedbChangeStore, hash: &[u8; 32]) -> RegenResult<bool> {
343 let meta = store.load_meta(hash)?;
344
345 // No graph sections means nothing to regenerate from
346 if meta.graph_section_count == 0 {
347 return Ok(false);
348 }
349
350 // Has semantic sections already
351 if meta.semantic_section_count > 0 {
352 return Ok(false);
353 }
354
355 Ok(true)
356}
357
358// ═══════════════════════════════════════════════════════════════════════
359// tokenize_content_for_display — on-the-fly fallback (no persistence)

Callers 3

regenerate_changeFunction · 0.85

Calls 1

load_metaMethod · 0.80

Tested by 2