(item: &ContextItem)
| 225 | } |
| 226 | |
| 227 | fn source_policy_key(item: &ContextItem) -> String { |
| 228 | if let Some(provenance) = item.provenance() { |
| 229 | return format!("provenance:{provenance}"); |
| 230 | } |
| 231 | |
| 232 | if let Some(source) = &item.source { |
| 233 | let family = source |
| 234 | .split_once(':') |
| 235 | .map(|(family, _)| family) |
| 236 | .unwrap_or(source); |
| 237 | return format!("source:{family}"); |
| 238 | } |
| 239 | |
| 240 | format!("type:{:?}", item.context_type) |
| 241 | } |
| 242 | |
| 243 | fn estimated_tokens(item: &ContextItem) -> usize { |
| 244 | if item.token_count > 0 { |