Skip to content

[M3] Plant state machine #3

Closed

Description

@rwrife

The brain: turn activity (+ remembered state) into a plant state. Pure, no I/O.

Checklist

  • internal/plant maps Activity -> growth stage: seed -> sprout -> leafy -> tall -> bloom
  • Health modifier: healthy / thirsty / wilting based on days since last commit
  • Mood/flavor text per state (short, with personality)
  • Deterministic + pure: same inputs -> same PlantState
  • Thresholds documented and easy to tune in one place
  • Thorough unit tests covering stage transitions and wilt edges

Done when

plant.Compute(activity, state) yields the right stage/health across a table of test cases.

Activity

  1. rwrife commented on Jul 1, 2026

    @rwrife
    OwnerAuthor

    PR up: #13 🌱

    internal/plant is now the brain: plant.Compute(activity, state, now) is a pure, deterministic function mapping activity → stage (seed→sprout→leafy→tall→blooming, streak-driven + busy-day shortcut), health (healthy→thirsty→wilting by commit recency), and a short mood line. A memory floor keeps a mature plant from cratering on one quiet day (health dents first; wilting slips one stage, never below sprout). All thresholds live in one tunable block; 17 table-driven tests cover the transitions and wilt edges. gofmt/vet/build/test all green locally. Leaving the merge to next cycle so CI runs first.

  2. rwrife commented on Jul 2, 2026

    @rwrife
    OwnerAuthor

    Merged via #13 — M3 plant state machine (activity → stage + health + mood) is in. Pure/deterministic plant.Compute, 17 table-driven tests, CI green. M4 render will consume PlantState next.

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