Muonroi.RuleEngine.Proliferation.Persistence 1.0.0-alpha.16

This is a prerelease version of Muonroi.RuleEngine.Proliferation.Persistence.
dotnet add package Muonroi.RuleEngine.Proliferation.Persistence --version 1.0.0-alpha.16
                    
NuGet\Install-Package Muonroi.RuleEngine.Proliferation.Persistence -Version 1.0.0-alpha.16
                    
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="Muonroi.RuleEngine.Proliferation.Persistence" Version="1.0.0-alpha.16" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Muonroi.RuleEngine.Proliferation.Persistence" Version="1.0.0-alpha.16" />
                    
Directory.Packages.props
<PackageReference Include="Muonroi.RuleEngine.Proliferation.Persistence" />
                    
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 Muonroi.RuleEngine.Proliferation.Persistence --version 1.0.0-alpha.16
                    
#r "nuget: Muonroi.RuleEngine.Proliferation.Persistence, 1.0.0-alpha.16"
                    
#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 Muonroi.RuleEngine.Proliferation.Persistence@1.0.0-alpha.16
                    
#: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=Muonroi.RuleEngine.Proliferation.Persistence&version=1.0.0-alpha.16&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Muonroi.RuleEngine.Proliferation.Persistence&version=1.0.0-alpha.16&prerelease
                    
Install as a Cake Tool

Muonroi.RuleEngine.Proliferation.Persistence

EF Core / PostgreSQL persistence layer for the Muonroi Rule Proliferation Engine — replaces the default in-memory store with a durable, tenant-isolated Postgres backend.

NuGet License: Apache 2.0

Muonroi.RuleEngine.Proliferation ships with an in-memory IProliferationStore that is sufficient for tests and single-node experimentation, but does not survive process restarts or support multi-tenant deployments. This package wires in a Postgres-backed implementation — PostgresProliferationStore — using Npgsql/EF Core. Scenarios, execution results, and rule-lineage trees are stored under a dedicated proliferation schema with tenant-id query filters applied automatically via Muonroi.Tenancy.Core.

Installation

dotnet add package Muonroi.RuleEngine.Proliferation.Persistence --prerelease

Quick Start

Call AddMProliferationPostgres after AddMProliferation (or any other proliferation setup that registers IProliferationStore). The extension removes the in-memory store and substitutes the Postgres implementation.

builder.Services
    .AddMProliferation()                            // from Muonroi.RuleEngine.Proliferation
    .AddMProliferationPostgres(                     // from this package
        builder.Configuration.GetConnectionString("Proliferation")!);

Apply EF Core migrations before first use:

dotnet ef migrations add InitProliferation \
  --project src/Muonroi.RuleEngine.Proliferation.Persistence \
  --startup-project src/YourHost

dotnet ef database update \
  --project src/Muonroi.RuleEngine.Proliferation.Persistence \
  --startup-project src/YourHost

Features

  • One-call registrationAddMProliferationPostgres(connectionString) removes the in-memory store and registers PostgresProliferationStore as scoped.
  • Three-table schemaproliferation.neuron_scenarios, proliferation.scenario_results, and proliferation.rule_lineages with jsonb columns for input/output facts and rule-flow graphs.
  • Tenant isolationNeuronScenarioEntity carries a TenantId column; ProliferationDbContext.OnModelCreating applies a global EF Core query filter using TenantContext.CurrentTenantId from Muonroi.Tenancy.Core.
  • Full IProliferationStore coverage — saves scenarios and results, queries pending scenarios, filters by seed-rule code, retrieves lineage trees, and aggregates ProliferationStats.
  • Postgres-native typesjsonb for facts and flow graphs; status and type enums stored as int; indexes on seed_rule_code, status, and tenant_id.
  • Upsert for resultsSaveResultAsync checks for an existing ScenarioResultEntity by ScenarioId and updates in place, preventing duplicate rows.

Configuration

No options class is required. Pass the Npgsql connection string directly:

builder.Services.AddMProliferationPostgres(
    "Host=localhost;Port=5432;Database=muonroi;Username=app;Password=secret");

ProliferationDbContext is registered as a standard EF Core DbContext and participates in the normal IDesignTimeDbContextFactory / dotnet ef tooling.

appsettings.json example

{
  "ConnectionStrings": {
    "Proliferation": "Host=localhost;Port=5432;Database=muonroi;Username=app;Password=secret"
  }
}

API Reference

Type Purpose
ProliferationPersistenceExtensions.AddMProliferationPostgres DI extension — registers ProliferationDbContext and replaces IProliferationStore with PostgresProliferationStore.
PostgresProliferationStore Scoped IProliferationStore implementation backed by Npgsql/EF Core.
ProliferationDbContext DbContext owning the three persistence tables under the proliferation schema.
NeuronScenarioEntity Row type for proliferation.neuron_scenarios; carries TenantId for RLS-style filtering.
ScenarioResultEntity Row type for proliferation.scenario_results; stores output facts and errors as jsonb.
RuleLineageEntity Row type for proliferation.rule_lineages; records parent-child depth for tracing rule ancestry.

Samples

No dedicated sample exists for this package yet. See the proliferation engine's own usage in Muonroi.RuleEngine.Proliferation.

Compatibility

  • Target framework: net8.0
  • Requires: ASP.NET Core App framework reference (Microsoft.AspNetCore.App)
  • License: Apache-2.0 (OSS)

License

Apache-2.0. See LICENSE-APACHE at the repository root.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.

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
1.0.0-alpha.16 50 6/22/2026
1.0.0-alpha.15 57 5/31/2026
1.0.0-alpha.14 50 5/15/2026
1.0.0-alpha.13 56 5/2/2026
1.0.0-alpha.12 73 4/2/2026
1.0.0-alpha.11 63 4/2/2026
1.0.0-alpha.8 158 3/28/2026