[PR #133] [MERGED] SMP 0.21.0: daily contracts (/jobs), paid from the Treasury #135

Closed
opened 2026-11-03 04:03:33 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon-mods/pull/133
Author: @ludovic111
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: feat/smp-jobs


📝 Commits (3)

  • 27bfc9d SMP 0.19.0: the bank (/bank), savings paid by the Treasury
  • bb97027 SMP 0.20.0: /eco stats, the daily economy report, web/economy.json
  • 219c930 SMP 0.21.0: daily contracts (/jobs), paid from the Treasury

📊 Changes

12 files changed (+1765 additions, -16 deletions)

View changed files

📝 native/smp/Cargo.lock (+1 -1)
📝 native/smp/Cargo.toml (+1 -1)
📝 native/smp/README.md (+40 -3)
📝 native/smp/mixins/smp/glue.rs (+95 -3)
📝 native/smp/mixins/smp/horizon-mixin.toml (+19 -1)
➕ native/smp/mixins/smp/smp_bank.rs (+442 -0)
📝 native/smp/mixins/smp/smp_economy.rs (+69 -2)
➕ native/smp/mixins/smp/smp_jobs.rs (+571 -0)
➕ native/smp/mixins/smp/smp_report.rs (+498 -0)
📝 native/smp/mixins/smp/smp_tax.rs (+20 -3)
📝 native/smp/proof.py (+3 -2)
📝 native/smp/src/lib.rs (+6 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Jobs (smp-econ-1, round 2). Stacked on #131 (bank) and the report PR: review only the last commit; the diff shrinks as they merge.

What: a daily contracts board, paid from the Treasury (taxes go back to players who gather what the server asks for; nothing minted).

  • 00:00 UTC: 4 contracts (jobs.contracts_per_day) drawn from farm, mine and mob produce the market buys (jobs.items), announced to everyone. /jobs lists them, /jobs deliver <n> takes 64 plain items from the inventory (they leave the game) and pays at once (contract 64 minecraft:wheat in the audit log).
  • Pay per item: the market's sell price +30%, never over 90% of the market's ask, checked again at delivery as prices move: buying from the market to deliver never pays.
  • Bounds: 8 deliveries per contract for the whole server, 2 per player a day, survival/adventure only, and the day's contracts cost at most 10% of the Treasury when posted (an empty Treasury posts none).
  • Never AFK income: only a command with the items in the inventory pays. Items are taken before the payment; if the payment fails they are given back.
  • Prices: Market::price today; switches to smp-market-1's TWAP once its API is on main.

Tests: cargo test --lib 94 passed (new: pay below the ask and within the budget, a delivery takes and pays once with the per-player cap and nothing taken when refused, a falling ask lowers the pay, empty Treasury, restart), clippy -D warnings, fmt. Game build: CI. proof.py: config key jobs.

Version 0.21.0.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon-mods/pull/133 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/smp-jobs` --- ### 📝 Commits (3) - [`27bfc9d`](https://github.com/horizon-rust/horizon-mods/commit/27bfc9da13b52a4504ab4ce2744f6dcc275090de) SMP 0.19.0: the bank (/bank), savings paid by the Treasury - [`bb97027`](https://github.com/horizon-rust/horizon-mods/commit/bb97027039b7ebb30527979626d3eb26ab08d499) SMP 0.20.0: /eco stats, the daily economy report, web/economy.json - [`219c930`](https://github.com/horizon-rust/horizon-mods/commit/219c9302d9ea2e4314b155107161233a98c81c66) SMP 0.21.0: daily contracts (/jobs), paid from the Treasury ### 📊 Changes **12 files changed** (+1765 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `native/smp/Cargo.lock` (+1 -1) 📝 `native/smp/Cargo.toml` (+1 -1) 📝 `native/smp/README.md` (+40 -3) 📝 `native/smp/mixins/smp/glue.rs` (+95 -3) 📝 `native/smp/mixins/smp/horizon-mixin.toml` (+19 -1) ➕ `native/smp/mixins/smp/smp_bank.rs` (+442 -0) 📝 `native/smp/mixins/smp/smp_economy.rs` (+69 -2) ➕ `native/smp/mixins/smp/smp_jobs.rs` (+571 -0) ➕ `native/smp/mixins/smp/smp_report.rs` (+498 -0) 📝 `native/smp/mixins/smp/smp_tax.rs` (+20 -3) 📝 `native/smp/proof.py` (+3 -2) 📝 `native/smp/src/lib.rs` (+6 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Jobs (smp-econ-1, round 2). Stacked on #131 (bank) and the report PR: review only the last commit; the diff shrinks as they merge. **What**: a daily contracts board, paid from the Treasury (taxes go back to players who gather what the server asks for; nothing minted). - 00:00 UTC: 4 contracts (`jobs.contracts_per_day`) drawn from farm, mine and mob produce the market buys (`jobs.items`), announced to everyone. `/jobs` lists them, `/jobs deliver <n>` takes 64 plain items from the inventory (they leave the game) and pays at once (`contract 64 minecraft:wheat` in the audit log). - Pay per item: the market's sell price +30%, never over 90% of the market's ask, checked again at delivery as prices move: buying from the market to deliver never pays. - Bounds: 8 deliveries per contract for the whole server, 2 per player a day, survival/adventure only, and the day's contracts cost at most 10% of the Treasury when posted (an empty Treasury posts none). - Never AFK income: only a command with the items in the inventory pays. Items are taken before the payment; if the payment fails they are given back. - Prices: `Market::price` today; switches to smp-market-1's TWAP once its API is on main. **Tests**: `cargo test --lib` 94 passed (new: pay below the ask and within the budget, a delivery takes and pays once with the per-player cap and nothing taken when refused, a falling ask lowers the pay, empty Treasury, restart), clippy -D warnings, fmt. Game build: CI. proof.py: config key `jobs`. Version 0.21.0. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:03:33 +07:00
Sign in to join this conversation.
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
horizon-rust/horizon-mods#135
No description provided.