(
action: AutomationRunAction,
)
| 444 | } |
| 445 | |
| 446 | async fn handle_automation_run_command( |
| 447 | action: AutomationRunAction, |
| 448 | ) -> tracedecay::errors::Result<()> { |
| 449 | use tracedecay::automation::backend::CodexAppServerBackend; |
| 450 | use tracedecay::automation::config::{ |
| 451 | effective_config, load_project_config, AutomationBackend, |
| 452 | }; |
| 453 | use tracedecay::automation::runner::{ |
| 454 | run_memory_curator_with_backend, run_session_reflector_with_backend, |
| 455 | run_skill_writer_with_backend, MemoryCuratorAutomationOptions, |
| 456 | SessionReflectorAutomationOptions, SkillWriterAutomationOptions, |
| 457 | }; |
| 458 | |
| 459 | match action { |
| 460 | AutomationRunAction::MemoryCuration { |
| 461 | dry_run, |
| 462 | max_clusters, |
| 463 | min_confidence, |
| 464 | path, |
| 465 | } => { |
| 466 | if !dry_run { |
| 467 | return Err(tracedecay::errors::TraceDecayError::Config { |
| 468 | message: "automation run memory-curation only supports --dry-run true" |
| 469 | .to_string(), |
| 470 | }); |
| 471 | } |
| 472 | let project_path = resolve_cli_project_root(path, None, None).await?; |
| 473 | let cg = crate::serve::ensure_initialized(&project_path).await?; |
| 474 | let dashboard_root = cg.store_layout().dashboard_root.clone(); |
| 475 | let global = tracedecay::user_config::UserConfig::load().automation; |
| 476 | let project = load_project_config(&dashboard_root).await?; |
| 477 | let effective = effective_config(&global, project.as_ref())?; |
| 478 | if effective.enabled && effective.backend == AutomationBackend::ExternalCommand { |
| 479 | return Err(tracedecay::errors::TraceDecayError::Config { |
| 480 | message: "automation backend external_command is not implemented yet" |
| 481 | .to_string(), |
| 482 | }); |
| 483 | } |
| 484 | let backend = CodexAppServerBackend::from_automation_config(&effective); |
| 485 | let run = run_memory_curator_with_backend( |
| 486 | &cg, |
| 487 | &effective, |
| 488 | &backend, |
| 489 | MemoryCuratorAutomationOptions { |
| 490 | trigger: tracedecay::automation::run_ledger::AutomationTrigger::ManualCli, |
| 491 | run_id: None, |
| 492 | max_clusters, |
| 493 | min_confidence, |
| 494 | }, |
| 495 | ) |
| 496 | .await?; |
| 497 | println!("{}", serde_json::to_string_pretty(&run)?); |
| 498 | } |
| 499 | AutomationRunAction::SessionReflection { |
| 500 | dry_run, |
| 501 | provider, |
| 502 | query, |
| 503 | evidence_limit, |
no test coverage detected