MCPcopy Create free account
hub / github.com/AI45Lab/Code / source_policy_key

Function source_policy_key

core/src/context/assembler.rs:227–241  ·  view source on GitHub ↗
(item: &ContextItem)

Source from the content-addressed store, hash-verified

225}
226
227fn 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
243fn estimated_tokens(item: &ContextItem) -> usize {
244 if item.token_count > 0 {

Callers 1

assembleMethod · 0.85

Calls 1

provenanceMethod · 0.80

Tested by

no test coverage detected