org.sigilaris.core.assembly

High-level assembly DSL for blockchain application construction.

This package provides convenient tools and DSL methods for assembling blockchain applications from modular blueprints, with compile-time validation and type-safe table access.

=Core Components=

'''org.sigilaris.core.assembly.BlueprintDsl''' - High-level mounting DSL

'''org.sigilaris.core.assembly.EntrySyntax''' - String interpolator for Entry creation

  • entry"tableName"[K, V] creates Entry[Name, K, V] with compile-time literal extraction
  • Ensures table names are string literals (not expressions)
  • Preserves type-level information for schema validation

'''org.sigilaris.core.assembly.TablesProviderOps''' - Provider extraction extensions

'''org.sigilaris.core.assembly.TablesAccessOps''' - Evidence derivation utilities

'''org.sigilaris.core.assembly.PrefixFreeValidator''' - Runtime prefix validation

  • Validates that table prefixes are prefix-free at byte level
  • Useful for testing and debugging schema configurations
  • Operates on encoded prefixes (after length-prefix encoding)

=Usage Examples=

Attributes

See also
Example

Basic module mounting:

 import org.sigilaris.core.assembly.BlueprintDsl.*
 import org.sigilaris.core.assembly.EntrySyntax.*
 // Define schema with entry interpolator
 val accountsEntry = entry"accounts" [String, Account]
 val balancesEntry = entry"balances" [String, BigInt]
 // Create and mount blueprint
 val module = mount("accounts" -> accountsBlueprint)
 // Extract provider for dependent modules
 import org.sigilaris.core.assembly.TablesProviderOps.*
 val provider = module.toTablesProvider

Multi-segment path mounting:

 import org.sigilaris.core.assembly.BlueprintDsl.*
 // Mount at nested path
 val module = mountAtPath(("app", "v1", "accounts") -> blueprint)

Composed blueprint mounting:

 import org.sigilaris.core.assembly.BlueprintDsl.*
 import org.sigilaris.core.application.module.blueprint.Blueprint
 // Compose two blueprints
 val composed = Blueprint.composeBlueprint[IO, "app"](
   accountsBlueprint,
   balancesBlueprint,
 )
 // Mount composed blueprint (requires ModuleRoutedTx)
 val module = mountComposed("myapp" -> composed)

Evidence derivation:

 import org.sigilaris.core.assembly.TablesAccessOps.*
 // Derive Lookup evidence without explicit summon
 val lookup = deriveLookup[MySchema, "accounts", String, Account]
 val table  = lookup.table(tables)
 // Or use extension method for direct access
 val accountsTable = provider.providedTable["accounts", String, Account]

Prefix validation (testing):

 import org.sigilaris.core.assembly.PrefixFreeValidator
 // Validate at compile-time
 val result =
   PrefixFreeValidator.validateSchema["app" *: EmptyTuple, MySchema]
 assert(result == PrefixFreeValidator.Valid)
 // Validate at runtime with names for debugging
 val prefixes = List(
   ("accounts", tablePrefix["app" *: EmptyTuple, "accounts"]),
   ("balances", tablePrefix["app" *: EmptyTuple, "balances"]),
 )
 val result2 = PrefixFreeValidator.validateWithNames(prefixes)

=Design Principles= '''Type Safety:'''

Members list

Type members

Classlikes

object BlueprintDsl

High-level DSL for mounting blueprints at specific paths.

High-level DSL for mounting blueprints at specific paths.

Provides convenient methods for mounting module blueprints and composed blueprints at paths, with automatic evidence requirements:

Single-name mounting:

Multi-segment path mounting:

All methods require evidence that:

Attributes

See also
Example
 import org.sigilaris.core.assembly.BlueprintDsl.*
val module = mount("accounts" -> accountsBlueprint) val composed =
mountComposed("app" -> composedBlueprint) 
Source
BlueprintDsl.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object EntrySyntax

String interpolator helpers for declaring org.sigilaris.core.application.state.Entry values.

String interpolator helpers for declaring org.sigilaris.core.application.state.Entry values.

Provides the entry interpolator for creating Entry instances with compile-time string literal extraction:

val usersEntry = entry"users"[String, User]
// Equivalent to: Entry["users", String, User]

The interpolator ensures the table name is a literal string (not an expression), preserving type-level information for schema validation.

Attributes

See also
Source
EntrySyntax.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Utility for validating prefix-free properties of encoded table prefixes.

Utility for validating prefix-free properties of encoded table prefixes.

Prefix-free requirement (from ADR-0009):

  • All table prefixes must be distinct (no two tables share the same prefix)
  • No prefix may be a prefix of another (strict prefix-free property)

This validator operates at the byte level after encoding with length-prefix format: length(segment_bytes) ++ segment_bytes ++ 0x00

Attributes

Source
PrefixFreeValidator.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Utilities for deriving and using schema evidence without manual summon chains.

Utilities for deriving and using schema evidence without manual summon chains.

Provides convenient methods for:

These helpers reduce boilerplate when working with type-level schema constraints.

Attributes

See also
Source
TablesAccessOps.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Convenience extensions for deriving table providers from mounted modules.

Convenience extensions for deriving table providers from mounted modules.

These helpers bridge the gap between module mounting (which yields a org.sigilaris.core.application.module.runtime.StateModule exposing its owned tables) and downstream modules that depend on those tables via org.sigilaris.core.application.module.provider.TablesProvider.

They simply forward to TablesProvider.fromModule, but live in the assembly package so that higher level assembly DSLs can import a single package and gain access to the standard helpers.

Attributes

See also
Source
TablesProviderOps.scala
Supertypes
class Object
trait Matchable
class Any
Self type