Phase 1: Extract Domain Types ============================= - Create internal/domain/ package with canonical types: - domain/task.go: Task, Attempt structs - domain/tracking.go: TrackingConfig and MLflow/TensorBoard/Wandb configs - domain/dataset.go: DatasetSpec - domain/status.go: JobStatus constants - domain/errors.go: FailureClass system with classification functions - domain/doc.go: package documentation - Update queue/task.go to re-export domain types (backward compatibility) - Update TUI model/state.go to use domain types via type aliases - Simplify TUI services: remove ~60 lines of conversion functions Phase 2: Delete ErrorCategory System ==================================== - Remove deprecated ErrorCategory type and constants - Remove TaskError struct and related functions - Remove mapping functions: ClassifyError, IsRetryable, GetUserMessage, RetryDelay - Update all queue implementations to use domain.FailureClass directly: - queue/metrics.go: RecordTaskFailure/Retry now take FailureClass - queue/queue.go: RetryTask uses domain.ClassifyFailure - queue/filesystem_queue.go: RetryTask and MoveToDeadLetterQueue updated - queue/sqlite_queue.go: RetryTask and MoveToDeadLetterQueue updated Lines eliminated: ~190 lines of conversion and mapping code Result: Single source of truth for domain types and error classification
30 lines
1.1 KiB
Go
30 lines
1.1 KiB
Go
package domain
|
|
|
|
// TrackingConfig specifies experiment tracking tools to enable for a task.
|
|
type TrackingConfig struct {
|
|
MLflow *MLflowTrackingConfig `json:"mlflow,omitempty"`
|
|
TensorBoard *TensorBoardTrackingConfig `json:"tensorboard,omitempty"`
|
|
Wandb *WandbTrackingConfig `json:"wandb,omitempty"`
|
|
}
|
|
|
|
// MLflowTrackingConfig controls MLflow integration.
|
|
type MLflowTrackingConfig struct {
|
|
Enabled bool `json:"enabled"`
|
|
Mode string `json:"mode,omitempty"` // "sidecar" | "remote" | "disabled"
|
|
TrackingURI string `json:"tracking_uri,omitempty"` // Explicit tracking URI for remote mode
|
|
}
|
|
|
|
// TensorBoardTrackingConfig controls TensorBoard integration.
|
|
type TensorBoardTrackingConfig struct {
|
|
Enabled bool `json:"enabled"`
|
|
Mode string `json:"mode,omitempty"` // "sidecar" | "disabled"
|
|
}
|
|
|
|
// WandbTrackingConfig controls Weights & Biases integration.
|
|
type WandbTrackingConfig struct {
|
|
Enabled bool `json:"enabled"`
|
|
Mode string `json:"mode,omitempty"` // "remote" | "disabled"
|
|
APIKey string `json:"api_key,omitempty"`
|
|
Project string `json:"project,omitempty"`
|
|
Entity string `json:"entity,omitempty"`
|
|
}
|