feat(apiary): a homestead to build, with bees that live and die #15

Merged
alex merged 1 commit from feat/homestead into feat/focus 2026-10-31 18:25:17 +01:00
Owner

Stacked on #14 (focus sessions); merge #13 and #14 first.

The game moves to a Forestry-style progression, with Stardew-style building.

Game loop

  • Explore: each completed focus session explores Andalusia. The first always finds a wild hive; later ones have a percent chance per minute, with one wild hive waiting at a time. Tapping it gives a pure-bred princess and two drones.
  • Build: hive kits (40 nectar, 10 pollen) and seed packets (3 seeds for 10 nectar) are placed on a 10×8 island grid; the olive tree's cells are blocked. Picking up an empty hive returns the kit, and digging up a flower returns its seed.
  • Colonies: a princess and a drone in an empty hive become its queen. She makes 60 g/h at productivity 5, scaled by vitality, up to 5 kg, but only while a flower she works is within 2 blocks.
  • Life and death: two new genes, lifespan (4, 8, 12 or 24 h) and flower (wildflowers, rosemary, lavender, orange blossom). When a queen dies she leaves a brood: one princess and 1–4 drones (by fertility), bred from her and her mate with the mutation rules from #13.

Model

  • Homestead aggregate (one per keeper, stored as a JSON document) replaces the Hive and Queen aggregates. It holds the island, hives with their queens, flowers, the bee inventory (36), supplies, vitality, discoveries and explorations. Placement, starting a colony and collecting a brood are each one consistent change.
  • Keeper becomes the wallet. It pays first for supplies and analyses (SuppliesBought, AnalysisPaid), and handlers apply them to the homestead.
  • The colony and worker model is gone. The apiary.hive_production rule vectors replace the settlement vectors, and the client predicts honey with them.
  • Apiary consumes focus.session_completed.v1 to explore.
  • New API: POST /api/apiary/supplies, PUT /api/apiary/hives/{id}, POST .../pick-up | colony | brood | harvest, POST /api/apiary/flowers and /flowers/dig, POST /api/apiary/wild-hive/collect, POST /api/apiary/bees/{id}/release | analysis.
  • Migration 202611011000-homesteads: each keeper's hive keeps its queen, alive for a fresh lifespan, with 4 of her flowers around it. Each reserve queen becomes a princess and a drone with her genes. Genomes gain the new genes from their species, and the old hives and queens tables and keeper columns are dropped.

App

  • A guide card says the next step (explore, collect the wild hive, place a hive, start a colony, plant her flower, collect the brood, harvest).
  • The hotbar has Bees, Build, Focus and Codex. Build works like a Minecraft hotbar: pick a kit or seeds, then tap the glowing free cells.
  • Tapping a hive opens its panel: choose a princess and a drone; see the queen's remaining life and whether her flower is within reach; harvest; collect the brood; pick up an empty hive. Tapping a flower lets you dig it up.
  • The Bees inventory is a slot grid with crowned princesses, analysis and release.
  • The scene draws hives, flowers and the wild nest from data. Each working hive's bees fly only to the flowers its queen works.
  • Notes dismiss themselves after a few seconds.

Checks

  • nx affected -t lint typecheck test build passes, as does the apiary int-test against Postgres.
  • In the browser: migrated the local database, then placed a hive from the build hotbar and opened its panel. I saw several hives with queens of two species, and their bees working their own flowers. No console errors.

🤖 Generated with Claude Code

Stacked on #14 (focus sessions); merge #13 and #14 first. The game moves to a Forestry-style progression, with Stardew-style building. ## Game loop - **Explore**: each completed focus session explores Andalusia. The first always finds a wild hive; later ones have a percent chance per minute, with one wild hive waiting at a time. Tapping it gives a pure-bred princess and two drones. - **Build**: hive kits (40 nectar, 10 pollen) and seed packets (3 seeds for 10 nectar) are placed on a 10×8 island grid; the olive tree's cells are blocked. Picking up an empty hive returns the kit, and digging up a flower returns its seed. - **Colonies**: a princess and a drone in an empty hive become its queen. She makes 60 g/h at productivity 5, scaled by vitality, up to 5 kg, but only while a flower she works is within 2 blocks. - **Life and death**: two new genes, **lifespan** (4, 8, 12 or 24 h) and **flower** (wildflowers, rosemary, lavender, orange blossom). When a queen dies she leaves a brood: one princess and 1–4 drones (by fertility), bred from her and her mate with the mutation rules from #13. ## Model - **Homestead** aggregate (one per keeper, stored as a JSON document) replaces the Hive and Queen aggregates. It holds the island, hives with their queens, flowers, the bee inventory (36), supplies, vitality, discoveries and explorations. Placement, starting a colony and collecting a brood are each one consistent change. - **Keeper** becomes the wallet. It pays first for supplies and analyses (`SuppliesBought`, `AnalysisPaid`), and handlers apply them to the homestead. - The colony and worker model is gone. The `apiary.hive_production` rule vectors replace the settlement vectors, and the client predicts honey with them. - Apiary consumes `focus.session_completed.v1` to explore. - New API: `POST /api/apiary/supplies`, `PUT /api/apiary/hives/{id}`, `POST .../pick-up | colony | brood | harvest`, `POST /api/apiary/flowers` and `/flowers/dig`, `POST /api/apiary/wild-hive/collect`, `POST /api/apiary/bees/{id}/release | analysis`. - **Migration** `202611011000-homesteads`: each keeper's hive keeps its queen, alive for a fresh lifespan, with 4 of her flowers around it. Each reserve queen becomes a princess and a drone with her genes. Genomes gain the new genes from their species, and the old `hives` and `queens` tables and keeper columns are dropped. ## App - A guide card says the next step (explore, collect the wild hive, place a hive, start a colony, plant her flower, collect the brood, harvest). - The hotbar has Bees, Build, Focus and Codex. Build works like a Minecraft hotbar: pick a kit or seeds, then tap the glowing free cells. - Tapping a hive opens its panel: choose a princess and a drone; see the queen's remaining life and whether her flower is within reach; harvest; collect the brood; pick up an empty hive. Tapping a flower lets you dig it up. - The Bees inventory is a slot grid with crowned princesses, analysis and release. - The scene draws hives, flowers and the wild nest from data. Each working hive's bees fly only to the flowers its queen works. - Notes dismiss themselves after a few seconds. ## Checks - `nx affected -t lint typecheck test build` passes, as does the apiary `int-test` against Postgres. - In the browser: migrated the local database, then placed a hive from the build hotbar and opened its panel. I saw several hives with queens of two species, and their bees working their own flowers. No console errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The game moves to a Forestry-like progression. A homestead per keeper holds an
island of cells, an inventory of individual bees (princesses and drones, each
with a genome) and supplies. Focus sessions explore Andalusia and turn up wild
hives (the first always does); collecting one gives a pure-bred princess and
drones. Hives and flowers are placed on the island from hive kits and seeds,
bought with nectar and pollen. A princess and a drone in an empty hive become
a queen who makes honey near the flower her new flower gene names, for her
new lifespan gene in hours; at her death she leaves a princess and drones bred
from her and her mate. The keeper aggregate becomes the wallet.

Existing keepers are migrated: their hive keeps its queen alive with flowers
around it, and reserve queens become a princess and a drone each. The web app
gets a guide to the next step, a build hotbar with glowing cells, a hive panel,
a bee inventory, and a scene drawn from the homestead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alex merged commit b21a188463 into feat/focus 2026-10-31 18:25:17 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Habitea/App!15
No description provided.