Code Farm docs: Continuous Delivery for bots, exact formulas, accuracy fixes

Document auto-replant and POST /game/plot/stop in detail for automation authors
(exact conditions, quest/audit differences, race behavior, rotation recipe),
add an Exact formulas section (build time, rewards, raid payout, quests,
contracts, market supply), document the remaining crop/perk/legacy state fields.
Fix: Golden Parachute carry-over is up to 60%, crops reward_xp is base XP, and
stale game CLAUDE.md notes (Mastery step 5, raid notification names the raider).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 03:30:31 +02:00
co-authored by Claude Sonnet 5.5
parent d326c6b3f1
commit d84e4cf3d3
4 changed files with 76 additions and 11 deletions
+71 -6
View File
@@ -53,9 +53,11 @@ never be stolen.
Build time is the base time divided by the farm build speed (CI tier, the Build Cache perk, the
Bare-Metal Legacy upgrade, and the Private Registry for its three crops), so upgrades finish
everything proportionally faster. Coin and experience rewards shown in the API already include
everything proportionally faster. Coin rewards shown in the API already include
your perks, refactor bonus, Legacy multiplier, and the current Market Saturation factor, so read
them from the live state rather than from this table. Each crop in the state also carries a
them from the live state rather than from this table. The `reward_xp` in `crops` is the crop's base
experience: your actual experience is that value times `1 + 0.05 * Mentorship level` (see Exact
formulas). Each crop in the state also carries a
`market_state` of `normal`, `saturated`, or `boosted`.
## Plots
@@ -327,8 +329,8 @@ fee = round(20000 * (1 + prestige) * (1 + 0.25 * prestige) + 0.15 * coins)
so it grows with both your refactor count and your current balance (a wealth tax), and each
refactor takes longer to afford than the last. The live state reports the exact `refactor_cost`
and whether you can pay it right now (`refactor_affordable`). After the fee, **10%** of your
remaining coins carry over into the new run - up to **35%** with the Golden Parachute Legacy
upgrade - previewed exactly as `refactor_carryover_preview` (and `refactor_carryover_pct`). The
remaining coins carry over into the new run - `10% + 5%` per Golden Parachute Legacy level, so
up to **60%** at its maximum level 10 - previewed exactly as `refactor_carryover_preview` (and `refactor_carryover_pct`). The
new run starts with the 50 starting coins plus that carry-over.
Each refactor also awards **Stars**: `1 + level / 5 + prestige` (rounded down, using the level
@@ -409,6 +411,65 @@ an Era-exclusive cosmetic. Your own state reports `era_active`, `era_name`, `era
`era_harvests` while one is running; an Era can also make Era-exclusive crops plantable for its
duration.
## Exact formulas (for calculators and bots)
Every number the game shows comes from one formula, and the same formula is used when a client
reads it and when the server pays it, so a bot can reproduce any figure below exactly. `P` is your
prestige count and `L` the level of the named upgrade. All results are rounded with ordinary
half-to-even rounding to whole units, the way the live state reports them.
| Quantity | Formula |
|----------|---------|
| Prestige multiplier | `1 + 0.25 * P` |
| Legacy multiplier | `1 + 0.10 * L(multiplier)` |
| Income scale (social rewards, quest goals) | `prestige multiplier * legacy multiplier` |
| Build speed | `CI speed * (1 + 0.04 * L(growth)) * (1 + 0.05 * L(speed))`, times `1.15` for Rust, Compiler and Kernel with the Private Registry |
| Build seconds | `max(1, round(base seconds / build speed))` |
| Planting cost | `max(1, round(cost * max(0, 1 - 0.03 * L(discount))))` |
| Harvest coins | `round(base coins * (1 + 0.05 * L(yield)) * prestige multiplier * legacy multiplier * market factor)`, times `1.25` more with an active Underdog boost |
| Realized harvest coins | the harvest coins above, then times `5` if golden, then times `1.2` with an active weekly-contract boost, then times `1.12` for the Canary upside when owned (the Canary roll itself is random at harvest time) |
| Harvest experience | `round(base xp * (1 + 0.05 * L(xp)))` |
| Site experience from a harvest | `floor(farm experience / 25)`, so one Kernel harvest (400) is 16 site XP |
| Raid payout | `min(int(realized * (1 - raided so far)), max(1, round(realized * taken)))`, where `realized` is the **owner's** realized harvest coins for that build (the owner's perks, prestige, Legacy, boosts and golden flag, plus the current market factor, not yours), `taken = min(1 - raided so far, min(cap, max(floor, (0.50 - 0.05 * L(defense)) * (1 - tier reduction))))` and `L(defense)` is the owner's Branch Protection level. A raid is refused when nothing worth at least 1 coin is left |
| Watering reward | `max(6, round(6 * income scale))` coins and 3 experience |
| Daily bonus | `max(base, round(base * max(1, income scale)))` with `base = 20 + 12 * (min(streak, 7) - 1)` |
| Refactor fee | `round(20000 * (1 + P) * (1 + 0.25 * P) + 0.15 * coins)` |
| Refactor Stars | `1 + floor(level / 5) + P` |
| Grant | `min(2500, floor(treasury / eligible farms))`, zero when below 250 |
| Build seconds saved by one watering | `max(1, round(build seconds * 0.08))` |
| Fertilize cost | `ceil(realized coins * skipped seconds / full build seconds * 1.05)` |
**What a raid and a harvest do to your numbers.** A harvest pays coins and experience, advances the
`harvest` and `earn` quests, counts toward `total_harvests` and the weekly harvest count, awards
site XP, and adds one tick to that crop's Market Saturation supply. A **raid pays the raider coins
only**: no experience, no harvest count, no site XP, and it adds **no** Market Saturation supply,
because a raid moves value that was already produced instead of printing new supply. The owner is
paid the remaining share when they harvest.
**What counts as "active" for Market Saturation.** Supply is
`harvests in the last 48 hours * base build seconds / 86400 / active farms`, where an active farm is
any farm with at least one harvest this ISO week (at least 1). Only harvests by the owner, manual or
by the CI Bot, are counted.
**Daily quests, exactly.** Each day three of the four kinds below are given, taken in the order
`plant`, `harvest`, `water`, `earn` starting at a position chosen from your user and the date. The
goal is picked inside the range shown, and `scale` is your income scale (never below 1):
| Kind | Goal range | Coins | Experience |
|------|-----------|-------|------------|
| `plant` | 3 to 6 | `round(goal * 8 * scale)` | `goal * 2` |
| `harvest` | 3 to 5 | `round(goal * 14 * scale)` | `goal * 4` |
| `water` | 2 to 4 | `round(goal * 16 * scale)` | `goal * 5` |
| `earn` | 150 to 400, then `floor(goal * scale / 10) * 10` (never below 150) | `round(goal * 0.15)` | `max(1, round(goal / 30 / scale))` |
**Weekly contract, exactly.** One kind per ISO week. Goal is `4 * (min + max)` of the kind's range
above (36 plant, 32 harvest, 24 water, 2200 earn), and the `earn` goal is then scaled by your
income scale and rounded down to tens. It pays Stars and experience that do **not** scale: 3 Stars
and 40 XP for `plant` and `harvest`, 3 Stars and 30 XP for `water`, 5 Stars and 60 XP for `earn`.
**Not counted.** Auto-replant from Continuous Delivery does not advance the `plant` quest (see the
Continuous Delivery section). Quest progress is capped at the goal.
## Live updates
A farm page subscribes to the pub/sub topic `public.game.farm.{username}` and refreshes whenever
@@ -534,7 +595,8 @@ lists you act on. A plot looks like this:
```
A plot's `state` is `empty`, `growing`, or `ready`. `reward_coins`/`reward_xp` on a plot are the
crop's **base** rewards; the multiplied live values are on the matching entry in `crops`. An
crop's **base** rewards; the multiplied live coin value is on the matching entry in `crops` (its
`reward_xp` is still base experience, see Exact formulas). An
entry in `crops` carries the live `cost`, `reward_coins`, `reward_xp`, `grow_seconds`,
`min_level`, `market_state`, and a `locked` flag, so a client can decide what is both unlocked
and affordable without hard-coding the tables above.
@@ -555,7 +617,10 @@ read your **own** farm - on someone else's farm the lists are empty and the flag
**Lists:** `plots`, `crops`, plus *(owner)* `perks`, `quests` (daily entries, and the weekly
contract when unlocked), `legacy`, `mastery`, `infrastructure`, `cosmetics`. Each purchasable
entry carries `key`, `name`, `icon`, `description`, its current `level`/`owned` state, the exact
next `cost`, and a `maxed` flag where applicable.
next `cost`, and a `maxed` flag where applicable. Perks and Legacy upgrades also carry
`max_level`. Each entry in `crops` carries `locked` plus the reason: `locked_reason` is `level`,
`mastery` or `era` (empty when plantable), `locked_text` is the human sentence, `min_level` is the
unlock level and `min_mastery` is the Mastery points that must have been earned (0 or 1).
**Refactor:** `prestige`, `prestige_multiplier`, `prestige_min_level`, `prestige_available`
*(owner)*, `refactor_cost`, `refactor_affordable` *(owner)*, `refactor_carryover_pct`,