lib/validation/taskDraft.ts
├── Types
│ ├── ValidationResult (valid: true | false with error & errorCode)
│ └── ValidationErrorCode (TITLE_REQUIRED, TIME_REQUIRED, TIME_REQUIRES_X_CONDITION)
│
├── Validators
│ ├── validateTitle() - Checks title is non-empty
│ ├── validateTimeRequired() - Checks time condition exists
│ ├── validateTimeXRule() - Enforces Time + X rule
│ ├── hasCondition() - Helper to check metric in conditions
│ ├── hasPartnerCondition() - Check if partner assigned
│ └── hasAnyXCondition() - Check for any X condition
│
├── Main Entry Point
│ └── validateTaskDraft(draft) - Runs all checks in order
│
└── Utilities
└── getConditionSummary() - Debug helper