Files
satistaskory/docs/03-Architecture/💾 Persistence.md
T
Stephen Fasciani 4e57760de6
Build / build (push) Failing after 35s
Keep the plan on the player in this world's save.
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.
2026-09-08 05:42:05 -04:00

999 B
Raw Blame History

💾 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

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.


🏛️ Architecture

📦 Packages

📝 Decisions

▶️ Create Goal

🎯 Goal