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
- func Add(db *sql.DB, c *Commitment) (bool, error)
- func Import(db *sql.DB, dir string) (int, error)
- func Init(db *sql.DB) error
- func LoopsPath(dir string) string
- func OpenCount(db *sql.DB) (int, error)
- func SetStatus(db *sql.DB, id int64, s Status) error
- func SetVault(db *sql.DB, dir string)
- type Commitment
- type Status
Constants ¶
const LoopsFile = "loops.md"
LoopsFile is the loop list's name at the vault root.
const Schema = `` /* 403-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func Import ¶
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.
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 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.