secretary

package
v0.4.10 Latest Latest
Warning

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

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

Documentation

Overview

Package secretary tracks the open loops an agent or a person has left open — "I'll send the deck", "waiting on the vendor" — so they can be surfaced again without depending on anyone remembering to check.

This package used to also compose an ambient daily briefing over captured calendar and activity events; that half was cut in 0.3.0 along with the rest of the ambient-capture tier. What remains is event-independent: a commitment is added, extracted, or closed, never mined from something observed in the background.

Index

Constants

View Source
const LoopsFile = "loops.md"

LoopsFile is the loop list's name at the vault root.

View Source
const Schema = `` /* 403-byte string literal not displayed */

Variables

This section is empty.

Functions

func Add

func Add(db *sql.DB, c *Commitment) (bool, error)

func Import

func Import(db *sql.DB, dir string) (int, error)

Import restores loops from the vault, and is what makes deleting the cache survivable for commitments.

dir is the caller's rather than vaultFor's: `logos index` imports a vault it has not bound to a store yet.

Returns how many loops it had to put back — a row already in the cache was never lost and is not announced as recovered.

func Init

func Init(db *sql.DB) error

func LoopsPath

func LoopsPath(dir string) string

LoopsPath is where the loop list lives inside dir. Exported because index.Sync has to know the one file in the vault root it must not index.

func OpenCount

func OpenCount(db *sql.DB) (int, error)

func SetStatus

func SetStatus(db *sql.DB, id int64, s Status) error

func SetVault

func SetVault(db *sql.DB, dir string)

SetVault binds a database to the vault its loops belong in. An empty dir unbinds it, which is what a cache-only store wants and what index.Close does so a closed handle leaves nothing behind.

Types

type Commitment

type Commitment struct {
	ID      int64
	Text    string
	Who     string // person it involves, if any
	Created int64
	DueHint string // free text: "friday", "eod", "" if none
	Status  Status
	// SourceRef points at where it came from (a daily note slug, an event id),
	// so a surfaced loop can always be traced back — same discipline as
	// proposal evidence.
	SourceRef string
	// ResolvedAt is when the loop was closed (done or dropped), 0 while open.
	ResolvedAt int64
}

A Commitment is something you said you would do that is not yet done. The core secretary primitive — an archive does not care what you promised, a secretary tracks exactly that.

func Extract

func Extract(rt *router.Router, text, sourceRef string) ([]Commitment, error)

Extract pulls open loops out of a chunk of text — a daily note, a captured message draft. Constrained decoding, T1, one narrow job.

The prompt is tight on purpose: a secretary that invents commitments you never made is worse than one that misses a few, because you learn to distrust it. Recall is sacrificed for precision here deliberately.

func Open_

func Open_(db *sql.DB) ([]Commitment, error)

func ResolvedSince

func ResolvedSince(db *sql.DB, since, until int64) ([]Commitment, error)

ResolvedSince lists commitments marked done in [since, until], newest first — the accomplishments half of the weekly review.

func (Commitment) Age

func (c Commitment) Age() time.Duration

Age is how long a loop has been open, for surfacing the stalest first.

type Status

type Status string
const (
	Open Status = "open"
	Done Status = "done"
	// Dropped: the user dismissed it. Retained, not deleted, so the same loop
	// is not re-extracted and re-surfaced next week.
	Dropped Status = "dropped"
)

Jump to

Keyboard shortcuts

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