Century years are treated as leap years

Done

/home/devdi/devswarm/evals/tasks/leap_year_centuries/repo · 2026-11-09 16:15:34 UTC · took 29.1s

  1. Plan (done)
  2. Code (done)
  3. Test (done)
  4. Review (done)
  5. Finish (done)
Cost
$0.0030
Tests
Passed
Iterations
1
Re-plans
0
LLM calls
11
Prompt read from cache
78%

Usage by agent

Cost per agent
planner: $0.0006 planner planner, Cost: $0.0006 $0.0006 coder: $0.0008 coder coder, Cost: $0.0008 $0.0008 tester: $0.0010 tester tester, Cost: $0.0010 $0.0010 reviewer: $0.0007 reviewer reviewer, Cost: $0.0007 $0.0007
Tokens per agent
  • Cache read
  • Cache write
  • Input
  • Output
planner: 7,530 planner planner, Cache read: 5,771 planner, Cache write: 1,003 planner, Output: 748 7,530 coder: 11.4K coder coder, Cache read: 8,553 coder, Cache write: 1,926 coder, Output: 895 11.4K tester: 13.8K tester tester, Cache read: 9,992 tester, Cache write: 2,665 tester, Output: 1,106 13.8K reviewer: 8,497 reviewer reviewer, Cache read: 5,128 reviewer, Cache write: 2,703 reviewer, Output: 660 8,497
View as table
AgentCostCache readCache writeInputOutput
planner$0.00065,7711,0038748
coder$0.00088,5531,9268895
tester$0.00109,9922,66581,106
reviewer$0.00075,1282,7036660

Timeline

  1. planner iteration 1 Finished 3 calls · 7,530 tokens · $0.0006 · 8.1s

    Loading…

  2. coder iteration 1 Finished 3 calls · 11.4K tokens · $0.0008 · 5.5s

    Loading…

  3. tester iteration 1 Finished 3 calls · 13.8K tokens · $0.0010 · 9.0s

    Loading…

  4. verify iteration 1 Passed 0.5s
    ......                                                                   [100%]
    6 passed in 0.02s
    
  5. reviewer iteration 1 Finished 2 calls · 8,497 tokens · $0.0007 · 5.4s

    Loading…

Final diff

diff --git a/calendar_utils.py b/calendar_utils.py
index 5b47463..dce67d9 100644
--- a/calendar_utils.py
+++ b/calendar_utils.py
@@ -2,7 +2,7 @@ _DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
 
 
 def is_leap(year: int) -> bool:
-    return year % 4 == 0
+    return (year % 4 == 0 and year % 100 != 0) or year % 400 == 0
 
 
 def days_in_month(year: int, month: int) -> int:
diff --git a/test_calendar_utils.py b/test_calendar_utils.py
index e4540ed..7538684 100644
--- a/test_calendar_utils.py
+++ b/test_calendar_utils.py
@@ -6,6 +6,35 @@ def test_ordinary_leap_year():
     assert not is_leap(2023)
 
 
+def test_century_years():
+    assert not is_leap(1900)
+    assert is_leap(2000)
+    assert not is_leap(2100)
+
+
+def test_more_400_year_cycle_cases():
+    assert is_leap(1600)
+    assert is_leap(2400)
+    assert not is_leap(1700)
+    assert not is_leap(1800)
+    assert is_leap(1996)
+    assert not is_leap(2001)
+
+
+def test_returns_bool():
+    assert is_leap(2000) is True
+    assert is_leap(1900) is False
+
+
+def test_non_february_months_unaffected_by_century_rule():
+    assert days_in_month(1900, 1) == 31
+    assert days_in_month(1900, 4) == 30
+    assert days_in_month(2000, 3) == 31
+    assert days_in_month(2000, 12) == 31
+
+
 def test_february():
     assert days_in_month(2024, 2) == 29
     assert days_in_month(2023, 2) == 28
+    assert days_in_month(1900, 2) == 28
+    assert days_in_month(2000, 2) == 29