> **发布元数据**：ZCode · Kimi K3（评测者确认）· R01
> **来源**：`zcode/输出/zcode/T04/R01/BENCHMARK_RESULT.md`
> **原始文件 SHA-256**：`581640751a3361d85cc02edbf2c8f8a8f1e500a22b11ca338278aa0873a1a3ee`
> 本公开副本已将评测机绝对路径归一化；下文 PASS/FAIL/BLOCKED 是执行报告自述状态，不等同于独立验收结论。

---

PASS

# T04 R01 基准测试结果

## 状态
PASS

## 实际改动
仅改动 workspace 内文件，冻结提交 ed2390f 基线上：

1. `ledger/query.py`（唯一改动的源文件）
   - `filter_by_date` 边界由排他改为包含两端：
     - `transaction.date <= start` → `transaction.date < start`
     - `transaction.date >= end` → `transaction.date > end`
   - 更新注释为 `# Bounds are inclusive on both ends; dates are compared as parsed dates.`
   - `_parse_date_bound` 未改动：仍用 `date.fromisoformat` 做日期解析（非字符串排序），并用 `parsed.isoformat() != value` 强制 ISO `YYYY-MM-DD` 格式，格式错误或无效日历日期抛 `ValueError`。
   - 函数签名、`list_transactions` 及其他过滤行为未变。
2. 新增 `tests/test_date_bounds.py`（新文件，未删改 `tests/test_baseline.py`）
   - FilterByDateBoundsTests：无边界全量、start/end 各自包含边界值、单日区间（start==end）包含两端、完整区间、单边不设限。
   - FilterByDateValidationTests：无效日历日期（2025-13-01、2025-02-30）、非 ISO 格式（01/01/2025）、非零填充（2025-1-1）、垃圾字符串均抛 ValueError。
   - CliDateHandlingTests：CLI 单日区间包含两端记录（A-02、A-01），非法 start/end 日期非零退出。
3. 未改动 `ledger/cli.py`（`_parse_cli_date` 与 `main()` 现有错误处理已满足要求：打印 `ledger: error: ...` 并返回 2），未做 T07 重构，未增加依赖，未联网。

## 实际运行的命令及结果
所有命令均先 `cd <评测根目录>/zcode/输出/zcode/T04/R01/workspace`。

### 1. `time python3 -m unittest discover -s tests -v`
结果：19 个测试全部 OK（4 个既有 baseline + 15 个新增），退出码 0。

```
test_default_fixture_loads (test_baseline.BaselineSmokeTests) ... ok
test_default_summary_shape (test_baseline.BaselineSmokeTests) ... ok
test_list_command_runs (test_baseline.BaselineSmokeTests) ... ok
test_valid_money_inputs (test_baseline.BaselineSmokeTests) ... ok
test_cli_invalid_end_date_nonzero_exit (test_date_bounds.CliDateHandlingTests) ... ledger: error: end_date must use YYYY-MM-DD
ok
test_cli_invalid_start_date_nonzero_exit (test_date_bounds.CliDateHandlingTests) ... ledger: error: start_date must use YYYY-MM-DD
ok
test_cli_single_day_range_inclusive (test_date_bounds.CliDateHandlingTests) ... ok
test_end_bound_inclusive (test_date_bounds.FilterByDateBoundsTests) ... ok
test_full_range (test_date_bounds.FilterByDateBoundsTests) ... ok
test_no_bounds_returns_all (test_date_bounds.FilterByDateBoundsTests) ... ok
test_only_end_bound_leaves_start_unlimited (test_date_bounds.FilterByDateBoundsTests) ... ok
test_only_start_bound_leaves_end_unlimited (test_date_bounds.FilterByDateBoundsTests) ... ok
test_single_day_range_includes_both_ends (test_date_bounds.FilterByDateBoundsTests) ... ok
test_start_bound_inclusive (test_date_bounds.FilterByDateBoundsTests) ... ok
test_garbage_raises (test_date_bounds.FilterByDateValidationTests) ... ok
test_invalid_calendar_end_date_raises (test_date_bounds.FilterByDateValidationTests) ... ok
test_invalid_calendar_start_date_raises (test_date_bounds.FilterByDateValidationTests) ... ok
test_non_iso_format_raises (test_date_bounds.FilterByDateValidationTests) ... ok
test_non_zero_padded_format_raises (test_date_bounds.FilterByDateValidationTests) ... ok

----------------------------------------------------------------------
Ran 19 tests in 0.003s

OK
0.058 total
```

### 2. CLI 手动验证（逐条执行，输出与退出码均为实测）
- `python3 -m ledger list --start-date 2025-01-01 --end-date 2025-01-01`
  → 输出包含两端记录 `A-02 | 2025-01-01 | Food | $12.00` 与 `A-01 | 2025-01-01 | Food | $-1.95`，exit=0。
  （`$-1.95` 为既有 formatting 对 -0.05 的显示行为，与本题无关，baseline 测试不受影响。）
- `python3 -m ledger list --start-date 2025-01-01 --end-date 2025-01-31`
  → 输出 A-02、A-01、B-01(2025-01-02)、C-01(2025-01-31)，含 1/31 端点，exit=0。
- `python3 -m ledger list --start-date 2025-13-01`
  → stderr `ledger: error: start_date must use YYYY-MM-DD`，exit=2。
- `python3 -m ledger list --end-date 2025-02-30`
  → stderr `ledger: error: end_date must use YYYY-MM-DD`，exit=2。
- `python3 -m ledger list --start-date 01/01/2025`
  → stderr `ledger: error: start_date must use YYYY-MM-DD`，exit=2。

### 3. `git status --short && git diff`
确认改动范围：`M ledger/query.py`、`?? tests/test_date_bounds.py`，无其他改动。

## 耗时
约 3 分钟（探查代码 + 修改 + 新增测试 + 运行测试与 CLI 验证 + 撰写本文件）；unittest 本身 0.06s。

## 尚未完成的要求
无。题面全部要求（包含两端、缺省不设限、日期语义比较、非法日期 ValueError、签名兼容、CLI 非零退出、运行 unittest 并报告）均已完成并实测验证。

## 会话隔离状态
- 仅在运行目录 `<评测根目录>/zcode/输出/zcode/T04/R01/` 内读写：改动限于其 `workspace/` 下的 `ledger/query.py` 与新增 `tests/test_date_bounds.py`，本文件写于运行目录根部。
- 未访问、修改题目源文件、基准仓库或其他运行目录；未联网、未安装任何包（仅标准库 python3）；未删改既有测试。
