Skip to content

feat: Persistent task management backed by brainfile#459

Closed
1broseidon wants to merge 2 commits intodwash96:v0.97.2from
1broseidon:feat/cecli-tasks-brainfile
Closed

feat: Persistent task management backed by brainfile#459
1broseidon wants to merge 2 commits intodwash96:v0.97.2from
1broseidon:feat/cecli-tasks-brainfile

Conversation

@1broseidon
Copy link

Summary

Replaces .cecli/todo.txt with structured task files in .cecli/tasks/board/, powered by the brainfile Python library. The agent and user experience is unchanged — UpdateTodoList is still the only tool, the prompt is untouched, and the ✓/○/→ display is identical.

What users get for free:

  • Persistence across sessions — incomplete todos survive session restarts
  • History — completed tasks move to .cecli/tasks/logs/ with timestamps
  • Power-user access/task list, /task show, /task complete for humans who want control
  • Session resumeget_todo_list() auto-finds incomplete tasks from previous sessions

How it works

UpdateTodoList called →
  get_or_create_session_task() finds/creates task file transparently →
  writes subtasks to .cecli/tasks/board/task-N.md →
  agent sees same <context name="todo_list"> block it always did

The board auto-initializes on first UpdateTodoList call. No explicit setup. No new LLM tools. The agent never knows brainfile exists.

Changes

  • cecli/brainfile/store.py — New adapter (~640 lines) over brainfile library. Handles task CRUD, session-task binding, context rendering, TUI bar updates.
  • cecli/tools/update_todo_list.py — Collapsed two write paths into one. Always routes through store.
  • cecli/coders/agent_coder.pyget_todo_list() always renders from store. Auto-resumes incomplete tasks.
  • cecli/commands/task.py/task commands for power users: list, add, new, show, open, update, delete, complete, drop.
  • cecli/sessions.py — Saves/restores active_task_id in session JSON.
  • cecli/tools/__init__.py — Removed 7 board-only LLM tools (TaskCreate, TaskList, etc.).
  • cecli/tools/utils/registry.py — Removed conditional board-tool gating.
  • cecli/tui/widgets/active_task_bar.py — TUI status bar showing active task progress.

Foundation for subagent orchestration

The .cecli/tasks/ directory and brainfile task format also support contracts — structured deliverables, validation commands, and constraints. When subagents land, the parent can create a task with a contract, pass the task ID to the subagent, and the subagent works within that scope. Same files, same library, one-parameter integration: spawn_subagent(task_id="task-2").

Test plan

  • 45 tests passing (store, task management, sessions)
  • Manual test: fresh session → UpdateTodoList auto-creates board + task
  • Manual test: close session → reopen → incomplete todos resume
  • Manual test: /task list, /task complete, /task new work as expected
  • Manual test: agent prompt unchanged, no mention of brainfile/boards
  • Verify no regression on existing UpdateTodoList behavior

Note: Based on v0.97.2 branch per @dwash96's recommendation. Depends on brainfile Python library (brainfile/py) — currently as path dep, will switch to PyPI versioned dep.

🤖 Generated with Claude Code

@1broseidon 1broseidon changed the base branch from main to v0.97.2 February 27, 2026 22:12
@1broseidon 1broseidon force-pushed the feat/cecli-tasks-brainfile branch from ba0fdaa to 04df2fe Compare February 28, 2026 22:33
UpdateTodoList now writes to structured task files in .cecli/tasks/board/
instead of a flat .cecli/todo.txt. The agent and user experience is
identical — same tool, same prompt, same display — but todos now persist
across sessions, maintain history in logs/, and support power-user access
via /task commands.

Key changes:
- UpdateTodoList always routes through CecliTaskStore (single write path)
- Session tasks auto-create on first UpdateTodoList call
- get_todo_list() auto-resumes incomplete tasks from previous sessions
- Task files never leak into agent context (only <context> block visible)
- Removed 7 board-only LLM tools (TaskCreate, TaskList, etc.)
- Added /task new, removed /task promote
- Session save/restore preserves active_task_id
- Tasks-only type system (no epic/adr in initial version)
- Cached tab completion for task IDs
- Passes isort, black, flake8 pre-commit checks
@1broseidon 1broseidon force-pushed the feat/cecli-tasks-brainfile branch from 04df2fe to ef29076 Compare February 28, 2026 22:35
@1broseidon
Copy link
Author

Updates in latest push:

  • Fixed all required PR checks — isort, black (line-length 100, preview mode), and flake8 now pass cleanly
  • Simplified code and improved code quality — removed unused brainfile imports, hoisted duplicate store construction, cached tab completion for task IDs, consolidated duplicate session title logic, fixed stale column fallbacks
  • Removed EPIC/ADR types for the MVP versioncreate_task now hardcodes type as "task", removed task_type parameter, dropped epic/adr/contract/base schema references from docs. Tasks are the only item type in the initial version.

@1broseidon
Copy link
Author

Pulling back while we rethink the task architecture — separating ephemeral scratchpad (UpdateTodoList) from explicit persistent tasks (/task add, CreateTask tool). The current design conflates both into the same task-N namespace which muddies the UX.

@1broseidon 1broseidon closed this Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant