Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"seed_type": "bug-seeded",
"expected_files": ["src/lib.rs"],
"reference_patch_size_lines": 2,
"primary_skill": "rust-debugging",
"secondary_skills": ["cargo-test", "chrono"],
"name": "rust_bugfix_001_chrono_off_by_one",
"difficulty": "easy",
"runtime_stressors": ["fault_localization", "test_interpretation"],
"task_type": "single_file_bugfix",
"requires_repo_navigation": false,
"requires_multi_step_reasoning": false,
"has_false_fix_trap": false,
"requires_retry_recovery": false,
"likely_tool_sequence": ["read_files", "edit_files", "run_tests"],
"evaluation_focus": ["correctness", "deterministic_tests"],
"benchmark_bucket": "baseline"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The CLI command `report --date today` returns tomorrow's date in some timezones. Fix the bug and verify the behavior.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "date-resolver"
version = "0.1.0"
edition = "2021"

[dependencies]
chrono = "0.4"

[[test]]
name = "test_fix"
path = "tests/test_fix.rs"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use chrono::{DateTime, Duration, NaiveDate, Utc};

pub fn resolve_today(now: DateTime<Utc>) -> NaiveDate {
let shifted = now + Duration::hours(24);
shifted.date_naive()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use chrono::{TimeZone, Utc};
use date_resolver::resolve_today;

#[test]
fn test_resolve_today_returns_correct_date() {
let now = Utc.with_ymd_and_hms(2024, 3, 15, 10, 0, 0).unwrap();
let result = resolve_today(now);
assert_eq!(
result.to_string(),
"2024-03-15",
"resolve_today should return today's date, not tomorrow's"
);
}

#[test]
fn test_resolve_today_near_midnight() {
let now = Utc.with_ymd_and_hms(2024, 6, 1, 23, 30, 0).unwrap();
let result = resolve_today(now);
assert_eq!(
result.to_string(),
"2024-06-01",
"resolve_today near midnight should still return the current date"
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
id: rust_bugfix_001_chrono_off_by_one
family: bugfix
difficulty: easy
language: rust
max_minutes: 5
max_files_touched: 3
expected_artifacts:
- patch
visible_verification:
- cargo test --test test_fix -q
hidden_verification:
- cargo test -q
success_policy:
require_visible_pass: true
require_hidden_pass: true
fail_on_timeout: true
fail_on_repo_dirty_outside_allowlist: true
allowlist_paths:
- target/
- src/
- tests/
allowed_paths:
- target/
- src/
- tests/
expected_touched_max: 3
task_type: single_file_bugfix
benchmark_track: core
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"seed_type": "bug-seeded",
"expected_files": ["src/lib.rs"],
"reference_patch_size_lines": 3,
"primary_skill": "rust-debugging",
"secondary_skills": ["cargo-test", "std-env"],
"name": "rust_bugfix_002_env_config_precedence",
"difficulty": "easy",
"runtime_stressors": ["fault_localization", "test_interpretation"],
"task_type": "single_file_bugfix",
"requires_repo_navigation": false,
"requires_multi_step_reasoning": false,
"has_false_fix_trap": false,
"requires_retry_recovery": false,
"likely_tool_sequence": ["read_files", "edit_files", "run_tests"],
"evaluation_focus": ["correctness", "deterministic_tests"],
"benchmark_bucket": "baseline"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
When both an environment variable and a config file value are present, the application should prefer the environment variable. Currently the config file value always wins regardless. Fix the precedence bug and verify it.
Loading