-
Notifications
You must be signed in to change notification settings - Fork 0
refactor(filetypedetection): policy-045 strukturell und dokumentarisch durchgezogen #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tomtastisch
merged 11 commits into
main
from
codex/refactor/filetypedetection-policy-045
Feb 16, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
abd236b
refactor(filetypedetection): code-quality-policy 045 auf alle klassen…
github-actions[bot] 26e4d4a
refactor(filetypedetection): remove redundant `Global` qualifiers and…
github-actions[bot] fe746fe
ci(preflight): re-trigger with updated pr governance body
github-actions[bot] 308a57f
ci(preflight): trigger run after pr-body governance fix
github-actions[bot] 480b0cb
refactor(filetypedetection): evidencehashing whitespace policy-konfor…
github-actions[bot] cbc8294
Update src/FileTypeDetection/Infrastructure/ArchiveManagedInternals.vb
tomtastisch 077ca8b
Update src/FileTypeDetection/Infrastructure/CoreInternals.vb
tomtastisch ba98f45
Update src/FileTypeDetection/Infrastructure/ArchiveManagedInternals.vb
tomtastisch 6f8eb03
fix(filetypedetection): review-fixes fuer catch-filter und policy 045
github-actions[bot] 535dace
docs(policy): .MD konvergenz und docs-links-full fix
github-actions[bot] b24b365
docs(policy): roc-bijection mapping fuer policy 045/145
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| <!-- LANG_SWITCH:BEGIN --> | ||
| [DE](045_CODE_QUALITY_POLICY_DE.MD) | [EN](145_CODE_QUALITY_POLICY_DE.MD) | ||
| <!-- LANG_SWITCH:END --> | ||
|
|
||
| # Code Quality & Documentation Policy (EN) | ||
| Status: binding (project policy) | ||
| Scope: `src/FileTypeDetection/*` (VB.NET and C#), public API + internal implementation | ||
|
|
||
| ## 1. Purpose | ||
| This policy defines a consistent, auditable schema for: | ||
| - code structure (readability, semantics, member ordering) | ||
| - error handling (fail-closed, consistent logging) | ||
| - documentation (German for public API, complete, with real umlauts) | ||
| - reproducible Codex changes without behavioral drift | ||
|
|
||
| ## 2. Normative Orientation (DIN/ISO/IEC/IEEE) | ||
| Note: there is no single “DIN for code formatting”. This is an internal rule set aligned with established standards for information quality and software quality: | ||
| - ISO/IEC/IEEE 26514:2022-01 | ||
| - ISO/IEC 25010:2023 | ||
| - ISO/IEC/IEEE 15289:2019 | ||
| - optional: DIN EN IEC/IEEE 82079-1:2021-09 | ||
|
|
||
| ## 3. Hard Principles | ||
| - Never transliterate German umlauts: `ä ö ü Ä Ö Ü ß` (no `ae/oe/ue/ss`). | ||
| - Files remain UTF-8. | ||
| - No behavior changes through formatting/docs: | ||
| - no signature changes | ||
| - no semantic changes in exceptions/returns/side effects | ||
| - no new external dependencies | ||
|
|
||
| ## 4. Shared vs. Instance (Construction Rule) | ||
| ### 4.1 Shared (utility) is allowed only if all are true | ||
| - type is stateless | ||
| - no DI or swappable dependencies needed | ||
| - no polymorphism/test doubles via interfaces needed | ||
| - typically: `NotInheritable` + `Private Sub New()` + only shared members | ||
|
|
||
| ### 4.2 Instance/service type is mandatory if at least one applies | ||
| - dependencies should be injectable/swappable (I/O, logger, policy, clock, provider, ...) | ||
| - testability via DI/interfaces is required | ||
| - per-instance state/configuration is meaningful | ||
|
|
||
| Within style/docs-only updates, type kind must not be changed unless already clearly established as utility/service. | ||
|
|
||
| ## 5. File and Type Structure | ||
| ### 5.1 File order | ||
| 1) file header comment (policy/context block, not XML docs) | ||
| 2) `Option Strict On` / `Option Explicit On` (VB) | ||
| 3) imports | ||
| 4) namespace | ||
| 5) types | ||
|
|
||
| ### 5.2 Type layout (member order) | ||
| 1) XML docs on type (`summary` + `remarks`) | ||
| 2) constants (`Const`) / `Shared ReadOnly` | ||
| 3) fields/properties (only when type state exists) | ||
| 4) constructors | ||
| 5) public API (all public members, ordered) | ||
| 6) internal/private helpers | ||
| 7) nested types (only if needed; at end) | ||
|
|
||
| ### 5.3 Semantic blocks in methods | ||
| Use visible block separation (empty line + block comment markers): | ||
| - options/snapshot | ||
| - guard clauses (fail-closed) | ||
| - normalization/canonicalization | ||
| - branches (for example secure extraction) | ||
| - fallback | ||
| - I/O helpers separated | ||
|
|
||
| ## 6. Variable Rule | ||
| - All local variables are declared in a declaration block at the start of the function. | ||
| - Placement: | ||
| - function-local when only needed there | ||
| - class-level only when shared across members by design | ||
| - Alignment: column-style (`Dim` / name / `As` / initializer) using tabs/spaces. | ||
| - Exception: `Using`/`For` headers may contain local variables when idiomatic and more readable. | ||
|
|
||
| ## 6.1 Naming Conventions (VB.NET + C#) | ||
| - Public API is a contract and must be convention-compliant. | ||
| - No umlauts in identifiers. | ||
| - No underscores in public API names (except required interop contracts). | ||
| - Avoid unclear abbreviations in public API. | ||
| - Keep PascalCase for namespaces/types/public members. | ||
| - Parameters/locals: camelCase. | ||
| - Private fields: `_camelCase` (or existing repo SSOT if different). | ||
| - Boolean names should be positive and use `is/has/can/should` where applicable. | ||
| - `Async` suffix only for true async semantics. | ||
|
|
||
| ## 7. Exception Handling & Logging (Fail-Closed) | ||
| - Prefer catch filter form in VB: `Catch ex As Exception When TypeOf ex Is ...` | ||
| - Forbidden redundant pseudo-filter: `Catch ex As Exception When TypeOf ex Is Exception` | ||
| If all exceptions must be handled, use `Catch ex As Exception` instead. | ||
| - No unfiltered catch-all unless technically required and documented. | ||
| - No silent swallow: log (`Warn`/`Error`) and preserve prior fail-closed behavior. | ||
| - Keep log wording consistent (German with proper umlauts in this project). | ||
| - No exception semantics change (no new wrapping, no new throws). | ||
|
|
||
| ## 8. Documentation Standard (Public API) | ||
| ### 8.1 Language/characters | ||
| - German language for public API docs. | ||
| - Real umlauts, no transliteration. | ||
|
|
||
| ### 8.2 Minimum per public type/member | ||
| - Type: | ||
| - `<summary>`: 1-3 sentences (purpose/scope) | ||
| - `<remarks>`: structured sections (purpose, responsibilities, non-goals, side effects, error cases, security notes, threading if relevant) | ||
| - Public methods/functions: | ||
| - `<summary>`, all `<param>`, always `<returns>` | ||
| - `<exception>` only if actually propagated by API contract; otherwise describe fail-closed behavior in remarks | ||
| - `<example>` when useful | ||
|
|
||
| ### 8.3 “DIN-/standard-oriented” means | ||
| - precise wording | ||
| - consistent terminology | ||
| - explicit error paths and side effects | ||
|
|
||
| ## 9. Definition of Done (DoD) | ||
| For each file in `src/FileTypeDetection/*`: | ||
| - layout complies with sections 5-7 | ||
| - public API documented per section 8 | ||
| - umlauts preserved (no `ae/oe/ue` transliteration) | ||
| - build/tests successful | ||
| - no public signature changes | ||
| - no behavior drift (no new dependencies, no semantic changes) | ||
|
|
||
| ## 10. Style Reference (SSOT) | ||
| The authoritative style/semantics template is the reference block in `docs/governance/045_CODE_QUALITY_POLICY_DE.MD` section “10. STYLE REFERENCE (SSOT)”. | ||
| Apply that schema to all files in `src/FileTypeDetection/*`. | ||
| Deviations are allowed only when technically required and must be justified in diff summary. | ||
|
|
||
| ## Source of Truth Note | ||
| This English edition is provided for accessibility. If wording differs, the German policy file | ||
| `docs/governance/045_CODE_QUALITY_POLICY_DE.MD` is authoritative. | ||
|
|
||
| ## 11. Policy/RoC Mapping (CI) | ||
| This policy is mapped in the CI RoC matrix to the following rule files: | ||
| - `tools/ci/policies/rules/artifact_contract.yaml` | ||
| - `tools/ci/policies/rules/docs_drift.yaml` | ||
| - `tools/ci/policies/rules/naming_snt.yaml` | ||
| - `tools/ci/policies/rules/shell_safety.yaml` | ||
| - `tools/ci/policies/rules/versioning_svt.yaml` | ||
9 changes: 9 additions & 0 deletions
9
src/FileTypeDetection/Abstractions/Archive/ZipExtractedEntry.vb
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
9 changes: 9 additions & 0 deletions
9
src/FileTypeDetection/Abstractions/Detection/DetectionDetail.vb
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
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
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
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
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
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
9 changes: 9 additions & 0 deletions
9
src/FileTypeDetection/Abstractions/Hashing/HashRoundTripReport.vb
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
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
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
9 changes: 9 additions & 0 deletions
9
src/FileTypeDetection/Configuration/FileTypeProjectBaseline.vb
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.