Companion for Blueprint, providing composition and mounting operations.
Attributes
- Companion
- trait
- Source
- Blueprint.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Blueprint.type
Members list
Value members
Concrete methods
Compose two blueprints into a single composed blueprint.
Compose two blueprints into a single composed blueprint.
This is the core operation for Phase 3: combining two independent module blueprints into a single ComposedBlueprint with:
- Unioned owned schemas (O1 ++ O2)
- Unioned transaction sets (T1 ++ T2)
- Merged reducer logic with module-based routing
The composed blueprint requires evidence that the combined schema has unique table names (UniqueNames[O1 ++ O2]).
Reducer routing strategy:
- Transactions MUST implement ModuleRoutedTx (enforced by RoutedStateReducer0 type)
- The moduleId.path is module-relative (MName *: SubPath)
- The reducer routes based on the first segment matching M1 or M2
- Type safety is compile-time: non-routed transactions will not compile
IMPORTANT: ModuleId is always module-relative. When a blueprint is mounted at a path, the mount path is NOT prepended to transaction moduleIds. Full paths (mountPath ++ moduleId.path) are only constructed at system edges for telemetry or logging.
Phase 5.6 UPGRADE: Now supports modules with non-empty Needs. The providers are merged using TablesProvider.merge, which requires that the dependency schemas are disjoint (DisjointSchemas[N1, N2]). This prevents ambiguous table lookups while allowing flexible composition of dependent modules.
Type parameters
- F
-
the effect type
- M1
-
first module name
- M2
-
second module name
- MOut
-
the output module name
- O1
-
first owned schema tuple
- O2
-
second owned schema tuple
- T1
-
first transaction types tuple
- T2
-
second transaction types tuple
Value parameters
- a
-
the first blueprint
- b
-
the second blueprint
- disjointNeeds
-
evidence that dependency schemas are disjoint (Phase 5.6)
- uniqueNames
-
evidence that combined owned schema has unique names
Attributes
- Returns
-
a ComposedBlueprint with RoutedStateReducer0
- Source
- Blueprint.scala
Mount a blueprint at a path composed from base and sub paths.
Mount a blueprint at a path composed from base and sub paths.
This is a convenience helper for Phase 3 that simplifies mounting a blueprint at a nested path.
Type inference: Only Base and Sub need to be specified explicitly. All other types (F, MName, Owns, Needs, Txs) are inferred from the blueprint parameter.
Type parameters
- Base
-
the base path tuple (needs explicit specification)
- Sub
-
the sub-path tuple (needs explicit specification)
Value parameters
- blueprint
-
the blueprint to mount
- monad
-
the Monad instance for F
- nodeStore
-
the MerkleTrie node store
- prefixFreePath
-
evidence that Base ++ Sub with Owns is prefix-free
- schemaMapper
-
the schema mapper for instantiating tables
Attributes
- Returns
-
a state module mounted at Base ++ Sub
- Source
- Blueprint.scala