feat(focus): earn from focused time with Forest-style focus sessions #14
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/focus"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on #13 (allele genetics); merge that first.
Focused time becomes the second way to earn, beside habits, in the spirit of Forest. This is the first half of the new Forestry-style progression; the bee lifecycle (wild hives, inventory, princesses and drones, queens that die) is the next PR.
What changes
libs/contexts/focus, schemafocus): aFocusSessionlasts 15, 25, 50 or 90 minutes, one running per keeper (a unique index enforces it too). It completes only once its time is up by the server's clock (5 s tolerance) and can be abandoned. Completing it publishesfocus.session_completed.v1. API:GET /api/focus,PUT /api/focus/sessions/{id},POST .../complete,POST .../abandon.Ledger.creditFocuspays a completed session at once: 0.5 nectar and 0.2 pollen per minute, at most 180 minutes in any rolling 24 hours, each session once. It publishesrewards.focus_rewarded.v1. Migration202611010930-focus-credits.docs/contexts/focus.md, the context map, Rewards' rules and published language, and the planned Apiary progression.Checks
nx affected -t lint typecheck test buildpasses, as doesint-testfor focus, rewards and apiary against Postgres.🤖 Generated with Claude Code