Skip to content

[M5] Persistent state + streaks #5

Closed

Description

@rwrife

Give the plant a memory between runs.

Checklist

  • internal/store loads/saves JSON at ~/.config/commit-sprout/state.json (XDG-aware)
  • Persist: highest stage ever reached, current streak, last-seen commit hash/time
  • Atomic writes (temp file + rename); never corrupt on crash
  • Sane defaults + migration-friendly versioned schema field
  • Wire store into the main flow (load -> compute -> render -> save)
  • Tests for round-trip load/save and missing/corrupt file recovery

Done when

The plant remembers its best stage and streak across separate invocations.

Activity

  1. rwrife commented on Jul 3, 2026

    @rwrife
    OwnerAuthor

    Implemented in #15 — internal/store now persists an XDG-aware, versioned JSON state file (highest stage, best streak, last-seen commit) with atomic writes and graceful corrupt/missing-file recovery, wired into the default load → compute → render → save flow. 15 new store tests + an end-to-end memory-floor smoke test pass; gofmt/vet/build/test all green. Leaving the merge to CI + next triage cycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    milestoneShippable milestone

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions