CerbiShield.Contracts 1.2.1

dotnet add package CerbiShield.Contracts --version 1.2.1
                    
NuGet\Install-Package CerbiShield.Contracts -Version 1.2.1
                    
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="CerbiShield.Contracts" Version="1.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CerbiShield.Contracts" Version="1.2.1" />
                    
Directory.Packages.props
<PackageReference Include="CerbiShield.Contracts" />
                    
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 CerbiShield.Contracts --version 1.2.1
                    
#r "nuget: CerbiShield.Contracts, 1.2.1"
                    
#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 CerbiShield.Contracts@1.2.1
                    
#: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=CerbiShield.Contracts&version=1.2.1
                    
Install as a Cake Addin
#tool nuget:?package=CerbiShield.Contracts&version=1.2.1
                    
Install as a Cake Tool

CerbiShield.Contracts

Shared message contracts for the CerbiShield ecosystem — the single source of truth for DTOs exchanged between all CerbiShield microservices.

NuGet

Installation

dotnet add package CerbiShield.Contracts

Version 1.2.0 (Current)

Rule → App → Violation Linkage

ViolationDto now carries full context so downstream consumers (dashboards, analytics, reports) can trace every violation back to the exact rule, profile, and app that produced it.

New Property Type Purpose
Description string? Human-readable rule description from the profile's FieldDescriptions. Tells the user why the rule exists and how to fix it.
ProfileName string? The governance profile name that produced the violation (e.g., "Orders").
AppName string? The app scope that owns the profile (e.g., "OrderService").
Composite RuleId Format

The RuleId field now supports a stable composite format:

{profile}:{field}:{code}

Examples:

  • Orders:UserId:Missing — Required field UserId is missing in the Orders profile
  • Payments:creditCardPlain:Forbidden — Forbidden field detected
  • Analytics:sessionId:InvalidType — Type mismatch on sessionId

This composite key enables the Violation Explorer dashboard to group, filter, and drill into violations by rule, field, profile, and app.

Backward-Compatible Schema Validation

ScoringEventValidator now accepts any schema version between 1.0 and 1.2 (inclusive), so existing producers sending 1.0 or 1.1 events are not rejected when consumers upgrade to this package.

Full Changelog

  • ViolationDto: added Description, ProfileName, AppName
  • ContractVersions.ScoringEventSchemaVersion: 1.11.2
  • ScoringEventValidator: range-based schema version check (1.01.2)
  • Package version: 1.1.01.2.0

Version 1.1.0

  • Added ServiceName, AppVersion, InstanceId, DeploymentId to ScoringEventDto
  • Added GovernanceConfigDto for dashboard-generated configs
  • TenantId can now come from governance config
  • SchemaVersion bumped to 1.1

Package Contents

Scoring Contracts

  • ScoringEventDto — Canonical scoring event payload (v1.1: +ServiceName, AppVersion, InstanceId, DeploymentId)
  • ScoringQueueEnvelopeDto — Queue envelope wrapper
  • ScoreBreakdownDto — Score breakdown by category (Overall, Governance, Safety)
  • ViolationDto — Governance violation details (v1.2: +Description, ProfileName, AppName)
  • GovernanceFlagsDto — Governance processing flags

Governance Contracts

  • GovernanceConfigDto — Dashboard-generated config with embedded TenantId
  • GovernanceProfileDto — Profile with rules and environment overrides
  • GovernanceRuleDto — Individual governance rule
  • EnvironmentOverrideDto — Per-environment severity adjustments

Aggregation Contracts

  • AppMetricDto — Application-level metric data points

Validation

  • ScoringEventValidator — Validates ScoringEventDto instances (schema version range, required fields, score bounds)
  • ValidationResult — Validation result record

Schema Versions

Version Status Notes
1.2 Current ViolationDto linkage fields
1.1 Supported Identity fields (AppVersion, InstanceId, DeploymentId)
1.0 Supported Initial release

Data Flow

┌──────────────────┐     ┌─────────────────────┐     ┌──────────────────────┐
│  Runtime Engine   │────▶│  Scoring Shipper     │────▶│  Scoring Aggregator  │
│  (GovernanceRT)   │     │  (Serilog/MEL/Stream)│     │  (ScoringApi)        │
└──────────────────┘     └─────────────────────┘     └──────────────────────┘
        │                         │                           │
        │  ViolationDto           │  ScoringEventDto          │  ScoringEvent
        │  .RuleId                │  .Violations[]            │  .ViolationCount
        │  .Code                  │  .AppName                 │  .GovernanceProfile
        │  .Field                 │  .GovernanceProfile       │
        │  .Description           │  .DeploymentId            │
        │  .ProfileName           │                           ▼
        │  .AppName               │               ┌──────────────────────┐
        │                         │               │  Analytics API       │
        ▼                         ▼               │  (ViolationExplorer) │
   GovernanceStore           Dashboard            └──────────────────────┘
   (Playground)

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.
  • net8.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on CerbiShield.Contracts:

Package Downloads
CerbiStream

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

Cerbi.Governance.Core

Shared governance models, validation contracts, and plugins used across CerbiStream and GovernanceAnalyzer.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.1 561 2/26/2026
1.2.0 85 2/22/2026
1.1.0 96 2/4/2026
1.0.0 96 2/3/2026

v1.2.1: Fix ContractVersions and SchemaVersion to use string types for proper version comparison.