State Management
Genie tracks state primarily in PostgreSQL via the embedded pgserve database. Wishes, tasks, boards, projects, agents, teams, mailboxes, and team chat all live in PG tables. Legacy JSON file state has been replaced by database-backed equivalents.Wish State Machine
Wish execution is tracked in PostgreSQL via the task service. A wish becomes a parent task, and each execution group becomes a child task with dependency edges.State Transitions
Dependency Resolution
When a group completes,completeGroup() recalculates all dependent groups. If every dependency of a blocked group is now done, that group transitions to ready.
tasks + task_dependencies tables. PG handles concurrency natively — no file locks are needed for wish state.
Board State
Boards provide project-scoped Kanban pipelines. Each board has ordered columns with gate types and action skills:
Tasks are assigned to board columns via
column_id. Use genie board reconcile to fix orphaned column references after pipeline changes.
Project State
Projects group boards and tasks into named scopes:
Tasks scope to projects via
project_id. When running genie task list inside a repo, it auto-scopes to that repo’s project.
Agent Registry
Every spawned agent is tracked in the PostgreSQLagents table. The registry stores provider metadata, transport info, and lifecycle state.
Agent States
Agent Record
Each agent record includes:Team Management
Teams are stored in the PostgreSQLteams table. Each team owns an isolated clone of the repository.
Team Lifecycle
Isolation Model
Teams usegit clone --shared instead of git worktree to avoid a known bug where Claude Code agents can flip core.bare=true on the parent repo via shared .git metadata, silently corrupting it.
Mailbox
Messages persist to the PostgreSQLmailbox table before any push delivery attempt. This ensures durability — even if tmux delivery fails, the message is stored in the database.
Message Format
Team Chat
Each team has a group chat stored in the PostgreSQLteam_chat table.