/**
 * Project Tracker Types
 *
 * Tracks project state: what's been done, what's in progress, key decisions.
 * Persisted in .sandcode/tracker.json.
 *
 * Inspired by Goose's project_tracker — gives SANDCODE awareness of
 * project history across sessions.
 */

export interface ProjectDecision {
  /** What was decided */
  decision: string
  /** Why it was decided this way */
  rationale: string
  /** When the decision was made */
  timestamp: number
  /** Which session made this decision */
  sessionId: string
}

export interface ProjectMilestone {
  /** What was accomplished */
  description: string
  /** When it was completed */
  completedAt: number
  /** Files that were changed */
  filesChanged: string[]
  /** Session that completed it */
  sessionId: string
}

export interface ProjectTask {
  /** Task identifier */
  id: string
  /** What needs to be done */
  description: string
  /** Current status */
  status: 'planned' | 'in-progress' | 'completed' | 'blocked'
  /** When the task was created */
  createdAt: number
  /** When the task was last updated */
  updatedAt: number
  /** Optional: what's blocking this task */
  blockedBy?: string
}

export interface ProjectTrackerState {
  /** Schema version for forward compatibility */
  version: 1
  /** Project name (derived from directory name or git remote) */
  projectName: string
  /** When tracking started */
  startedAt: number
  /** Key architectural/design decisions */
  decisions: ProjectDecision[]
  /** Completed milestones */
  milestones: ProjectMilestone[]
  /** Planned/in-progress tasks */
  tasks: ProjectTask[]
  /** Summary of what the project is about (updated by AI) */
  summary?: string
}
