First off, thank you for considering contributing to ChronoStack!
This document outlines the development workflow, architectural rules, and Pull Request (PR) process to ensure the library remains highly performant, thread-safe, and resilient.
Because ChronoStack multi-targets legacy and modern .NET, your development machine must meet the following requirements:
- Windows OS: Required to compile the
.NET Framework 4.8and4.8.1targets. - .NET 8.0 SDK: Required for the modern targets and Source Generators.
- .NET Framework 4.8 Developer Pack: Required to compile the legacy targets.
From the root directory, use the solution file to build all targets simultaneously:
dotnet build ChronoStack.sln -c Release
All PRs must pass the automated test suite. We maintain 100% architectural coverage on core engine features.
dotnet test src/ChronoStack.Tests/ChronoStack.Tests.csproj
If you are adding a new feature or a new ITraceSink, you must adhere to the following rules:
ChronoStack operates on a Zero-Blocking Background Dispatcher. Sinks must never crash this thread.
- Local Sinks (Disk, OS, Memory): Must wrap their I/O logic in a
try/catchblock and gracefully degrade. - Network Sinks (HTTP, SQL, TCP): Must NOT use a
try/catchblock. They must allow timeout exceptions to bubble up so theCircuitBreakerSinkcan trip and protect the application from thread exhaustion.
ChronoStack is 100% Native AOT compatible.
- Do not introduce
Newtonsoft.Jsonor Reflection-based serialization into the modern.NET CoreAppexecution paths. - Always use
JsonSerializerShim.SerializeEnvelope()which utilizes our compile-time C# Source Generators (ChronoStackJsonContext).
- Branch: Create a feature branch from
main(e.g.,feature/add-redis-sink). - Code: Implement your feature or bug fix.
- Test: Add an xUnit test to
TracerTests.csusing theInMemorySinkto mathematically prove your logic works. - Submit: Open a PR. The automated CI/CD pipeline will verify that it builds across all target frameworks and passes all tests.
- Merge: Once approved, your code will be merged. The repository maintainers will tag the next release (e.g.,
v1.1.0), and MinVer will automatically publish the new.nupkg.