gatelineAPI reference

One dispatch, as the ledger spells it. Named for the budget ledger to keep it distinct from view-model/ledger.ts's LedgerEntry, which is a parsed commit subject — a different ledger entirely, and both reach the package root.

interface BudgetLedgerEntry {
    adapter: null | string;
    at: null | string;
    cost_usd: null | number;
    engine: null | string;
    failed: boolean;
    model: null | string;
    refused: boolean;
    role: string;
    round: null | number;
    session: null | string;
    task: null | string;
    tokens_in: null | number;
    tokens_out: null | number;
}

Properties

adapter: null | string
at: null | string
cost_usd: null | number
engine: null | string

Which engine process opened this entry (#349), as <hostname>:<pid>. Null on entries written before the key existed, and on hand-written ones.

The stale sweep is the only reader: an open entry says "an agent is running", and without a name on it a second engine cannot tell a crashed process's orphan from another process's live job — it aged both after staleMs and re-dispatched, putting two agents on one task. With the name, a sweep ages its own entries (and unnamed ones) on the short window and another engine's only once no live job could still hold it.

failed: boolean
model: null | string
refused: boolean

Closed without a process ever spawning (#155): $0, not a failure, not a retry spent.

role: string
round: null | number
session: null | string

The harness's own session for this dispatch (#181), when its adapter says how to read one. Adapter-neutral by name because only the adapter knows what a session is; a runner that has none leaves this null.

A retry of the same role+task+round resumes it, so the second attempt starts from what the first had already worked out instead of re-reading the same files. It is a hint, never a handle: a session the harness will not take costs a fresh dispatch and nothing else.

task: null | string
tokens_in: null | number
tokens_out: null | number