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

Function expansive_policy_allows_broader_context

core/src/context/assembler.rs:300–320  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

298
299 #[test]
300 fn expansive_policy_allows_broader_context() {
301 let assembler = ContextAssembler::from_policy(ContextAssemblyPolicy::expansive());
302 let assembly = assembler.assemble(&[result(
303 "test",
304 (0..8)
305 .map(|index| {
306 ContextItem::new(
307 format!("file-{index}"),
308 ContextType::Resource,
309 format!("file {index}"),
310 )
311 .with_source(format!("file://{index}"))
312 .with_relevance(1.0 - index as f32 * 0.01)
313 .with_token_count(1)
314 })
315 .collect(),
316 )]);
317
318 assert_eq!(assembly.items.len(), 8);
319 assert!(!assembly.truncated);
320 }
321
322 #[test]
323 fn assemble_ranks_by_relevance() {

Callers

nothing calls this directly

Calls 5

resultFunction · 0.85
assembleMethod · 0.80
with_token_countMethod · 0.80
with_relevanceMethod · 0.80
with_sourceMethod · 0.80

Tested by

no test coverage detected