dream

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dream implements the Dream Engine — Siri's autonomous memory consolidation and insight generation system.

Index

Constants

This section is empty.

Variables

AllPhases in execution order.

Functions

func PrintGateResult

func PrintGateResult(r *GateResult) error

PrintGateResult prints the gate check result as JSON to stdout.

func ReleasePIDLock

func ReleasePIDLock()

ReleasePIDLock removes the PID lock file.

func UpdateRunTimestamp

func UpdateRunTimestamp() error

UpdateRunTimestamp writes the current time to the last-run file. (Session counter removed — replaced by new-memories gate.)

func WritePIDLock

func WritePIDLock() error

WritePIDLock creates the PID lock file with the current process's PID.

Types

type Config

type Config struct {
	DryRun bool   // Read-only mode: no writes to memory store or files.
	Phase  string // Run only this phase (empty = all phases).
}

Config holds Dream Engine runtime configuration.

type Engine

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

Engine orchestrates the four-phase dream cycle.

func NewEngine

func NewEngine(store memory.Store, embedder embedding.Embedder, cfg Config) *Engine

NewEngine creates a Dream Engine instance.

func (*Engine) PrintLog

func (e *Engine) PrintLog() error

PrintLog outputs the structured log as JSON to stdout.

func (*Engine) Run

func (e *Engine) Run(ctx context.Context) error

Run executes the dream cycle (all phases or a single phase).

type GateResult

type GateResult struct {
	ShouldRun               bool    `json:"should_run"`
	Reason                  string  `json:"reason"`
	LastRun                 string  `json:"last_run"`
	HoursSinceLastRun       float64 `json:"hours_since_last_run,omitempty"`
	NewMemoriesSinceLastRun int     `json:"new_memories_since_last_run"`
	Gate1Time               bool    `json:"gate1_time"`
	Gate2Memories           bool    `json:"gate2_memories"`
	Gate3Pid                bool    `json:"gate3_pid"`
}

GateResult is the JSON output of dream-check.

func CheckGates

func CheckGates(store memory.Store) (*GateResult, error)

CheckGates evaluates the Triple Gate and returns a JSON-serializable result. store is used for Gate 2 (count new memories since last run). If store is nil, Gate 2 is skipped (passes by default) — for backward compatibility.

type Log

type Log struct {
	StartedAt     string     `json:"started_at"`
	DryRun        bool       `json:"dry_run"`
	Phases        []PhaseLog `json:"phases"`
	Summary       string     `json:"summary,omitempty"`
	SkillDiffPath string     `json:"skill_diff_path,omitempty"` // path to skill diff draft file
	HasSkillDiff  bool       `json:"has_skill_diff,omitempty"`  // true if diff was generated
}

Log collects structured output from each phase.

type Phase

type Phase string

Phase identifies a single dream engine phase.

const (
	PhaseOrient      Phase = "orient"
	PhaseGather      Phase = "gather"
	PhaseConsolidate Phase = "consolidate"
	PhasePrune       Phase = "prune"
)

type PhaseLog

type PhaseLog struct {
	Name      string   `json:"name"`
	StartedAt string   `json:"started_at"`
	Duration  string   `json:"duration"`
	Items     []string `json:"items,omitempty"` // human-readable action items
	Error     string   `json:"error,omitempty"`
}

PhaseLog records a single phase's execution.

Jump to

Keyboard shortcuts

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