# 任务书 / Task brief

## 输入与现状 / Inputs and current behavior

`brief_tasks.py` reads sibling `tasks.json`. Each record has `id`, `title`, `due_at`, `status`. Dates are ISO 8601 timestamps with an explicit UTC offset, or null. All dated fixture records are timezone-aware. The CLI accepts `--on YYYY-MM-DD` and returns a JSON array in original record order.

程序从同目录 `tasks.json` 读取记录。`due_at` 为带明确 UTC 偏移的 ISO 8601 时间或 null；按 `--on YYYY-MM-DD` 筛选并输出 JSON 数组，保留原始顺序与字段。

已知错误 / Known bug: current filtering uses the date in the original timestamp's timezone instead of converting to Beijing time (UTC+08:00) first.

## 任务 A / Task A — 日期归档 / Date grouping

- 先将时间转换到北京时间，再比较日期。Convert the timestamp to Beijing time before comparing dates.
- 保留原始 `due_at` 字段；只改变筛选逻辑。Keep the original `due_at` value; change selection logic only.
- `due_at: null` 不属于任何日期筛选结果。An undated task is excluded from date filtering.
- 不重排、不改写任务数据。Do not reorder or rewrite records.
- 这一轮暂不添加状态参数。Do not add the status argument in this step.

## 任务 B / Task B — 状态筛选 / Status filter

日期修复验收后，添加 `--status open|done|all`，默认 `all`。状态条件与日期条件同时满足才返回，`all` 不限制状态。无效状态用 CLI 参数错误退出，不输出成功结果。

After accepting the date fix, add `--status open|done|all`, defaulting to `all`. A record must match both date and status; `all` imposes no status restriction. Invalid status values must exit with a CLI argument error rather than a successful result.

## 允许与限制 / Boundaries

- 修改练习副本里的 Python 文件；如补充检查文件，需明确说明用途。Edit the copied Python file. Explain any additional check files you add.
- 保留输入 JSON 和现有输出结构，不安装第三方依赖，不增加网络访问或文件写入。Preserve input JSON and the output contract; no third-party packages, network requests or file writes.
- 时间解析的输入范围为这五条合法示例记录；无需扩展成任意外部数据解析器。Input scope is the five valid fixture records, not a general-purpose external data parser.
- 结束时说明已执行和未执行的检查。Report performed and unperformed checks separately.

## 交付 / Deliverables

1. 可审查的代码差异 / A reviewable diff.
2. 实际命令输出与验收记录 / Actual command output and acceptance notes.
3. 简短解释：为什么先转换时区再取日期 / A short explanation of why conversion must happen before extracting the date.
