trace

package
v0.2.0-alpha.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

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

View Source
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

func CountLLMCalls(path string) (int, error)

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.

func Scanner

func Scanner(f *os.File) *bufio.Scanner

Scanner reads a trace file line by line under the shared bounds.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL