Skip to content

WIP: State Reconstructor#160

Draft
inxilpro wants to merge 62 commits into
mainfrom
state-reconstructor
Draft

WIP: State Reconstructor#160
inxilpro wants to merge 62 commits into
mainfrom
state-reconstructor

Conversation

@inxilpro

Copy link
Copy Markdown
Contributor

Just posting this as a draft for discussion.

inxilpro and others added 30 commits January 13, 2025 17:03
Co-Authored-By: Daniel Coulbourne <429010+DanielCoulbourne@users.noreply.github.com>
Co-Authored-By: Skyler Katz <skylerkatz@hey.com>
- Rename StateManager class to Scope and update all references
- Create ReconstitutingScope that reconstitutes stale states on-demand by replaying their connected component of events
- Add Scope::run() method for managing the current scope binding in the container
- Add Scope::singleton(), all(), willPrune(), and prune() methods
- Enable snapshot writing and pruning in Broker by implementing writeSnapshots() helper
- Add StoresSnapshots dependency to Broker
- Update cache contracts with values() method and prune-related methods
- Remove incomplete StateReconstructor and ReconstitutingStateManager classes
- Bind ReconstitutingScope in service provider
- Update Replay to use Scope::run() for scope management
- Rename StateManagerTest to ScopeTest and update test names
- Fix Date::setTestNow() calls to include timestamps
- Remove debug dump() statements from tests
…harvest merging

- Restore snapshot hydration on the replay path (skip reconstitution but load from snapshots)
- Fix isStale() to match singletons by type only, mirroring event storage
- Fix harvest to merge into exact requested instances and never clobber live singletons
- Hoist setReplaying(true) outside the replay loop
- Add ReplayEvictionTest to pin snapshot reload during eviction
Pin states with in-flight events to prevent eviction during batch operations. Refactor MultiCache to support layered reads with backfill and separate read/write-only cache wrappers. Split authorize and validate into distinct phases. Fix StateIdentity to accept string IDs from database drivers. Add comprehensive cache and state identity tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocks 1.0 We can't release v1.0 until this is merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants