Keep the plan on the player in this world's save.
Build / build (push) Failing after 35s

Goals persist as a player attachment: load on join, write after each change, unload on leave so worlds do not leak. Dying does not wipe the list. Remote dedicated servers stay RAM-only.
This commit is contained in:
Stephen Fasciani
2026-09-08 05:42:05 -04:00
parent f807a9e603
commit 4e57760de6
20 changed files with 402 additions and 24 deletions
+3 -1
View File
@@ -37,7 +37,7 @@ RefreshProgress
missing = required − available
```
Persistence: none in this slice. The list lives in memory.
Persistence: the player in this world's save (ADR-017). Leave the world and the overlay unloads; come back and the goals load.
---
@@ -76,6 +76,8 @@ Do not start EMI. Do not start a planner menu.
[[🔌 Recipe Provider]]
[[💾 Persistence]]
[[📈 Progress Calculation]]
[[🖥️ Experience]]
+7 -3
View File
@@ -100,7 +100,7 @@ First use case: [[▶️ Create Goal]]. In code this slice is one `Planner` faca
Mark Goal Complete is named. It is not in the first slice.
The application layer calls infrastructure through ports (`RecipeProvider`, inventory snapshot). It does not contain domain rules. It loads what the use case needs, asks the domain to decide, and presents the result. Persistence is in-memory for this slice.
The application layer calls infrastructure through ports (`RecipeProvider`, inventory snapshot, `GoalStore`). It does not contain domain rules. It loads what the use case needs, asks the domain to decide, and presents the result. Persistence is the player in this world's save (ADR-017).
Packages: [[📦 Packages]].
@@ -119,7 +119,7 @@ Examples:
- Save data storage
- Inventory scanning
Shipped this slice: `VanillaRecipeProvider` (`RecipeManager`, all types, one level), player-inventory snapshot, HUD overlay, tooltip+key capture. `StubRecipeProvider` is unit tests only. No save adapter yet. EMI/JEI/REI are not dependencies.
Shipped this slice: `VanillaRecipeProvider` (`RecipeManager`, all types, one level), player-inventory snapshot, HUD overlay, tooltip+key capture, player world save. `StubRecipeProvider` is unit tests only. EMI/JEI/REI are not dependencies.
Infrastructure is never the source of domain truth.
@@ -147,7 +147,7 @@ Possible implementations:
- Server Save
- Future Cloud Sync
First slice: in-memory. No save adapter yet.
Shipped: player attachment in this world's save. Survives quit and death. Remote multiplayer stays RAM-only until a server adapter exists. See [[💾 Persistence]] and ADR-017.
---
@@ -215,6 +215,10 @@ See [[🎯 Success Metrics]].
[[🧾 Recipe Resolution]]
[[💾 Persistence]]
[[🔌 Recipe Provider]]
[[🖥️ Experience]]
[[🚶 Day in the Life]]
+49
View File
@@ -0,0 +1,49 @@
# 💾 Persistence
Port used by [[▶️ Create Goal]] (and the sibling quantity / clear paths).
The domain does not know where the plan is stored (ADR-004). Infrastructure answers.
---
## Shape
```text
GoalStore
all() / find / put / remove / clear
```
Play uses `PersistingGoalStore`: RAM plus a write after each change.
`InMemoryGoalStore` remains for unit tests.
---
## Shipped implementation
Player attachment in **this world's save** (ADR-017).
| Event | Result |
|-------|--------|
| Join world | Load this player's goals |
| Create / + / − / Clear | Write the attachment |
| Leave world | Unload RAM. Do not write empty (that would wipe the save) |
| Death | Plan is copied. It is not loot |
Singleplayer and LAN host. Remote dedicated server: RAM-only this slice.
Server save and cloud remain possible later. They do not change `GoalStore`.
---
## Related Documents
[[🏛️ Architecture]]
[[📦 Packages]]
[[📝 Decisions]]
[[▶️ Create Goal]]
[[🎯 Goal]]
+21
View File
@@ -282,6 +282,27 @@ The port remains. The **order** was wrong.
---
### ADR-017 — First persistence is the player in this world
**Date:** 2026-09-08
**Decision:** Active goals persist as a NeoForge player attachment in the current world's save.
- Per player, not one list for the whole world
- Copy on death: dying does not wipe the plan
- Load on join, write after each change, unload RAM on leave so worlds do not leak
- Singleplayer and LAN host. A remote dedicated server has no integrated world save on the client; that session stays RAM-only until a server adapter exists
**Reason:**
The first slice is a prosthetic the player can quit and resume. ADR-004 named world save, server save, and cloud. World save is the one they play.
**Status:** ✅ Accepted
**Refines:** ADR-004. **Supersedes** ADR-013’s “Persistence: in-memory” freeze for this slice.
---
## Related Documents
[[🏛️ Architecture]]
+9 -3
View File
@@ -2,7 +2,7 @@
Java packages for the first slice. Root: `com.sufficient.satistaskory`.
Rule #9: do not add a package until the slice needs it. No `project`, `emi`, or `persistence` until those are in the slice.
Rule #9: do not add a package until the slice needs it. No `project` or `emi` until those are in the slice.
---
@@ -25,7 +25,8 @@ com.sufficient.satistaskory
application/
Planner # create / increment / decrement / clear / snapshot
InMemoryGoalStore
GoalStore # port
InMemoryGoalStore # unit tests; inner store for persist
infrastructure/
recipe/
@@ -33,6 +34,10 @@ com.sufficient.satistaskory
StubRecipeProvider # unit tests only
inventory/
PlayerInventoryAdapter # player inventory → InventoryState
persistence/
GoalPlan # NBT codec
PersistingGoalStore
PlayerGoalPersistence # player attachment in this world
client/
PlayOverlay # Screen 2 HUD (not a Screen)
CaptureHook # tooltip + KeyMapping ADD_GOAL
@@ -50,7 +55,6 @@ Dependencies point inward: `infrastructure` and `application` may import `domain
|---------|-----|
| `Project` | Organizational only; not in the slice |
| Completion strategy | Ready ≠ complete; complete is not in the slice |
| Persistence | In-memory goals. ADR-004 still holds; no save adapter yet |
| Full-screen planner | Not discovered |
The NeoForge template example block/item is gone. Do not put it back.
@@ -65,6 +69,8 @@ The NeoForge template example block/item is gone. Do not put it back.
[[🔌 Recipe Provider]]
[[💾 Persistence]]
[[🎯 Goal]]
[[📝 Decisions]]
+7 -5
View File
@@ -6,19 +6,19 @@ What exists, and what is next. Implementation detail will live in an Implementat
## ✅ Now (docs)
- Philosophy Rules #1–#10; ADRs **001–016**
- Philosophy Rules #1–#10; ADRs **001–017**
- Vision, ubiquitous language, bounded context (one: Goal Planning)
- Goal invariants: one per ItemId, quantity ≥ 1, create at 1 / +1, `[-]` at 1 removes
- Packages named; [[🔌 Recipe Provider]] sketched; [[▶️ Create Goal]] written
- Experience: capture in place; overlay on the right (goals + aggregated needed counts)
First slice **code exists** and has been played: domain, `VanillaRecipeProvider` (`RecipeManager`, all types, one level), in-memory `Planner`, player inventory, play overlay, hover + Add key. Plan does not survive restart.
First slice **code exists** and has been played: domain, `VanillaRecipeProvider` (`RecipeManager`, all types, one level), player world save, player inventory, play overlay, hover + Add key.
---
## 🔲 Next
1. World-save persistence
The frozen first slice is in play. Listen. Do not open Project, completion, or a Screen rewrite because the list is empty.
EMI is not a dependency. See ADR-016.
@@ -26,7 +26,9 @@ EMI is not a dependency. See ADR-016.
## ⏸ Not opened
- World save
- Project
- Completion
- Full-screen planner
---
@@ -35,7 +37,7 @@ EMI is not a dependency. See ADR-016.
Not a queue. See [[🚧 Future Ideas]].
- Viewer-only recipe adapter if `RecipeManager` is not enough
- Persistence (world / server / cloud)
- Persistence (server / cloud)
- Projects packaged
- Completion
- Full-screen planner
@@ -367,6 +367,20 @@ Next is still world save. Not EMI. Not a Screen rewrite.
---
## 📜 2026-09-08 (player world save)
Greetings, Wayfinder.
Recipes worked in play: spruce fence gate → sticks + spruce planks. The first slice's last freeze was persistence.
ADR-017: the plan lives on the player in this world's save. Copy on death. Unload RAM when leaving so World B does not inherit World A. Remote dedicated server is still RAM-only.
The frozen slice is now: name a goal, see missing materials, quit, come back, still see them.
Do not open Project because that feels like "what's next." Listen.
---
## Related Documents
[[🌟 Project Vision]]
+1 -1
View File
@@ -7,7 +7,7 @@ Not a build queue.
---
- Viewer-only recipe adapter (EMI/JEI/REI) **if** a recipe never appears in `RecipeManager`
- Persistence (world save / server / cloud)
- Persistence (server save / cloud)
- Inventory-detection completion (alongside manual)
- Ender chest / later storage in the inventory snapshot
- Projects packaged