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
+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]]