Cerbi.Governance.Core 1.0.8

There is a newer version of this package available.
See the version list below for details.
dotnet add package Cerbi.Governance.Core --version 1.0.8
                    
NuGet\Install-Package Cerbi.Governance.Core -Version 1.0.8
                    
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="Cerbi.Governance.Core" Version="1.0.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cerbi.Governance.Core" Version="1.0.8" />
                    
Directory.Packages.props
<PackageReference Include="Cerbi.Governance.Core" />
                    
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 Cerbi.Governance.Core --version 1.0.8
                    
#r "nuget: Cerbi.Governance.Core, 1.0.8"
                    
#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 Cerbi.Governance.Core@1.0.8
                    
#: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=Cerbi.Governance.Core&version=1.0.8
                    
Install as a Cake Addin
#tool nuget:?package=Cerbi.Governance.Core&version=1.0.8
                    
Install as a Cake Tool

Cerbi.Governance.Core


Overview

Cerbi.Governance.Core provides lightweight, versioned runtime contracts and build-time types to enforce structured logging governance across the Cerbi ecosystem. It is intentionally small and dependency-light so it can be referenced from analyzers, libraries, and runtime services.

This repository contains:

  • JSON schema and sample profiles under Schema/ and Samples/
  • Core models (LogProfile, CerbiGovernance, EncryptionSettings, enums)
  • Validation helpers and a runtime IGovernanceValidator implementation
  • Plugin contract (ICustomGovernancePlugin) and a sample plugin
  • A config loader (GovernanceConfigLoader) suitable for runtime usage

SDK & Language

  • Pinned SDK: .NET9 via global.json (rollForward: latestFeature)
  • Language: C#13 centralized in Directory.Build.props
  • Nullable: enabled centrally
  • Target frameworks: unchanged (library remains net8.0) to avoid breaking consumers
  • Plan: bump SDK pin to 10.0.100 post-GA and evaluate C#14 features where beneficial

Production-readiness checklist (what I implemented)

  • CI: GitHub Actions workflow (.github/workflows/ci.yml) to restore, build, test and pack the project.
  • Tests: xUnit test project added at tests/Cerbi.Governance.Core.Tests with basic validation tests.
  • Static analysis: enabled .NET analyzers and TreatWarningsAsErrors in CI.
  • Deterministic packaging: project configured to produce deterministic packages for CI builds.
  • Secrets & scanning: Dependabot config and a Snyk-based vulnerability scan workflow were added (requires SNYK_TOKEN).
  • License: MIT LICENSE file added.
  • Hardened config loader: GovernanceConfigLoader now uses System.Text.Json, is case-insensitive, logs via injectable Log action, and avoids throwing on parse errors.

Quick start

Add package to your project (NuGet):

$ dotnet add package Cerbi.Governance.Core --version1.0.4

Add the assembly attribute to point at your governance file:

using Cerbi.Governance;

[assembly: CerbiGovernanceConfig("cerbi_governance.json")]

Use the runtime validator:

using Cerbi.Governance.Core.Validation;
using System.Text.Json;

var validator = new GovernanceValidator();
var profile = /* load Profile model from JSON */;
var json = JsonDocument.Parse(jsonString);
var result = validator.Validate(profile, json.RootElement);

If using GovernanceConfigLoader at runtime, set a custom logger to integrate with your app logging:

GovernanceConfigLoader.Log = s => logger.LogInformation(s);

🧪 Re-baseline (build, tests, benchmarks)

  1. Verify SDK selection
  • dotnet --info (should show .NET9 selected via global.json)
  1. Build and test
  • dotnet restore
  • dotnet build -c Release
  • dotnet test -c Release
  1. Benchmarks (optional)
  • scripts/bench.sh (Linux/macOS)
  • scripts/bench.ps1 (Windows)

Notes:

  • No runtime TFM changes; only toolchain/language centralization.

Contributing & development

  • Run tests: dotnet test from repository root.
  • Open a PR; CI will run builds, analyzers, and tests.
  • Add more tests: the test project uses xUnit and coverlet collector is included in the test project file.

Roadmap (suggested next steps)

  • Expand unit tests to cover GovernanceConfigLoader, GovernanceHelper, and plugin execution paths.
  • Add integration tests that exercise sample profiles in Samples/.
  • Optionally remove Newtonsoft.Json fully and standardize on System.Text.Json (done in code, package removed).
  • Add API logging using ILogger<T> where library code should integrate with host logging.

License

MIT — see LICENSE.

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 (5)

Showing the top 5 NuGet packages that depend on Cerbi.Governance.Core:

Package Downloads
CerbiStream

CerbiStream.Logging - Secure, Scalable, and Standardized Logging for Modern Applications.

Cerbi.MEL.Governance

Real-time governance enforcement for Microsoft.Extensions.Logging (MEL) using the Cerbi validation engine.

Cerbi.Governance.Runtime

Real-time governance enforcement for CerbiStream and other structured loggers.

Cerbi.Serilog.GovernanceAnalyzer

Serilog governance analyzer plugin: runtime validation, filtering, enrichment, live reload, correlation, relaxed diagnostics, and high-throughput score shipping with ArrayPool optimizations. Supports .NET 9.0+

Cerbi.Serilog.Governance

Serilog plugin that enforces Cerbi governance at runtime. Provides filtering to block non-compliant logs and enrichment to tag governance metadata.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.13 125 12/5/2025
1.0.12 170 11/24/2025
1.0.11 210 11/22/2025
1.0.10 224 11/22/2025
1.0.9 167 11/15/2025
1.0.8 181 10/30/2025
1.0.7 175 10/30/2025
1.0.6 176 10/30/2025
1.0.5 107 10/24/2025
1.0.4 114 10/24/2025
1.0.3 116 10/24/2025
1.0.2 1,650 5/19/2025
1.0.1 431 5/17/2025
1.0.0 173 5/17/2025