goal library

Public API for programmatic use of the goal ledger.

Classes

EventJournal
Append-only JSONL audit journal. One line per mutation; the hive boxes hold current state, this file holds the history and doubles as a human-readable recovery log.
GoalEntry
A single goal ticket. Immutable: every mutation produces a new instance via copyWith and is written back with an explicit put.
GoalEntryAdapter
GoalMeta
Ledger-wide metadata, stored as the single meta record of the meta box.
GoalMetaAdapter
GoalNote
A timestamped remark appended to a ticket. Notes are append-only; they are the free-text settlement channel (files changed, verification commands, evidence paths, revisit conditions, redispatch reasons).
GoalNoteAdapter
GoalPriorityAdapter
GoalStatusAdapter
GoalStore
Hive-backed ledger: goals (active) + archive + meta boxes plus an append-only JSONL journal in the same directory.

Enums

GoalErrorCode
GoalPriority
Priority of a goal ticket. null means no priority was assigned.
GoalStatus
Lifecycle state of a goal ticket.

Constants

statusViewOrder → const List<GoalStatus>
statusWords → const String

Functions

age(DateTime at, DateTime now) → String
bareId(String s) → String
Renders strip the # when displaying ids as #123; every input path (set/show/rm ids, --deps, --id) accepts it back through here.
footerCounts(Map<GoalStatus, int> counts) → String
fullStamp(DateTime t) → String
listLine(GoalEntry e, DateTime now) → String
One-line table row: id, priority, status, age, agent, truncated title. Title and agent pass through oneline so a newline inside them can never break the row structure. The id carries the # prefix like every other ticket reference, so a row can be typed back verbatim (goal set #12 …).
runGoalCli(List<String> args, {String? home, void writeln(String line)?, void errln(String line)?, DateTime clock()?, Future<String> stdinReader()?}) → Future<int>
Runs the CLI and returns the process exit code. writeln, clock and stdinReader are injection points for tests.
stamp(DateTime t) → String
statusViewRank(GoalStatus s) → int

Typedefs

ArchivedRef = ({bool archived, GoalEntry entry})
A ticket located anywhere in the ledger.

Exceptions / Errors

GoalError
Error carrying a CLI-facing exit code.