BulletsForHumanity.Hermetic 0.5.11

dotnet add package BulletsForHumanity.Hermetic --version 0.5.11
                    
NuGet\Install-Package BulletsForHumanity.Hermetic -Version 0.5.11
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BulletsForHumanity.Hermetic" Version="0.5.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BulletsForHumanity.Hermetic" Version="0.5.11" />
                    
Directory.Packages.props
<PackageReference Include="BulletsForHumanity.Hermetic" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BulletsForHumanity.Hermetic --version 0.5.11
                    
#r "nuget: BulletsForHumanity.Hermetic, 0.5.11"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BulletsForHumanity.Hermetic@0.5.11
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BulletsForHumanity.Hermetic&version=0.5.11
                    
Install as a Cake Addin
#tool nuget:?package=BulletsForHumanity.Hermetic&version=0.5.11
                    
Install as a Cake Tool

Hermetic

A domain-driven development kit for event-sourced .NET applications, built fully around source generation.

You declare commands, events, aggregates, and reactions. Hermetic generates the endpoints, the registrations, the projections, the typed Refit clients, and the SignalR observation hub. Compile-time analyzers verify every connection — every event has a handler, every reaction declares its commands, every cycle is detected.

[RaisesEvent<CadetEnrolled>]
public sealed record EnrolCadet(AcademyId AcademyId, CallSign CallSign) : ICommandLaw
{
    public sealed class Handler : CommandHandler<EnrolCadet>
    {
        public override async IAsyncEnumerable<IEffectLaw> Handle(
            EnrolCadet cmd, [EnumeratorCancellation] CancellationToken ct)
        {
            var cadetId = new CadetId(cmd.AcademyId, cmd.CallSign);
            yield return new AppendChronicleEffect(
                cmd.AcademyId.Value,
                new CadetEnrolled(cadetId, cmd.CallSign));
            await Task.CompletedTask;
        }
    }
}

That declaration alone produces:

  • A POST /api/command/enrol-cadet endpoint with FluentValidation, [Requires<>] aggregate loading, event-contract verification, transactional save, and projection / reaction fanout.
  • A typed Refit extension method on every interface marked [CommandApiSeal<…>].
  • A bus dispatch arm so reactions can issue this command without HTTP.
  • An OpenAPI schema entry with the command's events documented.

No reflection, fully trimmable, AOT-compatible.


Why Hermetic

Problem Hermetic
Event/handler drift over time Compile-time bidirectional contract — every event has an applier, every command declares its events
Direct event-store writes from anywhere Sealed Chronicle invariant — analyzer forbids session.Events.Append outside generated code
Hand-maintained client code that drifts from the server Typed Refit extensions generated from the same declarations as endpoints
Reactions that spawn aggregates by bypassing the pipeline Three reaction shapes (terminal / command / router); commands cascade through one shared pipeline
Untyped identifiers, GUID foreign keys, manual joins Hierarchical keys — typed paths that encode the full ancestor chain
Polling for read-model updates SignalR observation — projections push to subscribed clients in real time

Install

dotnet add package BulletsForHumanity.Hermetic

Hermetic ships the runtime contracts together with the analyzers and generators. There is no separate "Logos" package to install.

For domains that need EF Core value converters or Refit extensions, also add:

dotnet add package Marten                       # the standard event-store backend
dotnet add package Refit                        # for typed client surfaces
dotnet add package Microsoft.AspNetCore.SignalR.Client  # for real-time observation (clients only)

Quick start

The Your First Aggregate guide walks through a complete minimal application in under 15 minutes. It uses the Starwatch Academy domain — a fictional superhero training institution — that all the documentation builds on.

After the first guide:


Documentation

Section What you'll find
Concepts What each Hermetic concept is, why it exists, how to use it
Reference Exhaustive lookups — every attribute, generator, and diagnostic
Guides Step-by-step tutorials building the Starwatch Academy
Design Rationale, philosophy, and open questions

Technical properties

Property Detail
Framework .NET 10 (net10.0); analyzer payload targets netstandard2.0 per Roslyn requirement
Backend Marten (default); EF Core backend in design
Reflection Zero — generated code uses no reflection at runtime
Trim / AOT Fully trimmable, AOT-compatible
Telemetry Built-in HermeticTelemetryScope wraps every endpoint, query, and Refit call
Test framework xUnit v3 + Shouldly + Bogus
License BSL 1.1

Status

Hermetic is actively developed alongside an application that uses every concept here. Public surface is intentionally narrow; deep changes (analyzer additions, new sigils) ship behind major version bumps. See version.json for the current release and CHANGELOG for what's shipped.


Contributing

See CONTRIBUTING.md. The project follows Conventional Commits; a commit-msg hook in .githooks/ validates the format. Set it up with:

git config core.hooksPath .githooks

License

Business Source License 1.1. Free to use, view, modify, and run. Production use of competing services is restricted; see the license for details.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.11 114 7/7/2026
0.5.7 115 7/5/2026
0.5.5 103 7/5/2026
0.5.4 111 6/14/2026
0.5.2 115 4/11/2026
0.5.1 138 4/10/2026
0.4.4 136 4/6/2026
0.4.3 112 4/6/2026
0.4.1 115 4/6/2026