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

Function gen_loop_checkpoint

core/tests/test_persisted_schema_roundtrip.rs:446–464  ·  view source on GitHub ↗
(rng: &mut Rng)

Source from the content-addressed store, hash-verified

444}
445
446fn gen_loop_checkpoint(rng: &mut Rng) -> LoopCheckpoint {
447 let msg_n = rng.below(4);
448 let report_n = rng.below(2);
449 LoopCheckpoint {
450 // Generators stay at-or-below the current version; the future-version
451 // rejection is tested separately.
452 schema_version: rng.below(u64::from(LOOP_CHECKPOINT_SCHEMA_VERSION) + 1) as u32,
453 run_id: rng.string(),
454 session_id: rng.string(),
455 turn: rng.usize_below(1000),
456 messages: (0..msg_n).map(|_| gen_message(rng)).collect(),
457 total_usage: gen_token_usage(rng),
458 tool_calls_count: rng.usize_below(1000),
459 verification_reports: (0..report_n)
460 .map(|_| gen_verification_report(rng))
461 .collect(),
462 checkpoint_ms: rng.u64_small(),
463 }
464}
465
466fn gen_permission_rule(rng: &mut Rng) -> PermissionRule {
467 const RULES: &[&str] = &[

Calls 7

gen_messageFunction · 0.85
gen_token_usageFunction · 0.85
gen_verification_reportFunction · 0.85
belowMethod · 0.80
stringMethod · 0.80
usize_belowMethod · 0.80
u64_smallMethod · 0.80

Tested by

no test coverage detected