chore(filetypedetection): netstandard2-kompatibilitaet und provider-struktur#83
Merged
tomtastisch merged 15 commits intomainfrom Feb 17, 2026
Merged
Conversation
… align variable names with code-quality policies
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Tomtastisch <82227609+tomtastisch@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Tomtastisch <82227609+tomtastisch@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Tomtastisch <82227609+tomtastisch@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces .NET Framework 4.8 backward compatibility by targeting netstandard2.0, while maintaining support for net8.0 and net10.0. The PR implements a compile-time provider pattern to abstract TFM-specific hashing APIs (SHA256, hex encoding, and FastHash64) behind internal interfaces, eliminating runtime branching while preserving deterministic behavior across all target frameworks.
Changes:
- Multi-targeting expanded from
net8.0;net10.0tonetstandard2.0;net8.0;net10.0with conditional provider compilation - TFM-sensitive hashing primitives abstracted behind
IHashPrimitives,IHexCodec,ISha256Primitives, andIFastHash64interfaces - Dependency change from
Microsoft.AspNetCore.AppFrameworkReference toMicrosoft.Extensions.Logging.Abstractionspackage reference for broader compatibility - Version bump to 5.2.0 with corresponding documentation and history updates
- Bug fix: removed unused variable in FileMaterializer that was causing incorrect error logging
Reviewed changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/FileTypeDetection/FileTypeDetectionLib.vbproj | Added netstandard2.0 target, conditional provider compilation, logging abstractions dependency, version 5.2.0 |
| src/FileTypeDetection/Abstractions/Providers/IHashPrimitives.vb | New internal interfaces for hash primitive abstractions |
| src/FileTypeDetection/Composition/HashPrimitives.vb | Composition root for compile-time provider selection |
| src/FileTypeDetection/Providers/NetStandard2_0/HashPrimitivesProvider.vb | netstandard2.0-compatible implementation using SHA256.Create() and nibble-based hex encoding |
| src/FileTypeDetection/Providers/Net8_0Plus/HashPrimitivesProvider.vb | net8/net10 implementation using SHA256.HashData and Convert.ToHexString |
| src/FileTypeDetection/EvidenceHashing.vb | Refactored to use provider abstractions instead of direct API calls |
| src/FileTypeDetection/FileMaterializer.vb | Fixed unused variable bug, updated Security namespace references |
| src/FileTypeDetection/Detection/FileTypeRegistry.vb | Updated Enum.GetValues for netstandard2.0 compatibility |
| src/FileTypeDetection/Infrastructure/*.vb | Added file headers, XML documentation, umlaut corrections, field name changes |
| tests/FileTypeDetectionLib.Tests/Unit/HashingEvidenceTests.cs | Added provider composition test with TFM-specific assertions |
| Directory.Build.props | Version bump to 5.2.0 |
| Directory.Packages.props | Added Microsoft.Extensions.Logging.Abstractions, System.Collections.Immutable, System.Text.Json |
| docs/versioning/*.MD | Version history updated with 5.2.0 entry |
| docs/audit/compat/*.MD | New compatibility audit documentation |
| docs/governance/045_CODE_QUALITY_POLICY_DE.MD | New comprehensive code quality policy document (760 lines) |
| docs/governance/145_CODE_QUALITY_POLICY_DE.MD | English version of code quality policy |
| docs/references/*.MD | Updated logging dependency references |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ziel & Scope
Diese PR liefert die produktionsreife Abwärtskompatibilität für
.NET Framework 4.8übernetstandard2.0im PaketTomtastisch.FileClassifierund kapselt TFM-sensitive Hashing-Operationen deterministisch per compile-time Provider-Modell.In Scope:
netstandard2.0;net8.0;net10.05.2.0inkl. KonvergenzOut of Scope:
SECURITY.mdUmgesetzte Aufgaben (abhaken)
docs/audit/compat/001_NETSTANDARD2_POLICY_SNAPSHOT.MD)docs/audit/compat/002_NETSTANDARD2_INVENTORY.MD)FileTypeDetectionLibaufnetstandard2.0;net8.0;net10.0umgestelltFrameworkReference Microsoft.AspNetCore.Appaus dem Library-Projekt entferntMicrosoft.Extensions.Logging.AbstractionsumgestelltIHexCodec,ISha256Primitives,IFastHash64,IHashPrimitives)HashPrimitives.CurrenteingeführtSHA256.Create, deterministisches lower-hex,XxHash3)SHA256.HashData,Convert.ToHexString(...).ToLowerInvariant(),XxHash3)EvidenceHashingminimal-invasiv auf Provider-Abstraktionen refaktoriertdocs/audit/compat/003_NETSTANDARD2_COMPAT_EVIDENCE.MD)5.2.0hergestelltNachbesserungen aus Review (iterativ)
src/FileTypeDetection/*-Dokumentationensummary+remarks) in neuen internen Typen ergänztSecurity- und Merge-Gates
SECURITY.mdsecurity/code-scanning/tools: Zielzustand 0 offene Alerts vor MergeEvidence (auditierbar)
Ausgeführt (Exit-Code jeweils
0):dotnet --infodotnet restore FileClassifier.sln -v minimaldotnet restore --locked-mode FileClassifier.sln -v minimaldotnet build FileClassifier.sln -c Release --no-restore -warnaserror -v minimaldotnet test tests/FileTypeDetectionLib.Tests/FileTypeDetectionLib.Tests.csproj -c Release --no-build -v minimaldotnet test tests/FileTypeDetectionLib.Tests/FileTypeDetectionLib.Tests.csproj -c Release --no-build --filter "Category=ApiContract" -v minimaldotnet pack src/FileTypeDetection/FileTypeDetectionLib.vbproj -c Release --no-build -o artifacts/ci/netstandard2-compat/nuget -v minimalpython3 tools/check-doc-consistency.pypython3 tools/check-docs.pybash tools/ci/bin/run.sh versioning-svtbash tools/ci/bin/run.sh version-convergencebash tools/ci/bin/run.sh security-nugetArtefakte:
docs/audit/compat/001_NETSTANDARD2_POLICY_SNAPSHOT.MDdocs/audit/compat/002_NETSTANDARD2_INVENTORY.MDdocs/audit/compat/003_NETSTANDARD2_COMPAT_EVIDENCE.MDartifacts/ci/netstandard2-compat/build-netstandard2.0.logartifacts/ci/netstandard2-compat/build-net8.0.logartifacts/ci/netstandard2-compat/build-net10.0.logDoD (mindestens 2 pro Punkt)
src/FileTypeDetection/FileTypeDetectionLib.vbprojenthältnetstandard2.0;net8.0;net10.0dotnet pack-Output enthältlib/netstandard2.0,lib/net8.0,lib/net10.0.vbprojnutztCompile Remove="Providers/**/*.vb"+ bedingte IncludesEvidenceHashingdelegiert anHashPrimitives.Currentsummary+remarks)src/FileTypeDetection/*-Dateien eingehaltenRepoVersion,Version,PackageVersionauf5.2.0gesetztdocs/versioning/002_HISTORY_VERSIONS.MDauf5.2.0