Two Digits Too Few

Easy

· Backend

Incident

SEV-3

Time to fix: 10 min

Failing checks on the shipped build

  • low two-digits land in the 2000s

    expected 2023 but got 1923

How to work this incident

  1. Read the report: write down the expected behaviour and the actual one in a sentence each.
  2. Reproduce it: run the visible tests and find the failing check that matches the report.
  3. Read the logs and the failing checks for the first value that is wrong — the earliest wrong value is nearer the cause than the loudest error.
  4. Follow the request through the handler, the validation and the service it calls; find the first step whose output disagrees with the report.
  5. Fix the cause rather than the symptom, run the visible tests again, and submit against the hidden ones — then write the root cause down.

Inspired by

Y2K

Inspired by Y2K — billions were spent because "99" meant 1999 but "00" meant… 1900? Legacy feeds still send two-digit years, and the agreed pivot rule is: below 30 → 2000s, otherwise 1900s.

years.py still lives in the 20th century.

Code map

# Expands a two-digit year from legacy feeds.

PIVOT = 30

def parse_year(two_digits):
    return 1900 + int(two_digits)

Sign in to edit the file, run the tests and submit a fix

A free account — no card, no trial clock. You come straight back here.

Two Digits Too Few — Python Bug Hunt

Inspired by Y2K — billions were spent because "99" meant 1999 but "00" meant… 1900?

  • Language: Python
  • Layer: Backend
  • Difficulty: Easy
  • Concepts: Parsing, Y2K
  • Modelled on: Y2K
  • Visible tests: high two-digits stay in the 1900s; low two-digits land in the 2000s
  • Reward: 50 XP for a complete fix

Incident

  • Severity: SEV-3
  • Time to fix: 10 minutes, the target for an easy incident

Failing checks on the shipped build

  • low two-digits land in the 2000s — expected 2023 but got 1923

How to work this incident

  1. Read the report: write down the expected behaviour and the actual one in a sentence each.
  2. Reproduce it: run the visible tests and find the failing check that matches the report.
  3. Read the logs and the failing checks for the first value that is wrong — the earliest wrong value is nearer the cause than the loudest error.
  4. Follow the request through the handler, the validation and the service it calls; find the first step whose output disagrees with the report.
  5. Fix the cause rather than the symptom, run the visible tests again, and submit against the hidden ones — then write the root cause down.

Briefing

Inspired by Y2K — billions were spent because "99" meant 1999 but "00" meant… 1900? Legacy feeds still send two-digit years, and the agreed pivot rule is: below 30 → 2000s, otherwise 1900s.

years.py still lives in the 20th century.

Bug report

BUG-Y2K · Reported by: partner integrations

parse_year(two_digits):

  • "99" -> 1999
  • "23" -> 2023
  • "00" -> 2000
  • "30" -> 1930 (the pivot)

Observed: everything gets 1900 added — customers born in "05" are 120 years old and the compliance system keeps flagging them as deceased.

Logs

[kyc] dob year "05" -> 1905 -> age 121 -> auto-flag

The code as shipped

src/legacy/years.py (editable)

# Expands a two-digit year from legacy feeds.

PIVOT = 30

def parse_year(two_digits):
    return 1900 + int(two_digits)

Open the hunt to start the incident clock, edit the files, run the visible tests and submit against the hidden ones, then write the root cause down. More Python bug hunts.