import type { ConditionBand, TraceLane } from '../SwimlaneTrace'

export const TRACE_START_MS = 1_783_520_436_610

export const REAL_TRACE_LANES: TraceLane[] = [
  {
    taskId: 't1',
    name: 'Negative DB guards',
    wave: 1,
    segments: [
      { t0: TRACE_START_MS, durMs: 420_000, cat: 'llm-implement', status: 'success', agentId: 't1', journalSeq: 41 },
      { t0: TRACE_START_MS + 420_000, durMs: 300_000, cat: 'gate0', status: 'running', agentId: 't1', journalSeq: 42 },
      {
        t0: TRACE_START_MS + 720_000,
        durMs: 180_000,
        cat: 'llm-fixer',
        status: 'fail',
        agentId: 't1',
        note: 'write-path assertion repaired',
        journalSeq: 43,
      },
    ],
  },
  {
    taskId: 't5',
    name: 'Land changes',
    wave: 2,
    segments: [
      { t0: TRACE_START_MS + 900_000, durMs: 150_000, cat: 'llm-review', agentId: 't5', journalSeq: 44 },
    ],
  },
  {
    taskId: '__run__',
    name: 'Run recovery',
    wave: 2,
    segments: [{ t0: TRACE_START_MS + 1_050_000, durMs: 60_000, cat: 'idle-restart' }],
  },
]

export const REAL_TRACE_BANDS: ConditionBand[] = [
  {
    wrapper: 'codex',
    fromMs: TRACE_START_MS + 420_000,
    toMs: TRACE_START_MS + 720_000,
    laneIds: ['t1'],
    label: 'codex rate limited',
  },
]

/** Gallery-only fixture: ~45s burst for short-span axis labels. */
export const GALLERY_TRACE_SHORT_SPAN_START_MS = Date.UTC(2026, 7, 9, 12, 0, 0)
export const GALLERY_TRACE_SHORT_SPAN_LANES: TraceLane[] = [
  {
    taskId: 'gallery-short',
    name: 'Fixture burst',
    wave: 1,
    segments: [{ t0: GALLERY_TRACE_SHORT_SPAN_START_MS, durMs: 45_000, cat: 'gate0' }],
  },
]

/** Gallery-only fixture: lanes with no temporal segments (axis hidden). */
export const GALLERY_TRACE_NO_TEMPORAL_LANES: TraceLane[] = [
  { taskId: 'gallery-empty', name: 'Fixture waiting', wave: 1, segments: [] },
  { taskId: 'gallery-queued', name: 'Fixture queued', wave: 2, segments: [] },
]

/** Gallery-only fixture: running trace anchor for hour/live zoom windows. */
export const GALLERY_TRACE_RUNNING_NOW_MS = TRACE_START_MS + 555_000

/** Gallery-only fixture: multi-day span for calendar axis labels. */
export const GALLERY_TRACE_MULTI_DAY_START_MS = Date.UTC(2026, 7, 1, 8, 0, 0)
export const GALLERY_TRACE_MULTI_DAY_LANES: TraceLane[] = [
  {
    taskId: 'gallery-long',
    name: 'Fixture multi-day',
    wave: 1,
    segments: [{ t0: GALLERY_TRACE_MULTI_DAY_START_MS, durMs: 3 * 86_400_000, cat: 'llm-implement' }],
  },
]
