replay

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package replay is "catch me up since I've been away."

It reads how long you have been gone and composes what changed while you were: what the memory learned and dropped, which projects moved, which loops you closed and how many still hang, and any connections the nightly dream left for review. Pure aggregation over data other subsystems already compute — no model runs, so it is instant and offline, the same discipline as the brief and the weekly review. Opening logos after two weeks should feel like a briefing, not a search.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(db *sql.DB) error

func LastSeen

func LastSeen(db *sql.DB) (int64, bool)

LastSeen returns when the user last caught up, and whether a marker exists at all (false on the very first run).

func Mark

func Mark(db *sql.DB, ts int64) error

Mark records that the user has now caught up as of ts, so the next replay measures from here.

Types

type ProjectMove

type ProjectMove struct {
	Name       string `json:"name"`
	LastActive int64  `json:"last_active"`
}

ProjectMove is a project that saw activity within the window.

type Result

type Result struct {
	Since        int64                  `json:"since"`
	Until        int64                  `json:"until"`
	FirstRun     bool                   `json:"first_run"` // no prior last-seen recorded
	Learned      []memory.DiffEntry     `json:"learned"`
	Dropped      []memory.DiffEntry     `json:"dropped"`
	Corroborated []memory.DiffEntry     `json:"corroborated"`
	Projects     []ProjectMove          `json:"projects"`
	ClosedLoops  []secretary.Commitment `json:"closed_loops"`
	OpenLoops    int                    `json:"open_loops"`
	Insights     int                    `json:"insights"` // dreamed connections awaiting review
}

Result is the catch-up: everything that changed between Since and Until.

func Compose

func Compose(db *sql.DB, now time.Time) (Result, error)

Compose gathers the catch-up as of now. It does not advance the last-seen marker — that is the caller's decision, so a peek can look without resetting the clock.

func (Result) Away

func (r Result) Away() time.Duration

Away is how long the user was gone.

func (Result) Empty

func (r Result) Empty() bool

Empty reports whether nothing at all changed — the caller can then say so plainly instead of printing a hollow briefing.

Jump to

Keyboard shortcuts

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