Watering can grace period (#7) - #17
Merged
Merged
Conversation
- New `commit-sprout water` subcommand records a grace day for a deliberate gap (weekend / PTO), buying one extra idle day before thirsty/wilting. - Grace is anti-gaming by design: one per calendar day (idempotent), capped at 2 in effect at once, pruned by any fresh commit, and it only shifts the health thresholds -- never the growth stage or streak count. - plant.Compute now folds an effective grace count into healthFor and surfaces it on PlantState; store persists auditable `watered_dates` (sorted, deduped, bounded) and scopes grace to the current dry spell via EffectiveGrace/Water. - status shows remaining grace and the projected wilt date. - README documents the watering can; unit tests cover thresholds, clamping, streak-independence, idempotency, cap-refusal, commit-prune, and persistence.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7
Adds
commit-sprout water— a deliberate escape hatch that buys the plant a grace day for a weekend / PTO — without letting it fake a streak.Acceptance criteria
commit-sprout waterrecords a grace day in state (persisted as auditablewatered_datesinstate.json)What changed
internal/plant:StategainsGraceDays;healthForrewinds the effective dry spell by (clamped) grace; grace is surfaced onPlantStateand clamped to[0, MaxGraceDays=2]. Stage/streak are untouched.internal/store: persistswatered_dates(sorted, de-duped, bounded);EffectiveGracescopes grace to the current gap (waterings must post-date the last commit and not be in the future);Waterenforces per-day idempotency + the cap;FromPlantprunes waterings on/before a fresh commit.cmd/water.go: new subcommand with clear applied / already-watered / at-cap messaging; honors--no-save.cmd/status.go: addsgrace:andwilts:lines, grace-aware.Example
Tests
New unit coverage for threshold shifting, clamping, streak-independence, per-day idempotency, cap-refusal, commit-prune, normalize (sort/dedupe/drop-garbage), and save/load round-trip.
gofmt/go vet/go build/go test ./...all clean. Also verified end-to-end against a throwaway repo.