SQLite format 3@ .  th TEXT, branch_name TEXT, -- Optional link to a first-class Project (hermes_cli/projects_db). When set, -- the task's worktree is anchored under the project's primary repo with a -- deterministic branch name instead of a random wt/ fallback. project_id TEXT, claim_lock TEXT, claim_expires INTEGER, tenant TEXT, result TEXT, idempotency_key TEXT, -- Unified consecutive-failure counter. Incremented on spawn -- failure, timeout, or crash; reset only on successful completion. -- The circuit breaker in _record_task_failure trips when this -- exceeds DEFAULT_FAILURE_LIMIT consecutive non-successes. consecutive_failures INTEGER NOT NULL DEFAULT 0, worker_pid INTEGER, -- Short excerpt of the most recent failure's error text. last_failure_error TEXT, max_runtime_seconds INTEGER, last_heartbeat_at INTEGER, -- Pointer into task_runs for the currently-active run (NULL if no -- run is in-flight). Denormalised for cheap reads. current_run_id INTEGER, -- Forward-compat for v2 workflow routing. In v1 the kernel writes -- these when the task is opted into a template but otherwise ignores -- them; the dispatcher doesn't consult them for routing yet. workflow_template_id TEXT, current_step_key TEXT, -- Force-loaded skills for the worker on this task, stored as JSON. -- Passed to the worker via `--skills`. NULL or empty array = no extras. skills TEXT, -- Per-task model override. When set, the dispatcher passes -m -- to the worker, overriding the profile's default model. NULL = use -- the profile default. model_override TEXT, -- Per-task override for the consecutive-failure circuit breaker. -- The value is the failure count at which the breaker trips — e.g. -- ``max_retries=1`` blocks on the first failure. NULL (the common -- case) falls through to the dispatcher-level ``kanban.failure_limit`` -- config and then ``DEFAULT_FAILURE_LIMIT``. max_retries INTEGER, -- When 1, the dispatched worker runs in a Ralph-style goal loop: an -- auxiliary judge re-evaluates the worker's response against the -- card title/body after each turn and feeds a continuation prompt -- back into the SAME session until the judge agrees the work is done -- or ``goal_max_turns`` is exhausted. NULL/0 = classic single-shot -- worker (the default). goal_mode INTEGER NOT NULL DEFAULT 0, -- Goal-loop turn budget for ``goal_mode`` workers. NULL = use the -- goals-engine default. goal_max_turns INTEGER, -- Originating chat/agent session id when the task was created from -- inside an agent loop that propagated ``HERMES_SESSION_ID``. NULL -- for tasks created from the CLI, dashboard, or any path that doesn't -- set the env var. Indexed so per-session list queries stay cheap on -- larger boards. session_id TEXT, -- Typed block reason set by ``block_task`` (one of VALID_BLOCK_KINDS, or -- NULL for legacy/un-typed blocks). Drives routing: ``dependency`` never -- sits in ``blocked`` (goes to ``todo`` for parent-gating); the others go -- to ``blocked`` for a human. Preserved across unblock so a re-block for -- the SAME kind can be recognised as a loop. block_kind TEXT, -- Unblock-loop counter. Incremented each time a task is re-blocked for the -- same truly-blocked reason after having been unblocked. When it reaches -- BLOCK_RECURRENCE_LIMIT the task is routed to ``triage`` instead of -- ``blocked`` so a cron can't spin it forever. Reset to 0 only on a -- successful completion — NOT on unblock (resetting on unblock is exactly -- the amnesia that let the loop run unbounded). block_recurrences INTEGER NOT NULL DEFAULT 0 , provider_override TEXT, reasoning_effort TEXT)                       7o (Hc@Otabletask_runstask_runs CREATE TABLE task_runs ( id INTEGER PRIMARY KEY AUTOINCREMENT, task_id TEXT NOT NULL, profile TEXT, step_key TEXT, status TEXT NOT NULL, -- status: running | done | blocked | crashed | timed_out | failed | released claim_lock TEXT, claim_expires INTEGER, worker_pid INTEGER, max_runtime_seconds INTEGER, last_heartbeat_at INTEGER, started_at INTEGER NOT NULL, ended_at INTEGER, outcome TEXT, -- outcome: completed | blocked | crashed | timed_out | spawn_failed | -- gave_up | reclaimed | (null while still running) summary TEXT, metadata TEXT, error TEXT )z##;tabletask_eventstask_events CREATE TABLE task_events ( id INTEGER PRIMARY KEY AUTOINCREMENT, task_id TEXT NOT NULL, run_id INTEGER, kind TEXT NOT NULL, payload TEXT, created_at INTEGER NOT NULL )P++Ytablesqlite_sequencesqlite_sequenceCREATE TABLE sqlite_sequence(name,seq)q''!tabletask_commentstask_commentsCREATE TABLE task_comments ( id INTEGER PRIMARY KEY AUTOINCREMENT, task_id TEXT NOT NULL, author TEXT NOT NULL, body TEXT NOT NULL, created_at INTEGER NOT NULL )!!tabletask_linkstask_linksCREATE TABLE task_links ( parent_id TEXT NOT NULL, child_id TEXT NOT NULL, PRIMARY KEY (parent_id, child_id) )3G!indexsqlite_autoindex_task_links_1task_links0?tabletaskstasksCREATE TABLE tasks ( id TEXT PRIMARY KEY, title TEXT NOT NULL, body TEXT, assignee TEXT, status TEXT NOT NULL, priority INTEGER DEFAULT 0, created_by TEXT, created_at INTEGER NOT NULL, started_at INTEGER, completed_at INTEGER, workspace_kind TEXT NOT NULL DEFAULT 'scratch', workspace_pa)=indexsqlite_autoindex_tasks_1tasks  22 H 4 emZH 11;tablekanban_notify_subskanban_notify_subs CREATE TABLE kanban_notify_subs ( task_id TEXT NOT NULL, platform TEXT NOT NULL, chat_id TEXT NOT NULL, thread_id TEXT NOT NULL DEFAULT '', user_id TEXT, notifier_profile TEXT, created_at INTEGER NOT NULL, last_event_id INTEGER NOT NULL DEFAULT 0, chat_type TEXT, delivery_metadata TEXT, PRIMARY KEY (task_id, platform, chat_id, thread_id) )[)#yindexidx_events_runtask_eventsCREATE INDEX idx_events_run ON task_events(run_id, id)[5yindexidx_tasks_session_idtasksCREATE INDEX idx_tasks_session_id ON tasks(session_id)c7indexidx_tasks_idempotencytasksCREATE INDEX idx_tasks_idempotency ON tasks(idempotency_key)O-iindexidx_tasks_tenanttasksCREATE INDEX idx_tasks_tenant ON tasks(tenant)s+1indexidx_notify_taskkanban_notify_subsCREATE INDEX idx_notify_task ON kanban_notify_subs(task_id)5-+indexidx_attachments_tasktask_attachmentsCREATE INDEX idx_attachments_task ON task_attachments(task_id, created_at)`+indexidx_runs_statustask_runsCREATE INDEX idx_runs_status ON task_runs(status)k'indexidx_runs_tasktask_runsCREATE INDEX idx_runs_task ON task_runs(task_id, started_at)q+#!indexidx_events_tasktask_eventsCREATE INDEX idx_events_task ON task_events(task_id, created_at)w/'%indexidx_comments_tasktask_commentsCREATE INDEX idx_comments_task ON task_comments(task_id, created_at)f-! indexidx_links_parenttask_linksCREATE INDEX idx_links_parent ON task_links(parent_id)d+! indexidx_links_childtask_linksCREATE INDEX idx_links_child ON task_links(child_id)X -{indexidx_tasks_statustasksCREATE INDEX idx_tasks_status ON tasks(status)l ?indexidx_tasks_assignee_statustasksCREATE INDEX idx_tasks_assignee_status ON tasks(assignee, status)C W1indexsqlite_autoindex_kanban_notify_subs_1kanban_notify_subs _ --qtabletask_attachmentstask_attachments CREATE TABLE task_attachments ( id INTEGER PRIMARY KEY AUTOINCREMENT, task_id TEXT NOT NULL, filename TEXT NOT NULL, stored_path TEXT NOT NULL, content_type TEXT, size INTEGER NOT NULL DEFAULT 0, uploaded_by TEXT, created_at INTEGER NOT NULL )