probe

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package probe is a small ABI 1 core that exists to test hosts. It implements no Pi semantics. It exercises every host loop invariant of ABI.md section 3 (reads before anything else, commits before effects, the single-writer guard, rejected and fatal steps, effect cancellation) and every step field, with deterministic output, so one event script drives the native Step and the Wasm binding and the step bytes can be compared exactly.

Index

Constants

This section is empty.

Variables

View Source
var SQL = []string{
	"CREATE TABLE IF NOT EXISTS durable_metadata (singleton INTEGER PRIMARY KEY CHECK (singleton = 1), next_id TEXT NOT NULL, next_seq INTEGER NOT NULL)",
	"CREATE TABLE IF NOT EXISTS probe_log (n INTEGER PRIMARY KEY, note TEXT NOT NULL, at REAL NOT NULL, data BLOB)",
	"INSERT OR IGNORE INTO durable_metadata (singleton, next_id, next_seq) VALUES (1, '1', 1)",
	"SELECT name FROM sqlite_master WHERE type = 'table' AND name IN ('durable_metadata', 'probe_log') ORDER BY name",
	"SELECT next_id, next_seq FROM durable_metadata WHERE singleton = 1",
	"INSERT INTO probe_log (n, note, at, data) VALUES (?, ?, ?, ?)",
	"UPDATE durable_metadata SET next_id = ?, next_seq = ? WHERE singleton = 1 AND next_seq = ?",
	"SELECT n, note, at, CAST(data AS BLOB) FROM probe_log ORDER BY n",
}

SQL is the probe's sql_table. The durable_metadata statements have the shape the host guard recognises.

Functions

This section is empty.

Types

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session is one probe handle.

func NewSession

func NewSession(uuidv7 func() string) *Session

NewSession returns a fresh handle. uuidv7 is the host's pi-ai uuidv7() generator (ABI section 4.2).

func (*Session) MemStats

func (s *Session) MemStats() [8]uint64

MemStats returns the eight counters of the mem_stats export (ABI section 4.1) as the probe knows them.

func (*Session) Step

func (s *Session) Step(ev abi.Event) *abi.Step

Step processes one event.

Jump to

Keyboard shortcuts

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