fixture

package
v0.1.0 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: 14 Imported by: 0

Documentation

Overview

Package fixture generates the deterministic Week-1 fixture runs (docs/export-format-v1.md §4): run_9f2a.jsonl and run_c71e.jsonl, 47 receipts each, plus a tiny 3-receipt export for the vector corpus.

Everything here is fixed: seeds, timestamps, ULID entropy, the step script. Two invocations must produce byte-identical files. Every receipt embeds the full three-hop delegation chain whole (Q10, schema §7), and the chain diverges at the leaf hop, which is signature-verified in run_9f2a and caller-asserted in run_c71e — so run_9f2a rolls up to `verified` and run_c71e to `asserted` (Q12).

The action divergence, and how far it travels

The runs diverge in the world at step 12: `orders.search` returns the same two refundable orders in a different sequence, and the agent takes results[0]. Everything the agent does afterwards that a support agent would hang off the order it chose is about that order — it reads the order, the card that paid for it, its shipment and its SKU, prechecks the refund against its amount, raises an approval for it, issues the refund at step 31, and then records what it refunded on the ticket, in the CRM, in the customer's mail and in the audit note. The steps that would not depend on the selection — the refund policy, the knowledge base, verifying the customer, closing the ticket — do not.

This mirrors cmd/behalf-record's script step for step, because the two exist to be the same session: one recorded through the real proxy, one built by hand for the export-format tests and the tamper suite.

One decimal string in the file

The literal "1200.00" appears exactly once in run_c71e.jsonl — in the step-31 payload — because the cover-up demo runs sed 's/1200.00/12.00/' over that file and the verifier must report the break at index 31 and nowhere else. Every other amount in the run, at every later step that mentions the refund, is integer `amount_cents`, and the later steps name the order and the refund by id. Nothing else in the file may even match the demo's unescaped /1200.00/ (see TestCoverUpTargetIsUnique).

Index

Constants

View Source
const OtelConventionsVersion = "1.29.0"

OtelConventionsVersion is the gen_ai.* conventions version stamped on every fixture receipt (Q8, Q49).

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Bytes      []byte     // the complete .jsonl file
	Payloads   [][]byte   // the sealed payload bytes, per leaf, exactly as spliced
	LeafHashes [][32]byte // per-leaf hashes
	Chain      [32]byte   // final chain value
	LogOrigin  string
}

Result is a generated export plus the intermediate values tests and the vector generator need.

func Generate

func Generate(spec Spec) (*Result, error)

Generate builds the export for spec. Deterministic: equal specs produce byte-identical output.

type Spec

type Spec struct {
	RunID     string
	LogOrigin string
	Start     time.Time
	StepEvery time.Duration
	Count     int
	Variant   Variant
	// HeadSigner, if non-nil, signs the head line with a key distinct from
	// the emitter (used by the tiny vector export to exercise multi-key
	// headers). Nil means the emitter signs the head.
	HeadSigner *testkeys.Key
}

Spec describes one deterministic run.

func Run9F2A

func Run9F2A() Spec

Run9F2A is the baseline run: the agent sees ord_5512 first and refunds $12.00.

func RunC71E

func RunC71E() Spec

RunC71E is the divergent run: ord_5518 first, refund "1200.00".

func Tiny

func Tiny() Spec

Tiny is the 3-receipt export used by the vector corpus, with a head key distinct from the emitter key.

type Variant

type Variant int

Variant selects which side of the step-12/step-31 divergence a run takes.

const (
	// VariantA is run_9f2a: ord_5512 ($12.00, 1200 cents) first at step 12,
	// refund amount "12.00" at step 31.
	VariantA Variant = iota
	// VariantB is run_c71e: ord_5518 (120000 cents) first at step 12, refund
	// amount "1200.00" at step 31.
	VariantB
)

Jump to

Keyboard shortcuts

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