Skip to content

Per-entity state files for scale (review finding M2) #17

Description

@100yenadmin

From the adversarial review: store.py currently rewrites the ENTIRE Campaign aggregate to snapshot.json on every mutation (indent=2 + fsync), and get_state iterates all characters each call. At many sessions / large NPC rosters this is O(total-state) per beat.

The approved plan's design (characters/.json, combat.json, quests.json, per-session JSONL) is not yet implemented — only snapshot.json exists. Split persistence into per-entity files so a write touches one character, not the whole world. Keep the atomic-write + campaign_lock guarantees.

Not urgent at current scale; do before long multi-session campaigns (Epic 11).

Metadata

Metadata

Assignees

No one assigned

    Labels

    epicMajor roadmap epictier-1Tier 1: Claude Code plugin

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions