Documentation
¶
Index ¶
- func AppendFileWithParents(path, mkdirContext, openContext string) (*os.File, error)
- func AppendJSONLFileWithParents[T any](path, mkdirContext, openContext, writeContext string, rows []T) error
- func ChecksumBytesSHA256(raw []byte) string
- func CreateFileWithParents(path, mkdirContext, createContext string) (*os.File, error)
- func FirstNonEmptyTrimmed(values ...string) string
- func ForEachNonEmptyJSONLLine(scanner *bufio.Scanner, scanContext string, ...) error
- func FormatArtifactTimestamp(t time.Time) string
- func HasNonEmptyTrimmed(value string) bool
- func JSONRawIsEmptyOrNull(raw []byte) bool
- func MarshalIndentedJSON(value any) ([]byte, error)
- func NewJSONLScanner(r io.Reader) *bufio.Scanner
- func NormalizeAbility(ability string) string
- func NormalizeEvidenceKind(kind string) string
- func NormalizeQuestionText(question string) string
- func NormalizeRecordType(recordType string) string
- func PairedOutcomeCorrect(score float64) bool
- func ReadFileWithChecksum(path, readContext string) ([]byte, string, error)
- func ReadJSONLFile[T any](path, openContext, scanContext, decodeContext string) ([]T, error)
- func RoundMetric(v float64) float64
- func RoundSignedMetric(v float64) float64
- func SortedStringMapKeys[V any](values map[string]V) []string
- func TopN(values []string, n int) []string
- func TrimJSONRaw(raw []byte) []byte
- func WriteBytesArtifact(path string, raw []byte, mkdirContext, writeContext string) error
- func WriteFileWithParents(path string, raw []byte, mkdirContext, writeContext string) error
- func WriteJSONLFileWithParents[T any](path, mkdirContext, createContext, writeContext string, rows []T) error
- func WriteJSONLRows[T any](w io.Writer, rows []T, writeContext string) error
- type OutcomeKey
- type PairedOutcome
- type QuestionKey
- type ScoreTally
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendFileWithParents ¶
AppendFileWithParents opens a BEAM artifact file for append after ensuring its parent directory exists.
func AppendJSONLFileWithParents ¶
func AppendJSONLFileWithParents[T any](path, mkdirContext, openContext, writeContext string, rows []T) error
AppendJSONLFileWithParents opens a parent-creating BEAM JSONL artifact for append and writes rows to it.
func ChecksumBytesSHA256 ¶
func CreateFileWithParents ¶
CreateFileWithParents creates/truncates a BEAM artifact file after ensuring its parent directory exists.
func FirstNonEmptyTrimmed ¶
FirstNonEmptyTrimmed returns the first argument with non-empty trimmed content.
func ForEachNonEmptyJSONLLine ¶
func ForEachNonEmptyJSONLLine(scanner *bufio.Scanner, scanContext string, handle func(lineNumber int, line string) error) error
ForEachNonEmptyJSONLLine walks non-blank JSONL lines with BEAM's shared trim-and-scan-error convention.
func FormatArtifactTimestamp ¶
FormatArtifactTimestamp returns the shared BEAM UTC RFC3339 timestamp format.
func HasNonEmptyTrimmed ¶
HasNonEmptyTrimmed reports whether value has non-empty content after trimming.
func JSONRawIsEmptyOrNull ¶
JSONRawIsEmptyOrNull reports whether a raw JSON value is absent or the JSON null literal.
func MarshalIndentedJSON ¶
MarshalIndentedJSON marshals a BEAM artifact JSON document with the repository's trailing newline convention.
func NewJSONLScanner ¶
NewJSONLScanner returns a scanner sized for BEAM JSONL artifacts that can contain large prompt/context rows.
func NormalizeAbility ¶
NormalizeAbility returns the canonical BEAM ability code used in artifacts and match keys.
func NormalizeEvidenceKind ¶
NormalizeEvidenceKind returns the canonical BEAM evidence-kind token.
func NormalizeQuestionText ¶
NormalizeQuestionText returns the canonical question text used for BEAM question-key matching.
func NormalizeRecordType ¶
NormalizeRecordType returns the canonical BEAM JSONL record type.
func PairedOutcomeCorrect ¶
PairedOutcomeCorrect reports the shared BEAM paired-outcome correctness contract.
func ReadFileWithChecksum ¶
ReadFileWithChecksum reads a BEAM artifact and returns its raw bytes plus SHA-256 checksum.
func ReadJSONLFile ¶
ReadJSONLFile decodes a BEAM JSONL file using the shared scan and non-empty-line convention.
func RoundMetric ¶
func RoundSignedMetric ¶
func SortedStringMapKeys ¶
SortedStringMapKeys returns map keys in stable lexical order.
func TrimJSONRaw ¶
TrimJSONRaw returns raw JSON bytes after whitespace trimming.
func WriteBytesArtifact ¶
WriteBytesArtifact writes a BEAM byte artifact to stdout when path is "-" or to a parent-creating file otherwise.
func WriteFileWithParents ¶
WriteFileWithParents writes a BEAM artifact file after ensuring its parent directory exists.
func WriteJSONLFileWithParents ¶
func WriteJSONLFileWithParents[T any](path, mkdirContext, createContext, writeContext string, rows []T) error
WriteJSONLFileWithParents creates/truncates a parent-creating BEAM JSONL artifact and writes rows to it.
Types ¶
type OutcomeKey ¶
type OutcomeKey = identity.OutcomeKey
OutcomeKey identifies a BEAM row by the exact scale/conversation/qid match contract.
func NewOutcomeKey ¶
func NewOutcomeKey(scale, conversationID, qid string) OutcomeKey
NewOutcomeKey normalizes BEAM row identity fields for maps and deterministic sorting.
type PairedOutcome ¶
type PairedOutcome = outcome.PairedOutcome
PairedOutcome is the JSONL contract used by BEAM oracle runs and paired comparisons.
type QuestionKey ¶
type QuestionKey = identity.QuestionKey
QuestionKey identifies a BEAM row by normalized question fallback identity.
func NewQuestionKey ¶
func NewQuestionKey(scale, conversationID, ability, question string) QuestionKey
NewQuestionKey normalizes BEAM question fallback fields for oracle judgment and paired-outcome matching.
type ScoreTally ¶
type ScoreTally = score.ScoreTally
ScoreTally accumulates BEAM score totals with the shared rounded-average convention.