Skip to content

Merge builtin decorators into core; align assembly layout with Brighter (#321)#326

Merged
iancooper merged 13 commits into
masterfrom
merge-decorators
May 27, 2026
Merged

Merge builtin decorators into core; align assembly layout with Brighter (#321)#326
iancooper merged 13 commits into
masterfrom
merge-decorators

Conversation

@iancooper
Copy link
Copy Markdown
Member

Summary

Tidy First (structural-only) refactor that folds Paramore.Darker.Policies and Paramore.Darker.QueryLogging into core, mirroring Brighter's assembly layout. No new behaviour — the existing test suite is the verification.

  • Production: collapsed to Paramore.Darker + Paramore.Darker.Extensions.DependencyInjection + Paramore.Darker.Testing. New in-core layout: Policies/{Attributes,Handlers}/, Logging/{Attributes,Handlers}/, root-level QueryHandlerAttribute*.
  • Tests: renamed Paramore.Darker.TestsParamore.Darker.Core.Tests; new Paramore.Darker.Extensions.Tests (4 Integrations files); folded Paramore.Darker.Testing.Ports into Core.Tests/Exported/ with visibility split — Exported/ public, TestDoubles/ internal — to ring-fence Assembly.ExportedTypes-based handler scanning. AOT csproj retargeted with <PrivateAssets>all</PrivateAssets>.
  • Samples: SampleMauiTestApp/ moved under samples/.
  • Solution files: Darker.slnx and Darker.Filter.slnf pruned; deleted side-package csprojs + empty src/Paramore.Darker/{Attributes,Decorators}/. Core <Description> updated to reflect merged scope.

Each step is its own commit per ADR 0011 §Implementation Approach.

Closes #321.

ADR

ADR 0011 — Merge Builtin Decorators (Accepted).

Test plan

  • AC1 — dotnet build Darker.Filter.slnf -c Release succeeds (0 warnings, 0 errors).
  • AC2 — dotnet test Darker.Filter.slnf -c Release --no-build passes: Core.Tests 69, Extensions.Tests 8, AOT 6 per TFM (net8.0 + net9.0) — 166 total.
  • AC3 — AOT count is AOT-only (6 per TFM, not AOT + Core.Tests combined) — confirms xunit entry-assembly-only discovery + <PrivateAssets>all</PrivateAssets>.
  • AC4 — dotnet run --project samples/SampleMinimalApi serves GET /people (8-person JSON) and GET /people/{id} (fallback returns "Linus Torvalds" on broken circuit). Logger output confirms Paramore.Darker.Logging.Handlers.QueryLoggingDecoratorAsync runs from the merged core assembly.
  • AC6 — Source tree: deleted dirs absent; new dirs/files present; Exported/ has 5 public test doubles; TestDoubles/ has 0 public classes; Extensions.Tests/ has the 4 moved Integrations files.
  • AC7 — grep -rln 'namespace Paramore.Darker.Tests\b' test/Paramore.Darker.Core.Tests/ returns 0. Stale csproj-ref grep (Paramore.Darker.Policies.csproj | Paramore.Darker.QueryLogging.csproj | Paramore.Darker.Testing.Ports.csproj) returns 0.
  • AC8 — Darker.slnx and Darker.Filter.slnf reference exactly the post-merge project set; no orphaned entries.
  • AC9 — Core csproj <Description> matches the new merged-scope wording (verified embedded in produced .nuspec).
  • AC5 — dotnet build Darker.slnx -c Release (full solution with MAUI sample) — deferred to a maui-android-workload-capable reviewer machine before merge.

🤖 Generated with Claude Code

iancooper and others added 12 commits May 27, 2026 16:02
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…or Brighter (#321)

Tidy First (structural-only): move `QueryHandlerAttribute*` to root namespace
`Paramore.Darker`, and `FallbackPolicy*` (attributes + decorators) into
`Policies/{Attributes,Handlers}/` feature folders. Update production-code +
side-package `using`s for the namespace moves. Test-file usings are swept
in Step 5.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Tidy First (structural-only): relocate Retryable* attributes and decorators,
Constants, and Polly-based builder extensions from the side package
`Paramore.Darker.Policies` into core under `src/Paramore.Darker/Policies/
{Attributes,Handlers}/`. Side-package csproj left empty pending Step 9
cleanup.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
#321)

Tidy First (structural-only): add the `Newtonsoft.Json` package reference
in preparation for Step 4 (move QueryLogging sources into core). CPM in
`Directory.Packages.props` pins the version (13.0.4) — no version on the
reference itself.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Tidy First (structural-only): relocate QueryLogging attributes and
decorators, Constants, and the Newtonsoft.Json-based builder extensions
from the side package `Paramore.Darker.QueryLogging` into core under
`src/Paramore.Darker/Logging/{Attributes,Handlers}/`. Type names keep the
`QueryLogging` prefix; only folders and namespaces rename to `Logging`.
The pre-existing `Logging/ApplicationLogging.cs` is unchanged. Side-package
csproj left empty pending Step 9 cleanup.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…321)

Tidy First (structural-only): update all consumers of the moved namespaces
(`Paramore.Darker.Attributes`, `Paramore.Darker.Decorators`,
`Paramore.Darker.QueryLogging`) to use the new `Paramore.Darker.Policies.
{Attributes,Handlers}` and `Paramore.Darker.Logging.{Attributes,Handlers}`
layout. `Paramore.Darker.Policies` namespace stays valid (Constants and
the builder extensions live there). Filter build + tests pass on net8.0
and net9.0.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Tidy First (structural-only): relocate `SampleMauiTestApp/` to
`samples/SampleMauiTestApp/`. Update `Darker.slnx` Path attribute,
preserving `Type=\"Classic C#\"` and the nested `<Configuration>` mappings.
Adjust the moved csproj's `<ProjectReference>` paths (`..\src\` →
`..\..\src\`) and drop the side-package references to
`Paramore.Darker.Policies` and `Paramore.Darker.QueryLogging`. MAUI sample
stays excluded from `Darker.Filter.slnf` per existing convention.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Tidy First (structural-only): fold the 5 source files from
`test/Paramore.Darker.Testing.Ports/` into
`test/Paramore.Darker.Tests/Exported/` with namespace
`Paramore.Darker.Core.Tests.Exported` (the post-Step-8 target). Flip the
14 public class declarations in `TestDoubles/*.cs` to `internal`, plus
the 4 nested public test handlers in `Decorators/FallbackPolicyTests.cs`
that were polluting `AddHandlersFromAssemblies` scans. Retarget the AOT
csproj's `<ProjectReference>` to `Paramore.Darker.Tests.csproj` with
`<PrivateAssets>all</PrivateAssets>`. Drop Tests's reference to
`Paramore.Darker.Testing.Ports`. Update 9 `using` statements.

AOT test count is AOT-only (6 tests on net8.0 and net9.0); full filter
suite passes (77 + 77 + 6 + 6 = 166 tests).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…sts (#321)

Tidy First (structural-only): rename `test/Paramore.Darker.Tests/` to
`test/Paramore.Darker.Core.Tests/` (folder + csproj). Rewrite all 43
`namespace Paramore.Darker.Tests` declarations to
`namespace Paramore.Darker.Core.Tests`, plus matching `using` statements
for the Decorators/Integrations/TestDoubles sub-namespaces. Create the
new `test/Paramore.Darker.Extensions.Tests/` project mirroring Brighter's
layout; move 4 Integrations test files into it with namespace
`Paramore.Darker.Extensions.Tests` (drop the Integrations sub-folder).
Add `<InternalsVisibleTo Include="Paramore.Darker.Extensions.Tests" />`
to Core.Tests so Extensions.Tests can use the internal TestDoubles.
Retarget the AOT csproj `<ProjectReference>` to Core.Tests. Update
`Darker.slnx` and `Darker.Filter.slnf`. Add load-bearing `ExportedTypes`
comments in both registries per ADR Risks-table.

Test counts: Core.Tests 69, Extensions.Tests 8, Tests.AOT 6 per TFM,
all passing on net8.0 and net9.0.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…#321)

Tidy First (structural-only): delete the now-empty side packages
`src/Paramore.Darker.Policies/`, `src/Paramore.Darker.QueryLogging/`,
`test/Paramore.Darker.Testing.Ports/` (folders + csprojs + bin/obj), the
empty `src/Paramore.Darker/{Attributes,Decorators}/` folders, and the
leftover `test/Paramore.Darker.Tests/obj`. Drop the four `<ProjectReference>`
entries to deleted side packages from SampleMinimalApi, Tests.AOT,
Core.Tests, and Extensions.DependencyInjection csprojs. Prune
`Darker.slnx` and `Darker.Filter.slnf`. Authoritative grep safety net
(per ADR §5) returns 0 results.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Tidy First (structural-only): replace the placeholder
`<Description>Darker Query Processor</Description>` with the merged-scope
wording that reflects the now-bundled Policies and QueryLogging features.
Verified the new description embeds in the produced .nuspec.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ACs verified locally: AC1 build, AC2 tests (166 total: 138 Core.Tests +
16 Extensions.Tests + 12 AOT across net8.0/net9.0), AC3 AOT count is
AOT-only (6 per TFM), AC4 SampleMinimalApi serves /people and /people/2
with merged Logging.Handlers decorators running, AC6 source-tree shape
matches, AC7 namespace sweep + stale csproj-ref grep return 0, AC8
solution files reference exactly the post-merge project set, AC9
Description matches.

AC5 (full Darker.slnx build with MAUI) deferred to a MAUI-workload-capable
machine — local SDK does not have `maui-android` installed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
codescene-delta-analysis[bot]

This comment was marked as outdated.

@iancooper iancooper added .NET Pull requests that update .net code 3 - Done Breaking Change V5 labels May 27, 2026
@iancooper iancooper self-assigned this May 27, 2026
@iancooper iancooper merged commit a4a43b5 into master May 27, 2026
2 of 3 checks passed
Copy link
Copy Markdown

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Choose a reason for hiding this comment

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

Gates Passed
4 Quality Gates Passed

See analysis details in CodeScene

Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@iancooper iancooper deleted the merge-decorators branch May 27, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Done Breaking Change .NET Pull requests that update .net code V5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge Paramore.Darker.Policies and Paramore.Darker.QueryLogging into Paramore.Darker

1 participant