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

Function gen_trace_event

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

Source from the content-addressed store, hash-verified

296}
297
298fn gen_trace_event(rng: &mut Rng) -> TraceEvent {
299 TraceEvent {
300 schema: TRACE_EVENT_SCHEMA.to_string(),
301 kind: if rng.boolean() {
302 TraceEventKind::ToolExecution
303 } else {
304 TraceEventKind::ProgramExecution
305 },
306 name: rng.string(),
307 success: rng.boolean(),
308 exit_code: rng.i32_small(),
309 duration_ms: rng.u64_small(),
310 output_bytes: rng.usize_below(1_000_000),
311 metadata_keys: rng.string_vec(3),
312 artifact_uris: rng.string_vec(2),
313 details: if rng.boolean() {
314 Some(rng.json_value_non_null(2))
315 } else {
316 None
317 },
318 }
319}
320
321fn gen_subagent_task(rng: &mut Rng) -> SubagentTaskSnapshot {
322 let status = match rng.below(4) {

Calls 7

booleanMethod · 0.80
stringMethod · 0.80
i32_smallMethod · 0.80
u64_smallMethod · 0.80
usize_belowMethod · 0.80
string_vecMethod · 0.80
json_value_non_nullMethod · 0.80

Tested by

no test coverage detected