Files
satistaskory/docs/03-Architecture/💾 Persistence.md
T
Stephen Fasciani 5d49f1482f
Build / build (push) Failing after 26s
Record persistence played on singleplayer and named multiplayer.
2026-09-08 06:16:05 -04:00

63 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 💾 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
Client-owned files (ADR-018). The host does not need this mod.
| Where | File |
|-------|------|
| Singleplayer | `<world>/satistaskory.dat` |
| Remote / LAN guest | `satistaskory/remote/<name-and-motd>.dat` in the game directory |
Name + MOTD, not hostname or IP. Addresses change (localhost vs LAN vs a new port). The list name is what the player already maintains. MOTD is extra; a default MOTD is fine when the name is distinct.
**Rename of the multiplayer list entry is a new file.** The old plan stays under the old name and will not load. That is a wipe of the living overlay. Document it for the player: name the server once and leave it. This product is a prosthetic for working memory and context-switching; reconstructing a lost queue is the failure mode.
| Event | Result |
|-------|--------|
| Join world | Load this client's file for that world, or for that server name + MOTD |
| Create / + / − / Clear | Write that file |
| Leave world | Unload RAM. Do not write empty (that would wipe the save) |
| Death | Irrelevant. The plan is not on the player entity |
A later server or cloud adapter is still allowed. It does not change `GoalStore`. It is not required for the prosthetic to function.
Played: singleplayer and a named multiplayer server. The plan comes back.
Player-facing copy: [[🖥️ Experience]].
---
## Related Documents
[[🏛️ Architecture]]
[[📦 Packages]]
[[📝 Decisions]]
[[▶️ Create Goal]]
[[🎯 Goal]]
[[🖥️ Experience]]