Files
obsidian-notes/.omx/specs/deep-interview-scheduled-task-git-sync-gant.md
2026-05-07 01:13:24 +08:00

86 lines
4.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Spec: Deep Interview — scheduled-task-git-sync-gant
## Metadata
- **Profile:** Standard
- **Rounds:** 12
- **Final Ambiguity:** 0.16
- **Threshold:** 0.20 (met)
- **Type:** Brownfield
- **Context Snapshot:** `.omx/context/scheduled-task-git-sync-gant-20260429T161523Z.md`
## Clarity Breakdown
| Dimension | Weight | Score | Notes |
|-----------|--------|-------|-------|
| Intent | 0.25 | 0.85 | InBox notes visible in Gantt chart without manual steps |
| Outcome | 0.20 | 0.85 | New → added, deleted → removed, existing → de-duplicated |
| Scope | 0.20 | 0.85 | PARA/InBox git only; "待看" type only; .md files only |
| Constraints | 0.15 | 0.80 | Win Task Scheduler; gantt-app.exe; toast; abort on conflict; no logs |
| Success | 0.10 | 0.80 | At 22:30, Gantt shows "待看:xxx" for all InBox .md files |
| Context | 0.10 | 0.90 | Well-understood repo and tooling |
| **Weighted** | | **0.84** | Ambiguity = 0.16 |
## Intent
用户希望每晚 22:30 自动将 InBox 中的待读笔记同步到甘特图软件中,消除手动搬运步骤。
## Desired Outcome
- 甘特图出现所有 InBox 中 `.md` 文件对应的 "待看:{文件名}" 任务
- 已存在的不重复添加(更新)
- InBox 中已删除的文件对应任务也从甘特图中移除
- Git 自动拉取/提交/推送 PARA/ 和 InBox/ 目录
## In-Scope
1. 每晚 22:30 通过 Windows Task Scheduler 触发
2. `git pull && git add PARA/ InBox/ && git commit -m "auto nightly sync" && git push`
3. 扫描 InBox/*.md为每个文件在甘特图创建/更新 "待看:{文件名}" 任务
4. 检测甘特图中已存在的 "待看:xxx" 任务,若 InBox 中对应文件已删除则移除
5. 去重:已在甘特图中的任务不重复创建,仅更新
6. 脚本文件与 gantt-app.exe 放在同一目录
## Out-of-Scope / Non-goals
1. 不操作 PARA/ 和 InBox/ 之外的任何文件
2. 不创建 "待看" 之外的甘特图任务类型
3. 不处理非 `.md` 文件
## Decision Boundaries (OMX 可自行决定)
- 具体用哪个 Windows 通知 APIPowerShell toast / `msg` / 其他)
- Git commit 消息的具体格式
- 脚本语言选择bash / PowerShell / 混合)
- 甘特图 CLI 的 command/subcommand 细节(从 gant-cli skill 获取)
## Constraints
- **触发机制:** Windows Task Scheduler非 Claude session 依赖)
- **甘特图 CLI:** `gantt-app.exe`
- **脚本位置:** 与 gantt-app.exe 同目录
- **Git 冲突:** abort保留本地
- **Push 失败:** Windows 右下角 toast 通知
- **甘特图未运行:** 静默跳过,次日重试
- **日志:** 不需要
- **重名任务:** 更新而非跳过
- **持久化:** 无 Claude session 依赖(系统级调度)
## Testable Acceptance Criteria
- [ ] 晚上 22:30打开甘特图能看到所有 InBox/*.md 对应的 "待看:{文件名}" 任务
- [ ] 在 InBox 中新增一个 .md 文件 → 下次执行后甘特图出现对应任务
- [ ] 在 InBox 中删除一个 .md 文件 → 下次执行后甘特图移除对应任务
- [ ] 非 .md 文件被忽略
- [ ] PARA/ 和 InBox/ 外文件不受 git 影响
- [ ] Git 冲突时 abort 不丢数据
- [ ] 甘特图未运行时脚本不崩溃
## Assumptions Exposed + Resolved
1. **gantt-app.exe CLI 能力:** 假设支持 add/delete/list 操作 → 实现时通过 gant-cli skill 确认
2. **Session-only vs durable:** 初始误解为 Claude session 调度 → 澄清为系统级 Windows Task Scheduler
3. **文件处理后:** 最初未明确 → 澄清为保留文件、双向同步
## Pressure-Pass Findings
- Round 2 追问了具体格式("到底长什么样")→ 从模糊的"处理"收缩到 `待看:{标题}`
- Round 8 追问了 session-only 假设 → 推翻了 CronCreate 方案,转向系统级 Task Scheduler
- Round 11 追问了明确的 non-goals → 三条边界锁定
## Handoff Contract
This spec is the requirements source of truth. Downstream execution must preserve:
- Intent, non-goals, decision boundaries, and acceptance criteria
- The bidirectional mirror model (InBox ↔ Gantt)
- System-level scheduling (not Claude session-dependent)