demokit

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package demokit is the shared seeding core that fills a THROWAWAY Seamless data dir with backdated fixtures. It backs the demoseed CLI (the console-fleet history for landing-page screenshots, and the -scenes terminal-scene fixture) and is importable so other tooling -- the agent-scenario benchmark's scenario seeder -- can build fixture state in Go without shelling out or reimplementing the time-backdating logic. Point it only at a fresh dir while no daemon holds the DB (single-writer SQLite).

Timestamps are backdated through the store/files/events APIs, which write caller-supplied times verbatim; nothing here goes through MCP (which stamps time.Now). Deterministic apart from the anchor "now".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pick

func Pick[T any](rng *rand.Rand, xs []T) T

Types

type Seeder

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

func New

func New(dataDir string) (*Seeder, error)

New opens the throwaway data dir -- creating the memory/ and notes/ subdirs and the SQLite DB -- and returns a Seeder ready to seed. The RNG is seeded from a fixed constant and "now" is captured once, so a run is deterministic apart from the wall-clock anchor. Never point this at a live instance.

func (*Seeder) Close

func (s *Seeder) Close() error

Close releases the seeder's database handle.

func (*Seeder) CreateSession added in v0.4.6

func (s *Seeder) CreateSession(sess core.Session) error

CreateSession inserts a session row with the caller's timestamps.

func (*Seeder) CreateTask added in v0.4.6

func (s *Seeder) CreateTask(t core.Task) error

CreateTask inserts a task row with the caller's timestamps.

func (*Seeder) CreateTrial added in v0.4.6

func (s *Seeder) CreateTrial(tr core.Trial) error

CreateTrial inserts a trial row with the caller's timestamps.

func (*Seeder) DaysAgo

func (s *Seeder) DaysAgo(d int) time.Time

func (*Seeder) EnsureProject added in v0.4.6

func (s *Seeder) EnsureProject(slug, name string) error

EnsureProject creates the project if it does not exist yet.

func (*Seeder) Event

func (s *Seeder) Event(t time.Time, kind core.EventKind, sessionID, project, itemID string, payload map[string]any)

func (*Seeder) IdAt

func (s *Seeder) IdAt(t time.Time) string

func (*Seeder) MapRepo added in v0.4.6

func (s *Seeder) MapRepo(repoPath, project string) error

MapRepo records repoPath -> project in the repo map, so sessions starting in that repo bind to the project without a setup step.

func (*Seeder) Now added in v0.4.6

func (s *Seeder) Now() time.Time

Now returns the seeder's wall-clock anchor, captured once at New. Every backdated timestamp should derive from it so a whole seed shares one "now".

func (*Seeder) Scenes

func (s *Seeder) Scenes(repoPath string, race bool)

scenes seeds the whole terminal-scenes fixture into the throwaway data dir.

func (*Seeder) SeedConsoleFleet

func (s *Seeder) SeedConsoleFleet()

SeedConsoleFleet seeds the fictional six-week console fleet history (the branding surface: landing-page screenshots) and prints a summary. This is the demoseed default mode.

func (*Seeder) ToolCall

func (s *Seeder) ToolCall(t time.Time, sessionID, project, tool string, args map[string]any, result string, durMS int)

func (*Seeder) WriteMemory added in v0.4.6

func (s *Seeder) WriteMemory(mem core.Memory) error

WriteMemory writes one memory file plus its index row, keeping the caller's timestamps verbatim.

Jump to

Keyboard shortcuts

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