Skip to content

ADR-0026: every public type of a provider in its root namespace - #352

Merged
milten89 merged 1 commit into
developfrom
feature/350-root-namespace
Nov 21, 2026
Merged

milten89 merged 1 commit into
developfrom
feature/350-root-namespace

Conversation

@milten89

Copy link
Copy Markdown
Owner

Closes #350

What

  • New ADR-0026 (accepted) supersedes the released ADR-0007 and restates its whole decision with one change: every public type of a provider package goes in the root namespace, models and enums included, and its file goes in the project root.
    • NBP keeps its 1.x area namespaces until 2.0 (2.0: move the NBP models to the root namespace OpenUrzednik.Nbp; DefaultApiUrl as static readonly #351). Until then it also keeps ADR-0025's constructor overloads.
    • Core keeps its own namespaces, because it isn't a provider.
    • .Models joins .Extensions and .Options as a banned public namespace name.
    • Considered options: area namespaces, everything in the root, root plus .Models, and a shared namespace plus area namespaces, citing the survey of 18 SDKs, the Azure SDK guidelines and the Framework Design Guidelines.
  • ADR-0007: only its status line and a supersede link.
  • ADR-0016 and ADR-0023: both accepted and unreleased, so each is corrected in place with a dated line.
  • References to ADR-0007 now point to ADR-0026: the index, CLAUDE.md, the code-conventions and client-api rules, the reviewer agent, the new-provider, new-endpoint and stryker skills, and code comments.
  • White List: the nine public models move from Search/, Check/ and Status/ to the project root and OpenUrzednik.MF.WhiteList: Subject, SubjectPerson, VatStatus, SubjectSearchResult, SubjectsSearchResult, BatchSearchResult, BatchSearchEntry, AccountCheckResult and VatStatusResult.
    • Each file changes only its namespace line.
    • The internal mappers stay where they are.
    • PublicAPI.Unshipped.txt is updated. The package is unreleased (IsPackable=false), so nothing breaks.
  • New Architecture test: every public type of a provider must be in its root namespace.
  • Mutation shard: its strict globs cover the moved files.

Checks run locally

  • dotnet build OpenUrzednik.slnx -p:TreatWarningsAsErrors=true: 0 errors.
  • dotnet test -f net10.0 on the full solution (reviewer's run): 3,225 passed, 0 failed, 41 explicit tests skipped.
  • -f net472 on WhiteList, Diagnostics and Logging: all pass.
  • dotnet format --verify-no-changes: clean.
  • uv run tests/Mutation/run.py mf-white-list: 100% (468 killed).
  • AotSmoke publish and run: all checks passed.
  • dotnet pack and package_guard.py: OK.

The reviewer agent found nothing blocking. I applied all of its should-fix items and nits:

  • ADR-0026 now states NBP's constructor and README exceptions until 2.0.
  • ADR-0023 cites ADR-0026 for the constructors.
  • The CLAUDE.md White List row is updated.
  • The ADR-0007 link line is placed like the other superseded records.
  • The test is renamed PublicType_Always_HasNoMemberKindNamespaceSegment.
  • The new-endpoint and stryker skills are updated.

After these edits, the Architecture tests (58) and format passed again.

Left for the maintainer: ADR-0023's Context (line 16) still cites the superseded ADR-0003, ADR-0004 and ADR-0007 as contracts. This predates this PR and is outside #350.

🤖 Generated with Claude Code

ADR-0026 supersedes ADR-0007 and restates it with one change: a
provider's models and enums live in its root namespace, files in the
project root, so one using reaches everything and a type never moves
because another area starts using it. NBP keeps its 1.x area
namespaces until 2.0 (#351). .Models joins the banned public namespace
names. ADR-0016 and ADR-0023 are corrected in place.

The White List's nine public models move from Search/, Check/ and
Status/ into OpenUrzednik.MF.WhiteList; the internal mappers stay. An
Architecture test enforces the rule for every provider except NBP.

Closes #350

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@milten89 milten89 added the enhancement New feature or request label Nov 21, 2026
@milten89
milten89 merged commit 0fbe786 into develop Nov 21, 2026
20 of 21 checks passed
@milten89
milten89 deleted the feature/350-root-namespace branch November 21, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ADR: all public types in the provider's root namespace (supersedes ADR-0007); move the White List models

1 participant