Muonroi.RuleEngine.Proliferation.Persistence
1.0.0-alpha.16
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
<PackageReference Include="Muonroi.RuleEngine.Proliferation.Persistence" Version="1.0.0-alpha.16" />
<PackageVersion Include="Muonroi.RuleEngine.Proliferation.Persistence" Version="1.0.0-alpha.16" />
<PackageReference Include="Muonroi.RuleEngine.Proliferation.Persistence" />
paket add Muonroi.RuleEngine.Proliferation.Persistence --version 1.0.0-alpha.16
#r "nuget: Muonroi.RuleEngine.Proliferation.Persistence, 1.0.0-alpha.16"
#:package Muonroi.RuleEngine.Proliferation.Persistence@1.0.0-alpha.16
#addin nuget:?package=Muonroi.RuleEngine.Proliferation.Persistence&version=1.0.0-alpha.16&prerelease
#tool nuget:?package=Muonroi.RuleEngine.Proliferation.Persistence&version=1.0.0-alpha.16&prerelease
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.
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 registration —
AddMProliferationPostgres(connectionString)removes the in-memory store and registersPostgresProliferationStoreas scoped. - Three-table schema —
proliferation.neuron_scenarios,proliferation.scenario_results, andproliferation.rule_lineageswithjsonbcolumns for input/output facts and rule-flow graphs. - Tenant isolation —
NeuronScenarioEntitycarries aTenantIdcolumn;ProliferationDbContext.OnModelCreatingapplies a global EF Core query filter usingTenantContext.CurrentTenantIdfromMuonroi.Tenancy.Core. - Full
IProliferationStorecoverage — saves scenarios and results, queries pending scenarios, filters by seed-rule code, retrieves lineage trees, and aggregatesProliferationStats. - Postgres-native types —
jsonbfor facts and flow graphs; status and type enums stored asint; indexes onseed_rule_code,status, andtenant_id. - Upsert for results —
SaveResultAsyncchecks for an existingScenarioResultEntitybyScenarioIdand 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)
Related Packages
Muonroi.RuleEngine.Proliferation— core proliferation engine andIProliferationStoreabstraction; required dependency.Muonroi.Tenancy.Core— providesTenantContext.CurrentTenantIdconsumed by the query filter inProliferationDbContext.
License
Apache-2.0. See LICENSE-APACHE at the repository root.
| Product | Versions 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. |
-
net8.0
- BouncyCastle.Cryptography (>= 2.6.2)
- MailKit (>= 4.17.0)
- MimeKit (>= 4.17.0)
- Muonroi.RuleEngine.Proliferation (>= 1.0.0-alpha.16)
- Muonroi.Tenancy.Core (>= 1.0.0-alpha.16)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 8.0.11)
- Scriban (>= 7.2.1)
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 |