MCPcopy Index your code
hub / github.com/AI45Lab/Code / from_result

Method from_result

core/src/program.rs:464–475  ·  view source on GitHub ↗
(result: &ProgramResult, steps: Vec<ProgramTraceStep>)

Source from the content-addressed store, hash-verified

462
463impl ProgramTrace {
464 pub fn from_result(result: &ProgramResult, steps: Vec<ProgramTraceStep>) -> Self {
465 Self {
466 schema: PROGRAM_TRACE_SCHEMA.to_string(),
467 trace_type: "program_execution".to_string(),
468 program_name: result.program_name.clone(),
469 success: result.success,
470 summary: result.summary.clone(),
471 step_count: steps.len(),
472 failed_steps: steps.iter().filter(|step| !step.success).count(),
473 steps,
474 }
475 }
476
477 pub fn to_value(&self) -> serde_json::Value {
478 serde_json::to_value(self).unwrap_or_else(|_| {

Callers

nothing calls this directly

Calls 2

cloneMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected