Documentation
¶
Overview ¶
Package trace reads the durable JSONL trace a BuildMax run records.
It exists because three places in evaluation need to ask a trace a question — the CLI adapter counts model calls, the trace grader asserts on tool use, and the Harbor importer counts model calls for an external run — and the bounds and failure rules for reading one are the same every time. Only the questions differ.
Records are decoded field by field rather than through the runtime's own record type. A bundle outlives the build that wrote it, and section 8.4 requires the format to stay readable without a BuildMax process; decoding through a struct that has since gained or lost fields would make an old trace unreadable rather than merely incomplete.
Index ¶
Constants ¶
const MaxLine = 4 * 1024 * 1024
MaxLine bounds one trace record. The recorder bounds each free-text field at 4 KiB, so a record far above this is corruption rather than a large tool result.
Variables ¶
This section is empty.
Functions ¶
func CountLLMCalls ¶
CountLLMCalls reports how many model calls a trace recorded.
The print-mode envelope carries tool calls and tokens but not this, and reliability reporting needs to tell one expensive call from ten cheap ones.
A read that stops early returns its error rather than the count so far. A truncated count is indistinguishable from a cheap run, and quietly reporting one as the other is the kind of wrong number a qualification would act on.
Types ¶
This section is empty.