Upstream/docs/workflows/README.md
jvanvik 3c23c51902 Phase 4: close loot/refund leaks, landing-site garrisons, speed-scaled shipping, update/offsite tooling, broad e2e
Built:
- Economy: raid loot capped to the room the raiders have at home (rest stays with the victim, "lootLeft" in the report); trade escrow reserves its room so refunds always fit; trade accept refuses with no_room_for_goods when the goods would not fit. Loot destroyed per 30-day run 31-61k -> ~1k, refunds clipped ~27k -> 0 (docs/BALANCE.md, 3 seeds).
- End game: members of the holding alliance garrison landing sites (migration 005_site_garrison.sql), garrison counts in site defence, 72 h capture shield, withdraw route, POP view lists garrisoned units. Shipping capacity scales with world speed (3x world: winner 76-98 -> ~30-36 days after sites open). Bot runs show real contests (84-194 attacks on held sites at 1x).
- Ops: deploy/update.sh (backup, stop, ff-merge, npm ci --ignore-scripts, health check, rollback), deploy/upstream-offsite (rsync only), admin end-world snapshots results, EPIPE fix, docs/workflows/ filled in.
- e2e 62 -> 163 checks: units, raids/reports, alliance+messages, trade, end game, nb, PWA, reconnect, slow polling fallback (opt-in). Two app bugs found: message push ignored, "New" button stayed English.

Tested: npm test 274/274, openapi check, npm run e2e 163/163 (137 s), bot runs 50x30d seeds 1-3 and 140-day/60-day speed-3 end-game runs INVARIANTS OK, adversarial review pass (findings fixed or documented).
NOT tested: update.sh on a real box (systemd, real npm, runuser; stubs only, shellcheck not installed), garrison card/loot text on a phone, Node 22.13, humans. Known leaks left open and documented (BALANCE S6): loot/shipments can still overflow when stock arrives in flight, bounced backbone shipments lose overflow (reported to the sender). Garrison numbers (heldDefenceMult 2, shield 72 h) are first guesses from 2 seeds. Not claimed: balanced.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q2MJaQ5LXAHzGnTDgceT14
2026-10-12 00:58:12 +02:00

1.6 KiB

Stage workflows

One short note per stage of CLAUDE.md "Working in stages": goal, done-when, what was actually built, what is open. They were written after the fact (2026-10-11) from docs/NEXT.md, docs/DECISIONS.md, docs/BALANCE.md and the git history, so they describe what happened, not what was once planned. The authoritative status is docs/NEXT.md; if a note here disagrees, NEXT wins and the note is stale.

A stage is done when npm test passes, the smoke e2e passes, the docs (API, PROTOCOL, DESIGN, NEXT) match the code and the commit message says honestly what was built, tested and NOT tested (CLAUDE.md).

Stage Note Commits
0 Skeleton stage-0-skeleton.md b56b138
1 Economy stage-1-economy.md b56b138, 249818a (client)
2 World stage-2-world.md b56b138, 249818a (client)
3 Military stage-3-military.md 249818a, b18645d
4 Expansion stage-4-expansion.md 249818a, b18645d
5 Social stage-5-social.md 249818a, b18645d, 931f59e, d84b0c9
6 Push and polish stage-6-push-polish.md b18645d, 931f59e, cc0524d
7 Ops and balance stage-7-ops-balance.md 931f59e, cc0524d, bf7af06, 9104480 and later

Note: the work did not follow the stage order exactly. Stages 0-2 went in one commit, 3-5 in the next, and the end game and trade (planned inside stage 5 / 7) arrived with the client work. The notes list the real commits.