Technical Foundations
Technical foundations for engineers building deterministic spatial systems: containers, replay, and the three-layer architecture that powers reliable world state.
Core Concepts
Asset Core is a deterministic spatial-transactional engine that treats world state as a series of atomic, replayable transformations. When applications, automation, or agent tooling execute operations—from adding items to a container to moving entities across a grid—every mutation is recorded in an append-only commit log that serves as the single source of truth. This makes the runtime auditable by design and enables precise recovery after failures.
This architecture guarantees that:
- The same sequence of events always produces the same final state (determinism)
- Any point in time can be reconstructed by replaying the commit log (replay)
- Internal state and external notifications never diverge (consistency)
- All operations are atomic and transactional (reliability)
Container Types
Systems operate in environments with different spatial structures. Asset Core provides first-class container types for each, modeling containers as spatially-typed objects where each represents a distinct kind of addressable space. The key is that the same transaction model applies everywhere, so you do not need different infrastructure per container type. The system currently supports:
0-Dimensional Containers
- Balances: 0D algebraic quantities (fixed-point) with no spatial coordinates. Used for currency, resources, or any quantity that doesn’t occupy space.
- Slots: Discrete, numbered positions (1, 2, …, N) without geometric relationships. Used for equipment slots, ordered lists, or semantic positions.
Discrete Grids (1D/2D)
- 1D Grids (ℤ): Linear lattices with sequential positions. Support shape placement, collision, and spatial constraints along a single axis.
- 2D Grids (ℤ²): Two-dimensional lattices (width × height) with full geometric semantics. Support multi-cell shapes, rotation, adjacency, and collision detection.
Continuous Spaces (1D/2D)
- 1D Continuous (ℝ): Fixed-point coordinates along a line for rails, lifts, and single-axis robotics.
- 2D Continuous (ℝ²): Fixed-point x/y placements with rotation for robot workcells and metric collision checks.
Extensible to Higher Dimensions
Asset Core can naturally be extended to higher dimensions—for example, 3D discrete grids or continuous volumes—while maintaining the same deterministic transaction model, replay, and ordering guarantees.
Universal Operations
All containers share a common set of operations that work consistently across dimensional spaces. This makes integrations predictable: once you understand the operation envelope, you can apply it everywhere.
- Add/Remove: Introduce or remove quantities or entities
- Move: Translate entities within the same container space
- Split/Merge: Divide or combine stacks and quantities
- Transfer: Move entities between different containers (cross-space transitions)
These operations preserve determinism, are fully replayable, and maintain consistent semantics whether applied to 0D balances or 2D grids.
Architecture
When a client executes an operation that modifies world state, Asset Core processes it through three layers. This three-layer architecture is inspired by database storage engines, ensuring clean separation of concerns and predictable behavior. It is also the source of most of the system’s invariants, so it is worth understanding early.
Storage Layer (L1)
Low-level data structures optimized for performance. Uses Structure-of-Arrays (SoA) layout with dense IDs for cache-friendly iteration and predictable memory access patterns. This layer provides raw primitives without validation or business logic.
Operations Layer (L2)
Domain validation and state orchestration. This layer orchestrates storage primitives, enforces world constraints (collision, bounds, shape fitting), maintains derived indexes, and emits events describing what changed. Operations are deterministic and fully validated before committing.
Transaction Layer (L3)
Atomic execution with rollback support. This layer coordinates transaction boundaries, records undo information for rollback, and seals successful operations into the commit log. Guarantees that operations are atomic and isolated. This layering ensures that performance-critical paths remain fast (L1), world rules are centralized and testable (L2), and transactional correctness is enforced structurally (L3).
Guarantees
Asset Core provides strong correctness and reliability guarantees through deterministic replay and an append-only commit log.
Replay
Replay is central to Asset Core’s correctness guarantees and enables perfect reconstruction of system behavior. The commit log stores events as hybrid records containing both:
- Delta information: What changed (added 10 items, moved from slot A to slot B)
- Post-state: The resulting state after the change (final quantity is 50, entity now at position X)
This dual encoding enables:
- Real-time analytics: Delta information can drive dashboards, notifications, and live queries.
- Deterministic replay: Post-state defines the authoritative result—replaying the recorded sequence reproduces the exact original state with no cumulative drift.
- Crash recovery: Any projection (read model or observer) can be rebuilt from the commit log.
Replay applies events mechanically using storage primitives only, with no validation or world-rule logic. This guarantees that replayed state is bit-for-bit equivalent to the original committed state.
Commit Log
The commit log is an append-only, durable sequence of sealed event batches that serves as the authoritative record of all system actions. It avoids internal dual-writes by making the log the sole authoritative write; projections and notifications are derived from it. This keeps audit trails clean and eliminates hidden state. Implementations include file-backed logs for production, in-memory logs for development, memory-mapped readers for alternate tailing, and extensible backends for cloud or other storage media.
Key properties:
- Events are immutable once committed.
- Global, monotonically increasing sequence numbers provide total ordering.
- Batches are checksummed for integrity verification.
This design supports compliance (audit trails, chain-of-custody), debugging (replay to any historical state), and multi-tenant isolation (namespaced commit history). Projections and notifications are derived from committed events and can be retried independently without risking divergence.
See Examples
For concrete demonstrations of each container type, see the Examples page for runnable-in-spirit JSON operations and applied scenarios. For a detailed walkthrough with real calls, see the Robotic Arm Continuous scenario.