signintest

package
v0.7.0-dev.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package signintest is a fake harness adapter for tests of model sign-ins: a container harness that reads its model credential from the file or directory a model sign-in hands it, and speaks a small NDJSON event stream the tests script. Nothing but tests imports it.

Index

Constants

View Source
const (
	TokenAdapter = "signin-test"
	DirAdapter   = "signin-test-dir"
	ConfigDir    = "/home/harness/.config/vendor"
)

The adapters Register installs: one that reads a token file, one that reads a config directory at ConfigDir.

View Source
const Image = "ghcr.io/example/fake-harness:1@sha256:1111111111111111111111111111111111111111111111111111111111111111"

Image is the harness image a test policy names for both adapters.

Variables

This section is empty.

Functions

func Line

func Line(ev Event) string

Line is ev as the fake harness writes it.

func Policy

func Policy(p *policy.Policy, kind string)

Policy makes p name kind (a model sign-in kind) for both adapters, with their image.

func Register

func Register()

Register installs both adapters, once per process.

Types

type Event

type Event struct {
	Type   string    `json:"type"` // tool_call | text | usage | plan_limit | error
	Text   string    `json:"text,omitempty"`
	In     int64     `json:"in,omitempty"`
	Out    int64     `json:"out,omitempty"`
	Cost   float64   `json:"cost,omitempty"`
	Resets time.Time `json:"resets,omitzero"`
}

Event is one line of the fake harness's stream.

Jump to

Keyboard shortcuts

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