Thank you for contributing to Kable (High-Performance Reactive Hardware Communication Engine for .NET)!
-
Target Frameworks:
- Multi-targeting:
net10.0,net8.0, andnetstandard2.0. - Ensure all public APIs and implementations remain fully compatible across all targets.
- Multi-targeting:
-
Zero-Allocation & Performance (0-GC):
- Always prefer
System.IO.Pipelines,ReadOnlySequence<byte>, andArrayPool<byte>.Sharedover heap allocations. - Streaming ingestion must not trigger Gen2 GC collections.
- Always prefer
-
Fail-Fast Safety Policy:
- Hardware communication faults must immediately dispatch
DeviceDisconnectedException. - Never implement silent swallowed catches on critical I/O paths.
- Hardware communication faults must immediately dispatch
-
Test-Driven Development (TDD & Spec-Driven):
-
Test-First: For any new protocol codec, transport connection, or session router feature, add test cases in
tests/Kable.Tests/covering happy path, timeout edge cases, and fault injection. - Run tests before pushing:
dotnet test
-
Test-First: For any new protocol codec, transport connection, or session router feature, add test cases in
-
Code Size & Modular Isolation:
- Keep files strictly within 300~500 lines of code. Avoid monolithic classes.
- Never omit code (
// ... existing code ...or similar shortcuts are strictly prohibited). - Follow the Plan
$\rightarrow$ Review$\rightarrow$ Execute pipeline and micro-commit frequently.
We adhere to the Conventional Commits specification:
feat:New feature or protocol codecfix:Bug fix or connection recovery fixdocs:Documentation updatesrefactor:Code refactoring without behavioral changestest:Adding or updating unit/fault-injection testsperf:Performance and zero-allocation optimizations