any resulting updates to agents.md should go under the section "## Rules to follow" When you see a convincing argument from me on how to solve or do something. add a summary for this in agents.md. so you learn what I want over time. If I say any of the following point, you do this: add the context to agents.md, and associate this with a specific type of task. if I say "never do x" in some way. if I say "always do x" in some way. if I say "the process is x" in some way. If I tell you to remember something, you do the same, update
always check all test are passed.
- Prefer static interface members for result/command factories to centralize shared overloads and avoid duplication across result-like types.
- Use
DateTime.UtcNow(neverDateTimeOffset) for all timestamps; we assume every stored time is in UTC. - For
MergeAll/CombineAllscenarios with mixed failures, keep aggregated behavior and preserve original errors inProblem.Extensions(do not flatten everything into validation-only output). - In display-message APIs, use the parameter name
defaultMessage(avoid the wordfallbackin public API naming). - For user-facing helper APIs, prefer multiple ergonomic overloads (delegate + dictionary + tuple mappings) so callers can choose the most convenient style.
- Do not add redundant
result.Problem is not nullchecks afterresult.IsFailed; rely on result nullability contract/attributes and only use null-forgiving where needed. - Keep documentation aligned with the current major version (for this repository now: version 10); do not add cross-major migration sections unless explicitly requested.
- When behavior changes in Result/Problem flows, include a clear README update with concrete usage examples.
The solution ManagedCode.Communication.slnx ties together the core library (ManagedCode.Communication), ASP.NET Core adapters, Orleans integrations, performance benchmarks, and the consolidated test suite (ManagedCode.Communication.Tests). Tests mirror the runtime namespaces—look for feature-specific folders such as Results, Commands, and AspNetCore—so keep new specs alongside the code they exercise. Shared assets live at the repository root (README.md, logo.png) and are packaged automatically through Directory.Build.props.
dotnet restore ManagedCode.Communication.slnx– restore all project dependencies.dotnet build -c Release ManagedCode.Communication.slnx– compile every project with warnings treated as errors.dotnet test ManagedCode.Communication.Tests/ManagedCode.Communication.Tests.csproj– run the xUnit suite; produces*.trxlogs underManagedCode.Communication.Tests.dotnet test ManagedCode.Communication.Tests/ManagedCode.Communication.Tests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=lcov– refreshcoverage.infovia coverlet.dotnet run -c Release --project ManagedCode.Communication.Benchmark– execute benchmark scenarios before performance-sensitive changes.
Formatting is driven by the root .editorconfig: spaces only, 4-space indent for C#, CRLF endings for code, braces on new lines, and explicit types except when the type is obvious. The repo builds with C# 13, nullable reference types enabled, and analyzers elevated to errors—leave no compiler warnings behind. Stick to domain-centric names (e.g., ResultExtensionsTests) and prefer PascalCase for members and const fields per the configured naming rules.
All automated tests use xUnit with Shouldly and Microsoft test hosts; follow the existing spec style (MethodUnderTest_WithScenario_ShouldOutcome). New fixtures belong in the matching feature folder and should assert both success and failure branches for Result types. Maintain the default coverage settings supplied by coverlet.collector; update snapshots or helper helpers under TestHelpers (including shared Shouldly extensions) when shared setup changes.
Commits in this repository stay short, imperative, and often reference the related issue or PR number (e.g., Add FailBadRequest methods (#30)). Mirror that tone, limit each commit to a coherent change, and include updates to docs or benchmarks when behavior shifts. Pull requests should summarize intent, list breaking changes, attach relevant dotnet test outputs or coverage deltas, and link tracked issues. Screenshots or sample payloads are welcome for HTTP-facing work.