Key Insight: State that survives compression -- because it's outside the conversation.
- Persistent task state — JSON files in
.tasks/that survive context compression - Dependency graphs — blockedBy/blocks edges between tasks
- Automatic unblocking — completing a task frees its dependents
- External state — why keeping state outside the conversation is critical
- Completed 06: Context Compaction
- Understand the 3-layer compression pipeline
make 07-task-system
# or
uv run python 07-task-system/agent.py| Feature | 06 (Compaction) | 07 (Task System) |
|---|---|---|
| Planning | In conversation (lost on compress) | Persisted to .tasks/ |
| Dependencies | None | DAG with blockedBy/blocks |
| Visibility | TodoManager (in-memory) | File-based (survives restarts) |
| Tool count | 6 | 8 (+ task_create, task_update, task_list, task_get) |
.tasks/
task_1.json {"id":1, "subject":"...", "status":"completed"}
task_2.json {"id":2, "blockedBy":[1], "status":"pending"}
task_3.json {"id":3, "blockedBy":[2], "status":"pending"}
Dependency resolution:
task_1 ──> task_2 ──> task_3
(done) (unblocked) (still blocked)
Completing task 1 removes it from task 2's blockedBy list, making task 2 actionable.
| File | Lines | Description |
|---|---|---|
agent.py |
~250 | Agent with TaskManager and dependency graph |
Ready for background execution? → 08: Background Tasks