1use chrono::{DateTime, Utc};
31use serde::{Deserialize, Serialize};
32use serde_json::Value;
33
34use crate::{ThreadEvent, ThreadItemDetails, ToolCallStatus};
35
36pub const ATIF_SCHEMA_VERSION: &str = "ATIF-v1.4";
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
45pub struct Trajectory {
46 pub schema_version: String,
48 pub session_id: String,
50 pub agent: AtifAgent,
52 pub steps: Vec<Step>,
54 #[serde(skip_serializing_if = "Option::is_none")]
56 pub notes: Option<String>,
57 #[serde(skip_serializing_if = "Option::is_none")]
59 pub final_metrics: Option<FinalMetrics>,
60 #[serde(skip_serializing_if = "Option::is_none")]
62 pub extra: Option<Value>,
63}
64
65#[derive(Debug, Clone, Serialize, Deserialize)]
67pub struct AtifAgent {
68 pub name: String,
70 pub version: String,
72 #[serde(skip_serializing_if = "Option::is_none")]
74 pub model_name: Option<String>,
75 #[serde(skip_serializing_if = "Option::is_none")]
77 pub extra: Option<Value>,
78}
79
80impl AtifAgent {
81 pub fn new(name: impl Into<String>, version: impl Into<String>) -> Self {
83 Self {
84 name: name.into(),
85 version: version.into(),
86 model_name: None,
87 extra: None,
88 }
89 }
90
91 pub fn vtcode() -> Self {
93 Self::new("vtcode", env!("CARGO_PKG_VERSION"))
94 }
95
96 pub fn with_model(mut self, model: impl Into<String>) -> Self {
98 self.model_name = Some(model.into());
99 self
100 }
101}
102
103#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
105#[serde(rename_all = "lowercase")]
106pub enum StepSource {
107 System,
109 User,
111 Agent,
113}
114
115#[derive(Debug, Clone, Serialize, Deserialize)]
117pub struct Step {
118 pub step_id: u64,
120 #[serde(skip_serializing_if = "Option::is_none")]
122 pub timestamp: Option<String>,
123 pub source: StepSource,
125 #[serde(skip_serializing_if = "Option::is_none")]
127 pub model_name: Option<String>,
128 #[serde(skip_serializing_if = "Option::is_none")]
130 pub message: Option<String>,
131 #[serde(skip_serializing_if = "Option::is_none")]
133 pub reasoning_content: Option<String>,
134 #[serde(skip_serializing_if = "Option::is_none")]
136 pub tool_calls: Option<Vec<AtifToolCall>>,
137 #[serde(skip_serializing_if = "Option::is_none")]
139 pub observation: Option<Observation>,
140 #[serde(skip_serializing_if = "Option::is_none")]
142 pub metrics: Option<StepMetrics>,
143 #[serde(skip_serializing_if = "Option::is_none")]
145 pub extra: Option<Value>,
146}
147
148impl Step {
149 pub fn user(step_id: u64, message: impl Into<String>) -> Self {
151 Self {
152 step_id,
153 timestamp: Some(Utc::now().to_rfc3339()),
154 source: StepSource::User,
155 model_name: None,
156 message: Some(message.into()),
157 reasoning_content: None,
158 tool_calls: None,
159 observation: None,
160 metrics: None,
161 extra: None,
162 }
163 }
164
165 pub fn agent(step_id: u64, message: impl Into<String>) -> Self {
167 Self {
168 step_id,
169 timestamp: Some(Utc::now().to_rfc3339()),
170 source: StepSource::Agent,
171 model_name: None,
172 message: Some(message.into()),
173 reasoning_content: None,
174 tool_calls: None,
175 observation: None,
176 metrics: None,
177 extra: None,
178 }
179 }
180
181 pub fn system(step_id: u64, message: impl Into<String>) -> Self {
183 Self {
184 step_id,
185 timestamp: Some(Utc::now().to_rfc3339()),
186 source: StepSource::System,
187 model_name: None,
188 message: Some(message.into()),
189 reasoning_content: None,
190 tool_calls: None,
191 observation: None,
192 metrics: None,
193 extra: None,
194 }
195 }
196}
197
198#[derive(Debug, Clone, Serialize, Deserialize)]
200pub struct AtifToolCall {
201 pub tool_call_id: String,
203 pub function_name: String,
205 #[serde(skip_serializing_if = "Option::is_none")]
207 pub arguments: Option<Value>,
208}
209
210#[derive(Debug, Clone, Serialize, Deserialize)]
212pub struct Observation {
213 pub results: Vec<ObservationResult>,
215}
216
217#[derive(Debug, Clone, Serialize, Deserialize)]
219pub struct ObservationResult {
220 pub source_call_id: String,
222 pub content: String,
224}
225
226#[derive(Debug, Clone, Serialize, Deserialize)]
228pub struct StepMetrics {
229 #[serde(skip_serializing_if = "Option::is_none")]
231 pub prompt_tokens: Option<u64>,
232 #[serde(skip_serializing_if = "Option::is_none")]
234 pub completion_tokens: Option<u64>,
235 #[serde(skip_serializing_if = "Option::is_none")]
237 pub cached_tokens: Option<u64>,
238 #[serde(skip_serializing_if = "Option::is_none")]
240 pub cost_usd: Option<f64>,
241 #[serde(skip_serializing_if = "Option::is_none")]
243 pub logprobs: Option<Vec<f64>>,
244 #[serde(skip_serializing_if = "Option::is_none")]
246 pub completion_token_ids: Option<Vec<u64>>,
247 #[serde(skip_serializing_if = "Option::is_none")]
249 pub prompt_token_ids: Option<Vec<u64>>,
250 #[serde(skip_serializing_if = "Option::is_none")]
252 pub extra: Option<Value>,
253}
254
255impl StepMetrics {
256 pub fn from_usage(usage: &crate::Usage) -> Self {
258 Self {
259 prompt_tokens: Some(usage.input_tokens),
260 completion_tokens: Some(usage.output_tokens),
261 cached_tokens: if usage.cached_input_tokens > 0 {
262 Some(usage.cached_input_tokens)
263 } else {
264 None
265 },
266 cost_usd: None,
267 logprobs: None,
268 completion_token_ids: None,
269 prompt_token_ids: None,
270 extra: if usage.cache_creation_tokens > 0 {
271 Some(serde_json::json!({
272 "cache_creation_tokens": usage.cache_creation_tokens
273 }))
274 } else {
275 None
276 },
277 }
278 }
279}
280
281#[derive(Debug, Clone, Default, Serialize, Deserialize)]
283pub struct FinalMetrics {
284 #[serde(skip_serializing_if = "Option::is_none")]
286 pub total_prompt_tokens: Option<u64>,
287 #[serde(skip_serializing_if = "Option::is_none")]
289 pub total_completion_tokens: Option<u64>,
290 #[serde(skip_serializing_if = "Option::is_none")]
292 pub total_cached_tokens: Option<u64>,
293 #[serde(skip_serializing_if = "Option::is_none")]
295 pub total_cost_usd: Option<f64>,
296 #[serde(skip_serializing_if = "Option::is_none")]
298 pub total_steps: Option<u64>,
299 #[serde(skip_serializing_if = "Option::is_none")]
301 pub extra: Option<Value>,
302}
303
304pub struct AtifTrajectoryBuilder {
316 agent: AtifAgent,
317 session_id: Option<String>,
318 steps: Vec<Step>,
319 next_step_id: u64,
320 total_input_tokens: u64,
322 total_output_tokens: u64,
323 total_cached_tokens: u64,
324 num_turns: usize,
325 pending_tool_calls: Vec<PendingToolCall>,
327}
328
329struct PendingToolCall {
330 call_id: String,
331 tool_call_id: Option<String>,
332 tool_name: String,
333 arguments: Option<Value>,
334 timestamp: String,
335}
336
337impl AtifTrajectoryBuilder {
338 pub fn new(agent: AtifAgent) -> Self {
340 Self {
341 agent,
342 session_id: None,
343 steps: Vec::new(),
344 next_step_id: 1,
345 total_input_tokens: 0,
346 total_output_tokens: 0,
347 total_cached_tokens: 0,
348 num_turns: 0,
349 pending_tool_calls: Vec::new(),
350 }
351 }
352
353 pub fn set_session_id(&mut self, id: impl Into<String>) {
356 self.session_id = Some(id.into());
357 }
358
359 pub fn process_event(&mut self, event: &ThreadEvent) {
361 self.process_event_at(event, Utc::now());
362 }
363
364 pub fn process_event_at(&mut self, event: &ThreadEvent, ts: DateTime<Utc>) {
366 let ts_str = ts.to_rfc3339();
367 match event {
368 ThreadEvent::ThreadStarted(e) => {
369 if self.session_id.is_none() {
370 self.session_id = Some(e.thread_id.clone());
371 }
372 }
373 ThreadEvent::ThreadCompleted(e) => {
374 if self.session_id.is_none() {
375 self.session_id = Some(e.session_id.clone());
376 }
377 self.total_input_tokens = self.total_input_tokens.saturating_add(e.usage.input_tokens);
379 self.total_output_tokens = self.total_output_tokens.saturating_add(e.usage.output_tokens);
380 self.total_cached_tokens = self.total_cached_tokens.saturating_add(e.usage.cached_input_tokens);
381 self.num_turns = e.num_turns;
382 }
383 ThreadEvent::TurnCompleted(e) => {
384 self.total_input_tokens = self.total_input_tokens.saturating_add(e.usage.input_tokens);
385 self.total_output_tokens = self.total_output_tokens.saturating_add(e.usage.output_tokens);
386 self.total_cached_tokens = self.total_cached_tokens.saturating_add(e.usage.cached_input_tokens);
387 self.num_turns += 1;
388
389 let mut step = Step::system(self.next_step_id, "turn_completed");
390 step.timestamp = Some(ts_str);
391 step.metrics = Some(StepMetrics::from_usage(&e.usage));
392 self.push_step(step);
393 }
394 ThreadEvent::TurnFailed(e) => {
395 if let Some(usage) = &e.usage {
396 self.total_input_tokens = self.total_input_tokens.saturating_add(usage.input_tokens);
397 self.total_output_tokens = self.total_output_tokens.saturating_add(usage.output_tokens);
398 }
399 let mut step = Step::system(self.next_step_id, &e.message);
400 step.timestamp = Some(ts_str);
401 step.metrics = e.usage.as_ref().map(StepMetrics::from_usage);
402 self.push_step(step);
403 }
404 ThreadEvent::ItemCompleted(e) => {
405 self.process_item_completed(&e.item.id, &e.item.details, &ts_str);
406 }
407 ThreadEvent::ThreadCompactBoundary(e) => {
408 let msg = format!(
409 "context_compaction: {} messages -> {} messages ({})",
410 e.original_message_count,
411 e.compacted_message_count,
412 e.trigger.as_str()
413 );
414 let mut step = Step::system(self.next_step_id, msg);
415 step.timestamp = Some(ts_str);
416 self.push_step(step);
417 }
418 ThreadEvent::Error(e) => {
419 let mut step = Step::system(self.next_step_id, &e.message);
420 step.timestamp = Some(ts_str);
421 self.push_step(step);
422 }
423 ThreadEvent::TurnStarted(_)
425 | ThreadEvent::ItemStarted(_)
426 | ThreadEvent::ItemUpdated(_)
427 | ThreadEvent::PlanDelta(_)
428 | ThreadEvent::PermissionRequested(_)
429 | ThreadEvent::PermissionResolved(_)
430 | ThreadEvent::Interjected(_)
431 | ThreadEvent::Unknown => {}
432 }
433 }
434
435 fn process_item_completed(&mut self, item_id: &str, details: &ThreadItemDetails, ts: &str) {
436 match details {
437 ThreadItemDetails::AgentMessage(msg) => {
438 let mut step = Step::agent(self.next_step_id, &msg.text);
439 step.timestamp = Some(ts.to_string());
440 self.push_step(step);
441 }
442 ThreadItemDetails::Plan(plan) => {
443 let mut step = Step::agent(self.next_step_id, &plan.text);
444 step.timestamp = Some(ts.to_string());
445 step.extra = Some(serde_json::json!({ "vtcode_item_type": "plan" }));
446 self.push_step(step);
447 }
448 ThreadItemDetails::Reasoning(r) => {
449 let mut step = Step::agent(self.next_step_id, "");
450 step.timestamp = Some(ts.to_string());
451 step.reasoning_content = Some(r.text.clone());
452 step.message = None;
453 self.push_step(step);
454 }
455 ThreadItemDetails::ToolInvocation(inv) => {
456 self.pending_tool_calls.push(PendingToolCall {
458 call_id: item_id.to_string(),
459 tool_call_id: inv.tool_call_id.clone(),
460 tool_name: inv.tool_name.clone(),
461 arguments: inv.arguments.clone(),
462 timestamp: ts.to_string(),
463 });
464 }
465 ThreadItemDetails::ToolOutput(output) => {
466 let pending_idx = self.pending_tool_calls.iter().position(|p| p.call_id == output.call_id);
468
469 let (tool_name, arguments, tool_call_id, inv_ts) = if let Some(idx) = pending_idx {
470 let p = self.pending_tool_calls.remove(idx);
471 (p.tool_name, p.arguments, p.tool_call_id, p.timestamp)
472 } else {
473 ("unknown".to_string(), None, output.tool_call_id.clone(), ts.to_string())
474 };
475
476 let call_id = tool_call_id.clone().unwrap_or_else(|| output.call_id.clone());
477
478 let mut step = Step::agent(self.next_step_id, "");
479 step.timestamp = Some(inv_ts);
480 step.message = None;
481 step.tool_calls = Some(vec![AtifToolCall {
482 tool_call_id: call_id.clone(),
483 function_name: tool_name,
484 arguments,
485 }]);
486
487 let status_suffix = match output.status {
488 ToolCallStatus::Failed => " [FAILED]",
489 ToolCallStatus::InProgress => " [IN_PROGRESS]",
490 ToolCallStatus::Completed => "",
491 };
492 let content = format!("{}{}", output.output, status_suffix);
493 step.observation = Some(Observation {
494 results: vec![ObservationResult { source_call_id: call_id, content }],
495 });
496 self.push_step(step);
497 }
498 ThreadItemDetails::CommandExecution(cmd) => {
499 let call_id = item_id.to_string();
500 let mut step = Step::agent(self.next_step_id, "");
501 step.timestamp = Some(ts.to_string());
502 step.message = None;
503 step.tool_calls = Some(vec![AtifToolCall {
504 tool_call_id: call_id.clone(),
505 function_name: "command_execution".to_string(),
506 arguments: Some(serde_json::json!({
507 "command": cmd.command,
508 "arguments": cmd.arguments,
509 })),
510 }]);
511 step.observation = Some(Observation {
512 results: vec![ObservationResult {
513 source_call_id: call_id,
514 content: cmd.aggregated_output.clone(),
515 }],
516 });
517 if let Some(exit_code) = cmd.exit_code {
518 step.extra = Some(serde_json::json!({ "exit_code": exit_code }));
519 }
520 self.push_step(step);
521 }
522 ThreadItemDetails::McpToolCall(mcp) => {
523 let call_id = item_id.to_string();
524 let mut step = Step::agent(self.next_step_id, "");
525 step.timestamp = Some(ts.to_string());
526 step.message = None;
527 step.tool_calls = Some(vec![AtifToolCall {
528 tool_call_id: call_id.clone(),
529 function_name: mcp.tool_name.clone(),
530 arguments: mcp.arguments.clone(),
531 }]);
532 if let Some(result) = &mcp.result {
533 step.observation = Some(Observation {
534 results: vec![ObservationResult { source_call_id: call_id, content: result.clone() }],
535 });
536 }
537 self.push_step(step);
538 }
539 ThreadItemDetails::FileChange(fc) => {
540 let changes: Vec<String> = fc.changes.iter().map(|c| format!("{}: {:?}", c.path, c.kind)).collect();
541 let msg = format!("file_changes: {}", changes.join(", "));
542 let mut step = Step::system(self.next_step_id, msg);
543 step.timestamp = Some(ts.to_string());
544 self.push_step(step);
545 }
546 ThreadItemDetails::WebSearch(ws) => {
547 let mut step = Step::system(self.next_step_id, format!("web_search: {}", ws.query));
548 step.timestamp = Some(ts.to_string());
549 if let Some(results) = &ws.results {
550 step.observation = Some(Observation {
551 results: results
552 .iter()
553 .enumerate()
554 .map(|(i, r)| ObservationResult {
555 source_call_id: format!("search_{i}"),
556 content: r.clone(),
557 })
558 .collect(),
559 });
560 }
561 self.push_step(step);
562 }
563 ThreadItemDetails::Harness(h) => {
564 let msg = format!("harness: {:?}", h.event);
565 let mut step = Step::system(self.next_step_id, msg);
566 step.timestamp = Some(ts.to_string());
567 if let Some(m) = &h.message {
568 step.extra = Some(serde_json::json!({ "harness_message": m }));
569 }
570 self.push_step(step);
571 }
572 ThreadItemDetails::Error(e) => {
573 let mut step = Step::system(self.next_step_id, &e.message);
574 step.timestamp = Some(ts.to_string());
575 self.push_step(step);
576 }
577 }
578 }
579
580 fn push_step(&mut self, step: Step) {
581 self.next_step_id = step.step_id + 1;
582 self.steps.push(step);
583 }
584
585 pub fn finish(self, override_metrics: Option<FinalMetrics>) -> Trajectory {
590 let final_metrics = override_metrics.unwrap_or_else(|| FinalMetrics {
591 total_prompt_tokens: Some(self.total_input_tokens),
592 total_completion_tokens: Some(self.total_output_tokens),
593 total_cached_tokens: if self.total_cached_tokens > 0 {
594 Some(self.total_cached_tokens)
595 } else {
596 None
597 },
598 total_cost_usd: None,
599 total_steps: Some(self.steps.len() as u64),
600 extra: Some(serde_json::json!({ "num_turns": self.num_turns })),
601 });
602
603 Trajectory {
604 schema_version: ATIF_SCHEMA_VERSION.to_string(),
605 session_id: self.session_id.unwrap_or_else(|| uuid::Uuid::new_v4().to_string()),
606 agent: self.agent,
607 steps: self.steps,
608 notes: None,
609 final_metrics: Some(final_metrics),
610 extra: None,
611 }
612 }
613
614 pub fn step_count(&self) -> usize {
616 self.steps.len()
617 }
618}
619
620impl crate::EventEmitter for AtifTrajectoryBuilder {
621 fn emit(&mut self, event: &ThreadEvent) {
622 self.process_event(event);
623 }
624}
625
626#[cfg(test)]
627mod tests {
628 use super::*;
629 use crate::{
630 AgentMessageItem, ItemCompletedEvent, ThreadItem, ThreadStartedEvent, ToolInvocationItem, ToolOutputItem,
631 TurnCompletedEvent, TurnStartedEvent, Usage,
632 };
633
634 fn fixed_ts() -> DateTime<Utc> {
635 "2025-01-15T10:30:00Z".parse().unwrap()
636 }
637
638 #[test]
639 fn trajectory_round_trip() {
640 let trajectory = Trajectory {
641 schema_version: ATIF_SCHEMA_VERSION.to_string(),
642 session_id: "test-session".to_string(),
643 agent: AtifAgent::vtcode(),
644 steps: vec![Step::user(1, "hello")],
645 notes: None,
646 final_metrics: None,
647 extra: None,
648 };
649
650 let json = serde_json::to_string_pretty(&trajectory).unwrap();
651 let restored: Trajectory = serde_json::from_str(&json).unwrap();
652 assert_eq!(restored.schema_version, ATIF_SCHEMA_VERSION);
653 assert_eq!(restored.session_id, "test-session");
654 assert_eq!(restored.steps.len(), 1);
655 }
656
657 #[test]
658 fn builder_thread_started_sets_session_id() {
659 let mut builder = AtifTrajectoryBuilder::new(AtifAgent::vtcode());
660 let event = ThreadEvent::ThreadStarted(ThreadStartedEvent { thread_id: "thread-abc".to_string() });
661 builder.process_event_at(&event, fixed_ts());
662 let trajectory = builder.finish(None);
663 assert_eq!(trajectory.session_id, "thread-abc");
664 }
665
666 #[test]
667 fn builder_agent_message_step() {
668 let mut builder = AtifTrajectoryBuilder::new(AtifAgent::vtcode());
669 let event = ThreadEvent::ItemCompleted(ItemCompletedEvent {
670 item: ThreadItem {
671 id: "msg-1".to_string(),
672 details: ThreadItemDetails::AgentMessage(AgentMessageItem { text: "Hello, world!".to_string() }),
673 },
674 });
675 builder.process_event_at(&event, fixed_ts());
676 let trajectory = builder.finish(None);
677
678 assert_eq!(trajectory.steps.len(), 1);
679 let step = &trajectory.steps[0];
680 assert_eq!(step.step_id, 1);
681 assert_eq!(step.source, StepSource::Agent);
682 assert_eq!(step.message.as_deref(), Some("Hello, world!"));
683 }
684
685 #[test]
686 fn builder_tool_invocation_with_output() {
687 let mut builder = AtifTrajectoryBuilder::new(AtifAgent::vtcode());
688 let ts = fixed_ts();
689
690 let inv_event = ThreadEvent::ItemCompleted(ItemCompletedEvent {
692 item: ThreadItem {
693 id: "tool_1".to_string(),
694 details: ThreadItemDetails::ToolInvocation(ToolInvocationItem {
695 tool_name: "read_file".to_string(),
696 arguments: Some(serde_json::json!({"path": "README.md"})),
697 tool_call_id: Some("tc_0".to_string()),
698 status: ToolCallStatus::Completed,
699 outcome: None,
700 }),
701 },
702 });
703 builder.process_event_at(&inv_event, ts);
704
705 let out_event = ThreadEvent::ItemCompleted(ItemCompletedEvent {
707 item: ThreadItem {
708 id: "tool_1:output".to_string(),
709 details: ThreadItemDetails::ToolOutput(ToolOutputItem {
710 call_id: "tool_1".to_string(),
711 tool_call_id: Some("tc_0".to_string()),
712 spool_path: None,
713 output: "file contents here".to_string(),
714 exit_code: Some(0),
715 status: ToolCallStatus::Completed,
716 }),
717 },
718 });
719 builder.process_event_at(&out_event, ts);
720
721 let trajectory = builder.finish(None);
722 assert_eq!(trajectory.steps.len(), 1);
724 let step = &trajectory.steps[0];
725 assert_eq!(step.source, StepSource::Agent);
726
727 let calls = step.tool_calls.as_ref().unwrap();
728 assert_eq!(calls.len(), 1);
729 assert_eq!(calls[0].function_name, "read_file");
730 assert_eq!(calls[0].tool_call_id, "tc_0");
731
732 let obs = step.observation.as_ref().unwrap();
733 assert_eq!(obs.results.len(), 1);
734 assert_eq!(obs.results[0].content, "file contents here");
735 }
736
737 #[test]
738 fn builder_turn_completed_accumulates_metrics() {
739 let mut builder = AtifTrajectoryBuilder::new(AtifAgent::vtcode());
740 let event = ThreadEvent::TurnCompleted(TurnCompletedEvent {
741 usage: Usage {
742 input_tokens: 500,
743 cached_input_tokens: 100,
744 cache_creation_tokens: 0,
745 output_tokens: 200,
746 },
747 });
748 builder.process_event_at(&event, fixed_ts());
749
750 let trajectory = builder.finish(None);
751 let fm = trajectory.final_metrics.as_ref().unwrap();
752 assert_eq!(fm.total_prompt_tokens, Some(500));
753 assert_eq!(fm.total_completion_tokens, Some(200));
754 assert_eq!(fm.total_cached_tokens, Some(100));
755 }
756
757 #[test]
758 fn step_metrics_from_usage() {
759 let usage = Usage {
760 input_tokens: 1000,
761 cached_input_tokens: 200,
762 cache_creation_tokens: 50,
763 output_tokens: 300,
764 };
765 let metrics = StepMetrics::from_usage(&usage);
766 assert_eq!(metrics.prompt_tokens, Some(1000));
767 assert_eq!(metrics.completion_tokens, Some(300));
768 assert_eq!(metrics.cached_tokens, Some(200));
769 assert!(metrics.extra.is_some());
770 }
771
772 #[test]
773 fn builder_implements_event_emitter() {
774 let mut builder = AtifTrajectoryBuilder::new(AtifAgent::vtcode());
775 let event = ThreadEvent::ThreadStarted(ThreadStartedEvent { thread_id: "t-1".to_string() });
776 crate::EventEmitter::emit(&mut builder, &event);
778 assert_eq!(builder.step_count(), 0); }
780
781 #[test]
782 fn skips_lifecycle_events() {
783 let mut builder = AtifTrajectoryBuilder::new(AtifAgent::vtcode());
784 builder.process_event(&ThreadEvent::TurnStarted(TurnStartedEvent::default()));
785 assert_eq!(builder.step_count(), 0);
786 }
787}