Expand description
Thread-local context for canonical entity deduplication during deserialization.
When deserializing a solution from JSON, planning list variables contain copies of entities rather than references to canonical entities from value range providers. This causes WASM pointer mismatches that break Timefold’s entity tracking.
This module provides a thread-local registry that:
- Registers canonical entities (from value range providers) during Phase 1
- Allows lookup of canonical entities by (type, planning_id) during Phase 2
The EntityContextGuard ensures proper cleanup via RAII.
Structs§
- Entity
Context Guard - RAII guard that initializes and cleans up the entity context.
Functions§
- lookup_
canonical - Looks up a canonical entity by type and planning ID.
- register_
canonical - Registers a canonical entity in the thread-local registry.