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])
| 340 | /// } |
| 341 | /// ``` |
| 342 | pub 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) |