GoalStore class
Hive-backed ledger: goals (active) + archive + meta boxes plus an
append-only JSONL journal in the same directory.
Properties
-
all
→ List<
GoalEntry> -
Active entries ordered by creation time.
no setter
-
archive
→ Box<
GoalEntry> -
final
-
archivedAll
→ List<
GoalEntry> -
Archived entries ordered by creation time — the read-only history.
no setter
-
goals
→ Box<
GoalEntry> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- home → String
-
final
- journal → EventJournal
-
final
- meta → GoalMeta
-
no setter
-
metaBox
→ Box<
GoalMeta> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
{required String title, String detail = '', String round = '', List< String> deps = const [], GoalPriority? priority, required DateTime now}) → Future<GoalEntry> - Creates a ticket with the next auto-increment id.
-
archiveDone(
) → Future< List< GoalEntry> > -
Moves every active
doneticket into the archive box. -
close(
) → Future< void> - Idempotent: closing twice is safe, so callers can always register this as a teardown even after explicit closes.
-
get(
String id) → GoalEntry? -
isArchived(
String id) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put(
GoalEntry entry, {Map< String, Object?> ? changes}) → Future<void> - Writes an updated entry and journals the diff.
-
ready(
{Set< String> ? missingDeps}) → List<GoalEntry> -
Tickets whose deps are all satisfied. Deps pointing at archived tickets
count as satisfied; deps pointing at unknown ids are reported in
missingDepsand treated as satisfied (a nonexistent ticket must not block forever). -
remove(
String id) → Future< GoalEntry> - Deletes an active ticket. Removal is journaled; archived tickets are read-only and ids of removed tickets are never reused.
-
resolve(
String input) → GoalEntry -
Resolves a ticket by its exact id (
#123accepted, matching how renders display ids). Misses are hard errors that list recent ids so the caller can self-correct. -
resolveAny(
String input) → ArchivedRef -
Resolves a ticket anywhere in the ledger (active or archived) for
read-only views; archived entries carry
ArchivedRef.archivedso the caller can label them. -
statusCounts(
) → Map< GoalStatus, int> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
existsAt(
String home) → bool -
open(
String home, {bool create = false, void onJournalWarning(String warning)?}) → Future< GoalStore> -
Opens the ledger at
home. Whencreateis false and no ledger exists there, throws GoalError — never silently forks a new empty ledger.onJournalWarningreceives audit-journal write failures: the hive state is authoritative, so a journal gap must degrade to a warning, never fail an operation whose data write already succeeded.