[PR] Production bills #63

Open
agent-claude wants to merge 0 commits from claude/62-production-bills into main
Collaborator

Fixes #62

What

RimWorld-style production bills:

  • Control: per-recipe on/off, a target stock ("do until X", 0–999), and a priority order, set with a SET_BILL command.
  • Sync and storage: bills replicate to clients and persist.
  • Crafting: benches work enabled bills top to bottom.
  • Compatibility: recipes without a bill keep their old defaults, so existing colonies behave as before.

The Production [P] window lets you reorder, toggle, and set targets (±5 or typed). It shows live stock against target, and why a bill can't run yet (research needed, or no bench built).

Testing

  • New bills.test.ts (6 tests): disabled bills never run, targets cap output, priority decides what runs first, input is clamped, and changes reach clients and persist.
  • npm test passes (107 sim-core, 6 server), the typecheck is clean, and the client builds.
  • Locally: opened the window, turned off rations and moved Cook Simple Meal up. Both changes came back from the server and showed in the window.

🤖 Generated with Claude Code

Fixes #62 ## What RimWorld-style **production bills**: - **Control:** per-recipe on/off, a target stock ("do until X", 0–999), and a priority order, set with a `SET_BILL` command. - **Sync and storage:** bills replicate to clients and persist. - **Crafting:** benches work enabled bills top to bottom. - **Compatibility:** recipes without a bill keep their old defaults, so existing colonies behave as before. The **Production [P]** window lets you reorder, toggle, and set targets (±5 or typed). It shows live stock against target, and why a bill can't run yet (research needed, or no bench built). ## Testing - New `bills.test.ts` (6 tests): disabled bills never run, targets cap output, priority decides what runs first, input is clamped, and changes reach clients and persist. - `npm test` passes (107 sim-core, 6 server), the typecheck is clean, and the client builds. - Locally: opened the window, turned off rations and moved Cook Simple Meal up. Both changes came back from the server and showed in the window. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- Bills in colony state (SET_BILL): per-recipe on/off, target stock
  ("do until X", 0-999) and priority order; replicated when changed,
  covered by the state hash and persisted. Recipes without a bill use
  their content defaults, so existing colonies behave as before.
- Crafting works enabled bills in priority order across all benches
  (apparel still jumps the queue when a colonist needs it).
- Production [P] window: reorder, toggle, adjust targets (+/-5 or typed),
  live stock vs target, and why a bill can't run (research / no bench).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Collaborator

Merge approved by @johnw via Claude Code chat on 2026-10-20: "Do what you see fit and I approve all changes to be merged and deployed"

Merge approved by @johnw via Claude Code chat on 2026-10-20: "Do what you see fit and I approve all changes to be merged and deployed"
This branch is already included in the target branch. There is nothing to merge.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin claude/62-production-bills:claude/62-production-bills
git switch claude/62-production-bills

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff claude/62-production-bills
git switch claude/62-production-bills
git rebase main
git switch main
git merge --ff-only claude/62-production-bills
git switch claude/62-production-bills
git rebase main
git switch main
git merge --no-ff claude/62-production-bills
git switch main
git merge --squash claude/62-production-bills
git switch main
git merge --ff-only claude/62-production-bills
git switch main
git merge claude/62-production-bills
git push origin main
Sign in to join this conversation.
No description provided.