(rng: &mut Rng)
| 444 | } |
| 445 | |
| 446 | fn 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 | |
| 466 | fn gen_permission_rule(rng: &mut Rng) -> PermissionRule { |
| 467 | const RULES: &[&str] = &[ |
no test coverage detected