Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AGENTS.md

.NET monorepo (SDK pinned to `10.0.201` in `global.json`, plus `"test": { "runner": "Microsoft.Testing.Platform" }`) of independently published NuGet libraries (`src/Core.*` → package IDs `CoreSystem.*`). Everything targets `net8.0` except `Core.Correlation`, `Core.Memory` and `Core.Redis`, which are multi-targeted (`net8.0;net9.0;net10.0`). The root `README.md` lists the current packages; Cache and Idempotency were split out — they remain part of the ecosystem but have their own repositories and docs are external, see `docs/External`. Do not propose re-creating or re-adding them as packages in this repo. Use `dotnet sln list` / `src/` as the source of truth.
.NET monorepo (SDK pinned to `10.0.201` in `global.json`, plus `"test": { "runner": "Microsoft.Testing.Platform" }`) of independently published NuGet libraries (`src/Core.*` → package IDs `CoreSystem.*`). Everything targets `net8.0` except `Core.Correlation`, `Core.Memory`, `Core.Redis` and `Core.Observability.Abstractions`, which are multi-targeted (`net8.0;net9.0;net10.0`). The root `README.md` lists the current packages; Cache and Idempotency were split out — they remain part of the ecosystem but have their own repositories and docs are external, see `docs/External`. Do not propose re-creating or re-adding them as packages in this repo. Use `dotnet sln list` / `src/` as the source of truth.

## Layout
- `src/Core.<Name>`: one NuGet package per project. `GeneratePackageOnBuild=true`, so every build also produces a `.nupkg`.
Expand All @@ -10,7 +10,7 @@

## Dependencies / restore (common pitfall)
- Package versions are managed centrally in `Directory.Packages.props`. Do not put `Version=` on `PackageReference`.
- Packages that must match a TFM are pinned with conditional `<ItemGroup Condition="'$(TargetFramework)' == 'netX.0'">` blocks in `Directory.Packages.props` (`Microsoft.AspNetCore.TestHost`, `Microsoft.Extensions.DependencyInjection(.Abstractions)`). Single-TFM net8.0 projects only see the net8.0 group, so they are unaffected. CPM permits one `PackageVersion` per id, so a new TFM needs its own conditional group.
- Packages that must match a TFM are pinned with conditional `<ItemGroup Condition="'$(TargetFramework)' == 'netX.0'">` blocks in `Directory.Packages.props` (`Microsoft.AspNetCore.TestHost`, `Microsoft.Extensions.Configuration(.Abstractions)`, `Microsoft.Extensions.DependencyInjection(.Abstractions)`, `Microsoft.Extensions.Diagnostics.HealthChecks`, `Microsoft.Extensions.Options`). Single-TFM net8.0 projects only see the net8.0 group, so they are unaffected. CPM permits one `PackageVersion` per id, so a new TFM needs its own conditional group.
- `Directory.Build.props` turns on `RestoreLockedMode`, and `packages.lock.json` files are committed. After adding, removing, or changing a package, run `dotnet restore CoreSystem.sln --use-lock-file --force-evaluate` and commit the updated lock files. Otherwise restore fails.
- Most libraries reference each other as **NuGet packages**, not project references. For example, `Core.Resilience` and `Core.RateLimiting` use `PackageReference CoreSystem.Observability.Abstractions`, so local Abstractions changes do not reach them until that package is published and the central version is bumped.
- Exception: `Core.Observability` can use a `ProjectReference` to Abstractions by passing `-p:UseLocalObservabilityAbstractions=true` (defaults to false, i.e. the published NuGet package).
Expand Down
21 changes: 16 additions & 5 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@
<PackageVersion Include="StackExchange.Redis" Version="2.13.17" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="8.0.32" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="OpenTelemetry" Version="1.20.0" />
<PackageVersion Include="OpenTelemetry.Api" Version="1.20.0" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.20.0" />
Expand Down Expand Up @@ -55,20 +51,35 @@
Each version must match the servicing patch of that TFM's runtime.
Microsoft.Extensions.DependencyInjection(.Abstractions) is out-of-band (not framework-provided),
but is aligned per TFM so every asset of a multi-targeted package declares a dependency in its
own runtime band. Single-TFM net8.0 projects only see the net8.0 group, so nothing else moves. -->
own runtime band. Configuration(.Abstractions), Diagnostics.HealthChecks and Options are
framework-provided and must follow the TFM servicing patch, otherwise the per-TFM HealthChecks
floor forces NU1109 (downgrade) against the single unconditional pin.
Single-TFM net8.0 projects only see the net8.0 group, so nothing else moves. -->
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.32" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="8.0.32" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="9.0.21" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="9.0.21" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.21" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.21" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.21" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="9.0.21" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.21" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="10.0.13" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.13" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.13" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.13" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.13" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="10.0.13" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="10.0.13" />
</ItemGroup>
</Project>
12 changes: 10 additions & 2 deletions MEMORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@ Facts and current repo state NOT covered by AGENTS.md. Read this after AGENTS.md
- Its net8.0 lock section lost several framework-provided transitives (`System.Diagnostics.DiagnosticSource` 5.0.0, `System.IO.Pipelines` 8.0.0, `System.Security.Principal.Windows` 5.0.0) — SDK 10 pruning, expected.
- Verified: 3-TFM build 0 warnings, Redis **14/14 per TFM**, format clean, nupkg `CoreSystem.Redis 1.1.0` with `lib/net8.0|net9.0|net10.0`; reflected public API identical across TFMs.

## Current state (Oct 2026 — Memory/Redis multi-targeting in review)
## Multi-targeting: Core.Observability.Abstractions (follows the same pattern, Oct 2026)

- **Published** (NuGet.org + GitHub Packages), verified against the NuGet flat-container API — not just tags, since a tag alone does not prove the push succeeded: Http 1.1.0, Http.ProblemDetails 1.0.2, Memory 1.0.3, Redis **1.0.4**, Observability **1.0.3**, Observability.Abstractions 1.0.2, RateLimiting **1.2.3**, Resilience **2.0.3**, Serialization **1.2.4**, Correlation 1.0.0. **Three releases are pending**: `CoreSystem.Correlation` 1.1.0, `CoreSystem.Memory` 1.1.0 and `CoreSystem.Redis` 1.1.0 are bumped in their csprojs and await their tags.
- `src/Core.Observability.Abstractions` + `tests/Core.Observability.Abstractions.UnitTests` now target `net8.0;net9.0;net10.0`, same `<TargetFramework />` clearing trick. Version bumped to **1.1.0** (new TFM assets, public API unchanged) in all four csproj properties; nothing tagged or published yet — the tag will be `Core.Observability.Abstractions/v1.1.0`.
- **The NU1109 trap**: `Microsoft.Extensions.Diagnostics.HealthChecks` had to be pinned per TFM, and it transitively requires `Microsoft.Extensions.Configuration.Abstractions >=` its own TFM version (`HealthChecks -> Hosting.Abstractions -> Configuration.Abstractions`). The single unconditional 8.0.0 pin for `Configuration.Abstractions` therefore forced a downgrade. `Configuration(.Abstractions)`, `Diagnostics.HealthChecks` and `Options` are now all per-TFM. Any framework-provided package pulled in by a per-TFM pin must itself be pinned per TFM.
- Verified: 3-TFM build 0 warnings, Abstractions tests **3/3 per TFM**, solution **270/270**, format clean, nupkg `CoreSystem.Observability.Abstractions 1.1.0` with `lib/net8.0|net9.0|net10.0`; reflected public API identical across TFMs.
- The central `CoreSystem.Observability.Abstractions` pin in `Directory.Packages.props` stays at **1.0.2** on purpose: `Resilience`, `RateLimiting` and `Observability` consume the *published* package, and bumping the pin to the unpublished 1.1.0 would break `RestoreLockedMode`. Bump it only after the tag, and republish those three if the floor should move.

## Current state (Oct 2026 — Abstractions multi-targeting in review)

- **Published** (NuGet.org + GitHub Packages), verified against the NuGet flat-container API — not just tags, since a tag alone does not prove the push succeeded: Http 1.1.0, Http.ProblemDetails 1.0.2, Memory 1.0.3, Redis **1.0.4**, Observability **1.0.3**, Observability.Abstractions 1.0.2, RateLimiting **1.2.3**, Resilience **2.0.3**, Serialization **1.2.4**, Correlation 1.0.0. **Four releases are pending**: `CoreSystem.Correlation` 1.1.0, `CoreSystem.Memory` 1.1.0, `CoreSystem.Redis` 1.1.0 and `CoreSystem.Observability.Abstractions` 1.1.0 are bumped in their csprojs and await their tags.
- ~~Staged but NOT yet published: Core.RateLimiting 1.2.3~~ — shipped.
- The full solution now audits **zero vulnerable packages** (was: MessagePack 3.1.8 Moderate GHSA-qhrr-8q5h-9q3h, cleared by 3.1.12).
- Every `src/Core.*` project has exactly one `README.md` (packed via `PackageReadmeFile`). The `README_NUGET.md` convention is gone — do not reintroduce it.
Expand Down Expand Up @@ -83,6 +90,7 @@ Facts and current repo state NOT covered by AGENTS.md. Read this after AGENTS.md
- **Vulnerable transitives are fixed with a central pin, not by upgrading the parent.** `System.Security.Cryptography.Pkcs` came in at 8.0.1 via `Microsoft.Data.SqlClient`, which still asks for exactly `8.0.1` even at 7.1.1 — so bumping SqlClient cannot fix it. Fix = add `<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="8.0.2" />` to `Directory.Packages.props`; CPM turns it into a `CentralTransitive` pin that overrides the parent. This is the intended use of `CentralPackageTransitivePinningEnabled=true`. Verify with `dotnet list CoreSystem.sln package --vulnerable --include-transitive`.
- Don't trust `vulnerable_version_range` from the GitHub advisory mirror for .NET CVEs: for CVE-2026-84008 / CVE-2026-70162 it reported `>= 10.0.0, <= 10.0.12` / patched `10.0.13`, but NuGet's audit data also flagged 8.0.1 and cleared on 8.0.2. Empirically bisect instead of reasoning from the advisory.
- Resolving a dependency **to the latest published** version and calling it done is not enough for the three packages that consume `CoreSystem.Observability.Abstractions`. NuGet pins to the *declared floor*, so a consumer of `Resilience 2.0.3` still lands on `Abstractions 1.0.1` unless the central pin was bumped **before** the tag was pushed. This is exactly what produced the 1.0.2 / 1.2.2 / 2.0.2 "package-only fix" releases. Always check the release order, and never bump a central pin to a version that is not yet on NuGet — `RestoreLockedMode` will fail the whole solution.
- **Per-TFM pins drag their framework-provided transitives along.** Pinning `Microsoft.Extensions.Diagnostics.HealthChecks` per TFM forces `Microsoft.Extensions.Configuration.Abstractions` to be per TFM as well (`HealthChecks -> Hosting.Abstractions -> Configuration.Abstractions`), otherwise the single unconditional 8.0.0 pin is a downgrade (NU1109). Same for `Options`. Check that no framework-provided pin is left unconditional when its consumer moves to per-TFM groups.
- `PackageReference` is the contract for cross-package dependencies in `src/`. Swapping one for an unconditional `ProjectReference` to make local builds convenient is not a local-only change: it deletes the package dependency from the nuspec, lets local edits leak into unrelated packages, and defeats the point of the NuGet-monorepo layout. Use `-p:UseLocalObservabilityAbstractions=true` or a gitignored `Directory.Build.local.props` instead.
- `src/Core.Observability/Core.Observability.csproj` declares the Abstractions `ProjectReference` inside a `Condition`, so a careless edit can produce two `ProjectReference` items for the same path. NuGet rejects the duplicate and the nupkg loses its dependency.
- **A `<Version>` in a csproj is a claim on a version number, whether or not it was ever tagged.** Check for a pending bump before choosing the next version: `git tag --list 'Core.RateLimiting/*'` plus the NuGet flat-container index. PR #56 staged RateLimiting 1.2.3 four days before this branch was cut, and rebasing produced a real conflict on `PackageReleaseNotes` because both branches independently wrote a `1.2.3:` line.
Expand Down
2 changes: 1 addition & 1 deletion docs/Observability/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
CoreSystem.Observability configures structured logs, distributed traces,
metrics, and health-check endpoints from a single integration point. Telemetry
is exported through OTLP/gRPC, while other CoreSystem modules can contribute
their own metrics, activity sources, and health checks.
their own activity sources and health checks.

![NuGet](https://img.shields.io/nuget/v/CoreSystem.Observability?style=for-the-badge)
![.NET](https://img.shields.io/badge/.NET-8.0-blue?style=for-the-badge)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<!-- Multi-targeting: net9.0/net10.0 assets are built from the same source as net8.0. -->
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<!-- Clears the net8.0 default from Directory.Build.props; without it TargetFramework is non-empty and the SDK skips the cross-targeting (outer) build. -->
<TargetFramework />
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>CoreSystem.Observability.Abstractions</PackageId>
<Version>1.0.2</Version>
<AssemblyVersion>1.0.2.0</AssemblyVersion>
<FileVersion>1.0.2.0</FileVersion>
<InformationalVersion>1.0.2</InformationalVersion>
<Version>1.1.0</Version>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<FileVersion>1.1.0.0</FileVersion>
<InformationalVersion>1.1.0</InformationalVersion>
<Authors>Federin Pastor Gutierrez Ortiz</Authors>
<Description>Base contracts for the CoreSystem modular observability system.</Description>
<PackageReleaseNotes>
1.0.2: Dependency refresh. Microsoft.Extensions.Diagnostics.HealthChecks 8.0.28 to 8.0.32. No code or API changes.
1.1.0: targets net8.0, net9.0 and net10.0. No public API or behavior change; the net9.0 and net10.0 assets are new, and the net8.0 asset is unchanged. Microsoft.Extensions.Configuration(.Abstractions), Diagnostics.HealthChecks and Options are declared per TFM (8.0.x / 9.0.21 / 10.0.13).
</PackageReleaseNotes>
<RepositoryUrl>https://github.com/FEDERIN/CoreSystem</RepositoryUrl>
<PackageProjectUrl>https://github.com/FEDERIN/CoreSystem/tree/main/src/Core.Observability.Abstractions</PackageProjectUrl>
Expand Down
Loading
Loading