feat(platform): add package contract descriptors

- WHY: provide explicit package compatibility metadata for consumers
- WHAT: add common contract descriptors and module package contracts
- RULE: keep references internal to blueprint dependency boundaries
This commit is contained in:
José René White Enciso 2026-02-22 02:41:49 -06:00
parent 5e3daa4839
commit 281fdb375a
19 changed files with 198 additions and 3 deletions

View File

@ -0,0 +1,17 @@
# NuGet Publishing Map
## Package Outputs
- Core.Blueprint.Common
- Core.Blueprint.Logging
- Core.Blueprint.Mongo
- Core.Blueprint.Redis
- Core.Blueprint.SQLServer
- Core.Blueprint.Storage
- Core.Blueprint.KeyVault
## Publishing Baseline
- Publish packages independently from this repository.
- Maintain explicit package dependency on `Core.Blueprint.Common` for all feature modules.
- Keep package identifiers stable to protect downstream compatibility.

View File

@ -0,0 +1,13 @@
# Semantic Versioning Policy
## Default Policy
- Patch: backward-compatible fixes.
- Minor: backward-compatible contract additions.
- Major: breaking contract changes.
## Contract Compatibility
- Module package contracts are represented as descriptors implementing `IBlueprintPackageContract`.
- Consumer-impacting contract changes require version policy review before publish.
- Blueprint package contracts must remain identity-agnostic.

View File

@ -0,0 +1,12 @@
namespace Core.Blueprint.Common.Contracts;
/// <summary>
/// Describes package-level contract metadata for publishing and compatibility.
/// </summary>
/// <param name="PackageId">Package identifier.</param>
/// <param name="VersionPolicy">Default semantic version policy.</param>
/// <param name="DependencyPackageIds">Required package dependencies.</param>
public sealed record BlueprintPackageDescriptor(
string PackageId,
PackageVersionPolicy VersionPolicy,
IReadOnlyList<string> DependencyPackageIds);

View File

@ -0,0 +1,13 @@
namespace Core.Blueprint.Common.Contracts;
/// <summary>
/// Defines package metadata contract for Core.Blueprint.Common.
/// </summary>
public sealed class CommonPackageContract : IBlueprintPackageContract
{
/// <inheritdoc />
public BlueprintPackageDescriptor Descriptor { get; } = new(
"Core.Blueprint.Common",
PackageVersionPolicy.Minor,
[]);
}

View File

@ -0,0 +1,12 @@
namespace Core.Blueprint.Common.Contracts;
/// <summary>
/// Defines a package contract descriptor exposed for consumers and tooling.
/// </summary>
public interface IBlueprintPackageContract
{
/// <summary>
/// Gets package descriptor metadata.
/// </summary>
BlueprintPackageDescriptor Descriptor { get; }
}

View File

@ -0,0 +1,22 @@
namespace Core.Blueprint.Common.Contracts;
/// <summary>
/// Defines semantic version increment policies for package changes.
/// </summary>
public enum PackageVersionPolicy
{
/// <summary>
/// Increment patch version for backward-compatible fixes.
/// </summary>
Patch,
/// <summary>
/// Increment minor version for backward-compatible contract additions.
/// </summary>
Minor,
/// <summary>
/// Increment major version for breaking contract changes.
/// </summary>
Major
}

View File

@ -1,9 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,15 @@
using Core.Blueprint.Common.Contracts;
namespace Core.Blueprint.KeyVault.Contracts;
/// <summary>
/// Defines package metadata contract for Core.Blueprint.KeyVault.
/// </summary>
public sealed class KeyVaultPackageContract : IBlueprintPackageContract
{
/// <inheritdoc />
public BlueprintPackageDescriptor Descriptor { get; } = new(
"Core.Blueprint.KeyVault",
PackageVersionPolicy.Minor,
["Core.Blueprint.Common"]);
}

View File

@ -4,4 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Core.Blueprint.Common\Core.Blueprint.Common.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,15 @@
using Core.Blueprint.Common.Contracts;
namespace Core.Blueprint.Logging.Contracts;
/// <summary>
/// Defines package metadata contract for Core.Blueprint.Logging.
/// </summary>
public sealed class LoggingPackageContract : IBlueprintPackageContract
{
/// <inheritdoc />
public BlueprintPackageDescriptor Descriptor { get; } = new(
"Core.Blueprint.Logging",
PackageVersionPolicy.Minor,
["Core.Blueprint.Common"]);
}

View File

@ -4,4 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Core.Blueprint.Common\Core.Blueprint.Common.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,15 @@
using Core.Blueprint.Common.Contracts;
namespace Core.Blueprint.Mongo.Contracts;
/// <summary>
/// Defines package metadata contract for Core.Blueprint.Mongo.
/// </summary>
public sealed class MongoPackageContract : IBlueprintPackageContract
{
/// <inheritdoc />
public BlueprintPackageDescriptor Descriptor { get; } = new(
"Core.Blueprint.Mongo",
PackageVersionPolicy.Minor,
["Core.Blueprint.Common"]);
}

View File

@ -4,4 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Core.Blueprint.Common\Core.Blueprint.Common.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,15 @@
using Core.Blueprint.Common.Contracts;
namespace Core.Blueprint.Redis.Contracts;
/// <summary>
/// Defines package metadata contract for Core.Blueprint.Redis.
/// </summary>
public sealed class RedisPackageContract : IBlueprintPackageContract
{
/// <inheritdoc />
public BlueprintPackageDescriptor Descriptor { get; } = new(
"Core.Blueprint.Redis",
PackageVersionPolicy.Minor,
["Core.Blueprint.Common"]);
}

View File

@ -4,4 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Core.Blueprint.Common\Core.Blueprint.Common.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,15 @@
using Core.Blueprint.Common.Contracts;
namespace Core.Blueprint.SQLServer.Contracts;
/// <summary>
/// Defines package metadata contract for Core.Blueprint.SQLServer.
/// </summary>
public sealed class SqlServerPackageContract : IBlueprintPackageContract
{
/// <inheritdoc />
public BlueprintPackageDescriptor Descriptor { get; } = new(
"Core.Blueprint.SQLServer",
PackageVersionPolicy.Minor,
["Core.Blueprint.Common"]);
}

View File

@ -4,4 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Core.Blueprint.Common\Core.Blueprint.Common.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,15 @@
using Core.Blueprint.Common.Contracts;
namespace Core.Blueprint.Storage.Contracts;
/// <summary>
/// Defines package metadata contract for Core.Blueprint.Storage.
/// </summary>
public sealed class StoragePackageContract : IBlueprintPackageContract
{
/// <inheritdoc />
public BlueprintPackageDescriptor Descriptor { get; } = new(
"Core.Blueprint.Storage",
PackageVersionPolicy.Minor,
["Core.Blueprint.Common"]);
}

View File

@ -4,4 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Core.Blueprint.Common\Core.Blueprint.Common.csproj" />
</ItemGroup>
</Project>