Fact store
This wiki entry defines a term used across VSAVM and explains why it matters in the architecture.
The diagram has a transparent background and highlights the operational meaning of the term inside VSAVM.
Related wiki pages: VM, event stream, VSA, bounded closure, consistency contract.
Definition
A fact store is a structured memory of assertions. In VSAVM it stores canonical fact identifiers alongside polarity and scope metadata, and it is accessed through a pluggable StorageStrategy interface.
Role in VSAVM
The fact store is the substrate for closure and conflict detection. It is where derived facts are accumulated and where contradictions are detected during bounded closure.
Mechanics and implications
The key invariants are canonical identifiers, explicit negation via polarity, and explicit scope derived from structural boundaries (DS010/NFS11). These make conflict detection robust to paraphrases and meaningful under localized contexts.
VSAVM supports multiple storage strategies. The default is in-memory, but large ingestions can select an on-disk strategy:
- MemoryStore (default): fast in-memory maps and indices for small/medium runs.
- FileStore (DS012): optional disk-backed append-only log with tombstones and a configurable in-memory index/cache to reduce RAM pressure.
- Other strategies: sqlite/leveldb/postgres strategy shells exist in the codebase; their readiness depends on the current implementation status.
Disk-backed storage (FileStore, DS012)
The disk-backed strategy is designed to be opt-in and behavior-compatible:
- Append-only log: facts are written as length-prefixed binary records (DS007-aligned).
- Tombstones:
denyFactwrites a tombstone record (last-write-wins) instead of deleting bytes. - Snapshots: a snapshot is a saved byte offset; restore truncates the log back to that point.
- Indexing/caching: an optional in-memory index maps
factId → offset; an optional small LRU caches decoded facts.
Node.js does not provide a portable built-in memory-mapped file API, so the current strategy uses buffered reads/writes rather than mmap.
Selecting a storage strategy
The storage backend is selected via the VSAVM strategy configuration, for example:
new VSAVM({ strategies: { storage: 'file' } })
Further reading
Fact stores are related to knowledge bases; VSAVM’s emphasis is on canonical IDs and scope-aware closure rather than on open-world accumulation.
References
Knowledge base (Wikipedia) Consistency (Wikipedia) Context (computing) (Wikipedia)