-- What each task's agent has spent, as read from Claude Code's transcript.
--
-- Added columns rather than a table: there is exactly one current answer per
-- task and it is overwritten, never accumulated as history. ALTER TABLE ADD
-- COLUMN also leaves the existing rows and every constraint alone, which the
-- 0002 rebuild could not.
--
-- All nullable, and nothing reads them as required. The source is an
-- undocumented file format that carries no compatibility promise, so "we do not
-- know" has to be an ordinary answer rather than a failure.

-- Model named by the most recent assistant turn, verbatim as the transcript
-- spells it.
ALTER TABLE tasks ADD COLUMN model TEXT;

-- How full the context window was on that turn: its input plus the cache it
-- read plus the cache it wrote. A level, not a total.
ALTER TABLE tasks ADD COLUMN context_tokens INTEGER;

-- Output tokens across every assistant turn so far. A total, not a level.
ALTER TABLE tasks ADD COLUMN output_tokens INTEGER;

-- Where the transcript was last read up to, so a file that grows to megabytes
-- costs one hook the bytes since the last hook rather than all of them.
ALTER TABLE tasks ADD COLUMN transcript_offset INTEGER NOT NULL DEFAULT 0;

-- Where the transcript is. Hooks carry it; keeping it means the interface can
-- refresh the numbers between hooks without one.
ALTER TABLE tasks ADD COLUMN transcript_path TEXT;
