Blueprint

org.sigilaris.core.application.module.blueprint.Blueprint
See theBlueprint companion trait
object Blueprint

Companion for Blueprint, providing composition and mounting operations.

Attributes

Companion
trait
Source
Blueprint.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Blueprint.type

Members list

Value members

Concrete methods

def composeBlueprint[F[_], MOut <: String](a: Blueprint[F, _, _, _, _, _], b: Blueprint[F, _, _, _, _, _])(using monadF: Monad[F], moduleOut: ValueOf[MOut], uniqueNames0: UniqueNames[Concat[a.OwnsType, b.OwnsType]], disjointNeeds: DisjointSchemas[a.NeedsType, b.NeedsType], projectionN1: TablesProjection[F, a.NeedsType, Concat[a.NeedsType, b.NeedsType]], projectionN2: TablesProjection[F, b.NeedsType, Concat[a.NeedsType, b.NeedsType]]): ComposedBlueprint[F, MOut, Concat[a.OwnsType, b.OwnsType], Concat[a.NeedsType, b.NeedsType], Concat[a.TxsType, b.TxsType]]

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
def mountAt[Base <: Tuple, Sub <: Tuple](blueprint: ModuleBlueprint[_[_], _, _, _, _])(using monad: Monad[blueprint.EffectType], prefixFreePath: PrefixFreePath[Concat[Base, Sub], blueprint.OwnsType], nodeStore: NodeStore[blueprint.EffectType], schemaMapper: SchemaMapper[blueprint.EffectType, Concat[Base, Sub], blueprint.OwnsType]): StateModule[blueprint.EffectType, Concat[Base, Sub], blueprint.OwnsType, blueprint.NeedsType, blueprint.TxsType, StateReducer[blueprint.EffectType, Concat[Base, Sub], blueprint.OwnsType, blueprint.NeedsType]]

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