VersionRegistry class

Maps (cellId, version) to the receptor and test rule that implemented that version.

When to use

The replay engine's ReplayEngine consults the VersionRegistry first: if the registry has an entry for (cellId, version), that is used; otherwise, the live receptor is used only if its version matches the ledger's; otherwise, replay fails loudly.

Non-obvious: the registry is graph-scoped, not process-wide

Two graphs in the same process may have the same cell name with different version histories (a test graph and a production graph). A process-wide registry would allow the test graph's version to shadow the production graph's, which is exactly the kind of ambient coupling the governance layer exists to prevent. The registry is created lazily by CellGraphVersions.versions and lives for the graph's lifetime.

See also:

Constructors

VersionRegistry()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

has({required String cellId, required String version}) → bool
Returns true if (cellId, version) is registered.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register({required String cellId, required String version, required Receptor<Cell> receptor, required TestCell<Cell> testRule}) → void
Registers receptor and testRule as the implementation for cellId at version. Both must have the same version string.
resolve({required String cellId, required String version}) → ({Receptor<Cell> receptor, TestCell<Cell> testRule})?
Resolves cellId at version. Returns the registered pair, or null if the version is not registered — the caller must then either fall back to the live implementation (if its version matches) or fail loudly.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited