engine

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package engine wires the planning, sampling, and streaming layers into a single Run function that the CLI subcommands (seed, tick) both call into.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Repo          *gitio.Repo
	Branch        string // bare branch name (e.g. "main")
	FilePath      string // repo-relative activity file path
	AuthorName    string
	AuthorEmail   string
	Profile       profile.Profile
	Override      profile.Override // per-run profile parameter overrides; zero-value Override is a no-op
	Seed          uint64           // 0 = derive a fresh random seed at Run time
	Start         time.Time        // inclusive, midnight in chosen tz
	End           time.Time        // inclusive, midnight in chosen tz
	MessagePrefix string           // commit message prefix (default "activity")
	DryRun        bool             // compute the plan without writing
}

Config bundles every input Run needs. Validate at the CLI layer; engine trusts its inputs (per the project's no-defensive-internal-validation rule) except where the validity of one field depends on another at runtime.

type Result

type Result struct {
	Plan      []schedule.Day
	Commits   int
	ParentSHA string
	Seed      uint64 // the seed actually used (resolved from Config.Seed)
}

Result is what Run reports back: the rolled day plan, the total commits emitted, and the effective parent SHA at write time (for diagnostics).

func Run

func Run(cfg Config) (*Result, error)

Run executes the engine for one Config. In DryRun mode it stops after planning; otherwise it pipes the resulting commits through git fast-import.

Jump to

Keyboard shortcuts

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