Skip to content

chore(filetypedetection): netstandard2-kompatibilitaet und provider-struktur#83

Merged
tomtastisch merged 15 commits intomainfrom
codex/chore/netstandard2-compat-structure
Feb 17, 2026
Merged

chore(filetypedetection): netstandard2-kompatibilitaet und provider-struktur#83
tomtastisch merged 15 commits intomainfrom
codex/chore/netstandard2-compat-structure

Conversation

@tomtastisch
Copy link
Owner

@tomtastisch tomtastisch commented Feb 17, 2026

Ziel & Scope

Diese PR liefert die produktionsreife Abwärtskompatibilität für .NET Framework 4.8 über netstandard2.0 im Paket Tomtastisch.FileClassifier und kapselt TFM-sensitive Hashing-Operationen deterministisch per compile-time Provider-Modell.

In Scope:

  • Multi-Targeting auf netstandard2.0;net8.0;net10.0
  • compile-time Provider-Selektion via MSBuild (kein Runtime-Switching)
  • Refactor von Hashing-Primitiven hinter interne Abstraktionen
  • Policy-konforme Evidence-/Audit-Dokumentation
  • Versionierungsanpassung auf 5.2.0 inkl. Konvergenz

Out of Scope:

  • keine Public-API-Breaks
  • keine Feature-Erweiterung außerhalb des Kompatibilitätsziels
  • keine Änderung an SECURITY.md

Umgesetzte Aufgaben (abhaken)

  • Policy-Pre-Read durchgeführt und Snapshot erstellt (docs/audit/compat/001_NETSTANDARD2_POLICY_SNAPSHOT.MD)
  • Ist-Inventur erstellt (docs/audit/compat/002_NETSTANDARD2_INVENTORY.MD)
  • FileTypeDetectionLib auf netstandard2.0;net8.0;net10.0 umgestellt
  • FrameworkReference Microsoft.AspNetCore.App aus dem Library-Projekt entfernt
  • Logging-Dependency auf Microsoft.Extensions.Logging.Abstractions umgestellt
  • Provider-Struktur + MSBuild Conditional Include umgesetzt
  • Interne Abstraktionen eingeführt (IHexCodec, ISha256Primitives, IFastHash64, IHashPrimitives)
  • Composition Root HashPrimitives.Current eingeführt
  • netstandard2.0-Provider implementiert (SHA256.Create, deterministisches lower-hex, XxHash3)
  • net8/net10-Provider implementiert (SHA256.HashData, Convert.ToHexString(...).ToLowerInvariant(), XxHash3)
  • EvidenceHashing minimal-invasiv auf Provider-Abstraktionen refaktoriert
  • Tests ergänzt (Provider-Marker/Composition) und bestehende Tests erfolgreich ausgeführt
  • Evidence-Report erstellt (docs/audit/compat/003_NETSTANDARD2_COMPAT_EVIDENCE.MD)
  • Versionierungs-Konvergenz auf 5.2.0 hergestellt

Nachbesserungen aus Review (iterativ)

  • Policy-Compliance korrigiert: echte Umlaute statt Umschreibungen in neuen src/FileTypeDetection/*-Dokumentationen
  • Fehlende Type-Doku (summary + remarks) in neuen internen Typen ergänzt
  • Nachbesserungen mit Build/Test/Doc-Gates erneut verifiziert

Security- und Merge-Gates

  • Keine Änderung an SECURITY.md
  • Fail-closed-Verhalten in Dateiverarbeitung/Archivpfaden unverändert
  • Core enthält keine direkten verbotenen TFM-APIs (grep-proof im Evidence-Report)
  • security/code-scanning/tools: Zielzustand 0 offene Alerts vor Merge
  • Merge nur bei grünen Required Checks und ohne offene Review-Threads

Evidence (auditierbar)

Ausgeführt (Exit-Code jeweils 0):

  • dotnet --info
  • dotnet restore FileClassifier.sln -v minimal
  • dotnet restore --locked-mode FileClassifier.sln -v minimal
  • dotnet build FileClassifier.sln -c Release --no-restore -warnaserror -v minimal
  • dotnet test tests/FileTypeDetectionLib.Tests/FileTypeDetectionLib.Tests.csproj -c Release --no-build -v minimal
  • dotnet test tests/FileTypeDetectionLib.Tests/FileTypeDetectionLib.Tests.csproj -c Release --no-build --filter "Category=ApiContract" -v minimal
  • dotnet pack src/FileTypeDetection/FileTypeDetectionLib.vbproj -c Release --no-build -o artifacts/ci/netstandard2-compat/nuget -v minimal
  • python3 tools/check-doc-consistency.py
  • python3 tools/check-docs.py
  • bash tools/ci/bin/run.sh versioning-svt
  • bash tools/ci/bin/run.sh version-convergence
  • bash tools/ci/bin/run.sh security-nuget

Artefakte:

  • docs/audit/compat/001_NETSTANDARD2_POLICY_SNAPSHOT.MD
  • docs/audit/compat/002_NETSTANDARD2_INVENTORY.MD
  • docs/audit/compat/003_NETSTANDARD2_COMPAT_EVIDENCE.MD
  • artifacts/ci/netstandard2-compat/build-netstandard2.0.log
  • artifacts/ci/netstandard2-compat/build-net8.0.log
  • artifacts/ci/netstandard2-compat/build-net10.0.log

DoD (mindestens 2 pro Punkt)

Punkt DoD A DoD B
Multi-Targeting + netstandard2.0-Kompatibilität src/FileTypeDetection/FileTypeDetectionLib.vbproj enthält netstandard2.0;net8.0;net10.0 dotnet pack-Output enthält lib/netstandard2.0, lib/net8.0, lib/net10.0
Compile-time Provider-Selektion .vbproj nutzt Compile Remove="Providers/**/*.vb" + bedingte Includes diag-Build-Logs zeigen je TFM exakt ein Provider-Set
Core-Entkopplung von TFM-APIs EvidenceHashing delegiert an HashPrimitives.Current grep-proof: kein `Convert.ToHexString
Policy-Konformität Codequalität neue interne Typen mit Type-Doku (summary + remarks) Umlaut-Regel in neuen src/FileTypeDetection/*-Dateien eingehalten
Versionierungs-/Release-Konvergenz RepoVersion, Version, PackageVersion auf 5.2.0 gesetzt Top-Eintrag in docs/versioning/002_HISTORY_VERSIONS.MD auf 5.2.0

github-actions bot and others added 13 commits February 16, 2026 21:54
… 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>
Copilot AI review requested due to automatic review settings February 17, 2026 07:12
@github-actions github-actions bot added area:docs area:versioning impl:security area:tests feature New compatible feature or datatype impl:config versioning:minor New compatible functionality; requires MINOR bump and removed impl:security area:tests labels Feb 17, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.0 to netstandard2.0;net8.0;net10.0 with conditional provider compilation
  • TFM-sensitive hashing primitives abstracted behind IHashPrimitives, IHexCodec, ISha256Primitives, and IFastHash64 interfaces
  • Dependency change from Microsoft.AspNetCore.App FrameworkReference to Microsoft.Extensions.Logging.Abstractions package 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

@tomtastisch tomtastisch added the release:rc Release candidate marker (informational only) label Feb 17, 2026
@tomtastisch tomtastisch enabled auto-merge (squash) February 17, 2026 07:27
@tomtastisch tomtastisch merged commit 8d65a52 into main Feb 17, 2026
26 checks passed
@tomtastisch tomtastisch deleted the codex/chore/netstandard2-compat-structure branch February 17, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs area:versioning feature New compatible feature or datatype impl:config release:rc Release candidate marker (informational only) versioning:minor New compatible functionality; requires MINOR bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant