name: multi_timeframe_freshness_readiness
timeout: 5s
universes:
  - name: kr-core
    provider: kis
    selector_kind: watchlist
    market: kr
    venue: krx
    symbols: ["005930", "000660"]
steps:
  - id: freshness_monthly
    action: collection_freshness
    request:
      universe: kr-core
      timeframe: monthly
      from_unix_ms: 1735689600000 # 2025-01-01 00:00:00 UTC
      to_unix_ms: 1743465600000   # 2025-04-01 00:00:00 UTC
      expected_buckets: ["202501", "202502", "202503"]
    expect:
      status: ok
      freshness_status: fresh
      missing_count: 0
      latest_bucket: "202503"
      gap_status: gap
      gap_count: 2
      duplicate_count: 0
      provider_delay_days: 0

  - id: freshness_daily
    action: collection_freshness
    request:
      universe: kr-core
      timeframe: daily
      from_unix_ms: 1735689600000
      to_unix_ms: 1735948800000
      expected_buckets: ["20250101", "20250102", "20250103"]
    expect:
      status: ok
      freshness_status: fresh
      missing_count: 0
      latest_bucket: "20250103"
      gap_status: clean
      gap_count: 0
      duplicate_count: 0
      provider_delay_days: 0

  - id: freshness_minute_1
    action: collection_freshness
    request:
      universe: kr-core
      timeframe: minute_1
      from_unix_ms: 1735722000000 # 2025-01-01 09:00:00 UTC
      to_unix_ms: 1735722180000   # 2025-01-01 09:03:00 UTC
      expected_buckets: ["202501010900", "202501010901", "202501010902"]
    expect:
      status: ok
      freshness_status: fresh
      missing_count: 0
      latest_bucket: "202501010901"
      gap_status: delayed
      gap_count: 0
      duplicate_count: 0
      provider_delay_days: 1

  - id: freshness_minute_5
    action: collection_freshness
    request:
      universe: kr-core
      timeframe: minute_5
      from_unix_ms: 1735722000000 # 2025-01-01 09:00:00 UTC
      to_unix_ms: 1735722600000   # 2025-01-01 09:10:00 UTC
      expected_buckets: ["202501010900", "202501010905"]
    expect:
      status: ok
      freshness_status: fresh
      missing_count: 0
      latest_bucket: "202501010905"
      gap_status: duplicate
      gap_count: 0
      duplicate_count: 1
      provider_delay_days: 0
