Cerbi.Governance.Core
1.0.8
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
<PackageReference Include="Cerbi.Governance.Core" Version="1.0.8" />
<PackageVersion Include="Cerbi.Governance.Core" Version="1.0.8" />
<PackageReference Include="Cerbi.Governance.Core" />
paket add Cerbi.Governance.Core --version 1.0.8
#r "nuget: Cerbi.Governance.Core, 1.0.8"
#:package Cerbi.Governance.Core@1.0.8
#addin nuget:?package=Cerbi.Governance.Core&version=1.0.8
#tool nuget:?package=Cerbi.Governance.Core&version=1.0.8
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/andSamples/ - Core models (
LogProfile,CerbiGovernance,EncryptionSettings, enums) - Validation helpers and a runtime
IGovernanceValidatorimplementation - 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.100post-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.Testswith basic validation tests. - Static analysis: enabled .NET analyzers and
TreatWarningsAsErrorsin 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
LICENSEfile added. - Hardened config loader:
GovernanceConfigLoadernow usesSystem.Text.Json, is case-insensitive, logs via injectableLogaction, 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)
- Verify SDK selection
dotnet --info(should show .NET9 selected viaglobal.json)
- Build and test
dotnet restoredotnet build -c Releasedotnet test -c Release
- 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 testfrom 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.Jsonfully and standardize onSystem.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 | 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
- Microsoft.CodeAnalysis.CSharp (>= 4.14.0)
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 |