Refs #12. New ErsatzTV.Architecture.Tests project that fails the build on layering violations, so the architecture can't erode one "just import it here" at a time.
Rules (reflect the intended layering + today's reference graph)
Core must not depend on Application / Infrastructure* / Scanner, nor on Microsoft.EntityFrameworkCore / Pomelo / Microsoft.Data.Sqlite / Dapper.
FFmpeg (lowest layer) must not depend on any other ErsatzTV layer.
Application must not depend on the concreteInfrastructure.Sqlite / Infrastructure.MySql providers (only the Infrastructure abstraction).
Infrastructure must not depend on Application or the concrete providers.
Notes
Uses NetArchTest.eNhancedEdition (maintained fork; the original NetArchTest.Rules is unmaintained since 2021 and its older Mono.Cecil doesn't reliably parse .NET 10 assemblies). Concrete reason for the deviation from the issue's literal suggestion.
Runs via the existing dotnet test in CI — no workflow change.
Verified non-vacuous: a temporary negative control (asserting the known-trueInfrastructure → Core dependency is forbidden) failed as expected and listed the real offending types, proving the assemblies load and the rules have teeth. Removed before commit.
Docs: the enforced layering will be written up in the contributors guide (#10, done last so it documents the now-enforced rules).
Refs #12. New `ErsatzTV.Architecture.Tests` project that fails the build on layering violations, so the architecture can't erode one "just import it here" at a time.
## Rules (reflect the intended layering + today's reference graph)
- **Core** must not depend on `Application` / `Infrastructure*` / `Scanner`, nor on `Microsoft.EntityFrameworkCore` / `Pomelo` / `Microsoft.Data.Sqlite` / `Dapper`.
- **FFmpeg** (lowest layer) must not depend on any other ErsatzTV layer.
- **Application** must not depend on the **concrete** `Infrastructure.Sqlite` / `Infrastructure.MySql` providers (only the `Infrastructure` abstraction).
- **Infrastructure** must not depend on `Application` or the concrete providers.
## Notes
- Uses **NetArchTest.eNhancedEdition** (maintained fork; the original `NetArchTest.Rules` is unmaintained since 2021 and its older Mono.Cecil doesn't reliably parse .NET 10 assemblies). Concrete reason for the deviation from the issue's literal suggestion.
- Runs via the existing `dotnet test` in CI — no workflow change.
- **Verified non-vacuous**: a temporary negative control (asserting the *known-true* `Infrastructure → Core` dependency is forbidden) failed as expected and listed the real offending types, proving the assemblies load and the rules have teeth. Removed before commit.
## Verification
- Arch tests: **5/5 pass**. Full-solution Release build: **0 errors, 0 warnings**.
Docs: the enforced layering will be written up in the contributors guide (#10, done last so it documents the now-enforced rules).
Add ErsatzTV.Architecture.Tests asserting the solution's layering, so a
"just import it here" violation fails the build instead of eroding the
architecture over time:
- Core must not depend on Application/Infrastructure*/Scanner, nor on
EF Core / Pomelo / Microsoft.Data.Sqlite / Dapper.
- FFmpeg (lowest layer) must not depend on any other ErsatzTV layer.
- Application must not depend on the concrete Infrastructure.Sqlite/.MySql
providers (only the Infrastructure abstraction).
- Infrastructure must not depend on Application or the concrete providers.
Uses NetArchTest.eNhancedEdition — the maintained fork; the original
NetArchTest.Rules is unmaintained since 2021 and its older Mono.Cecil
doesn't reliably parse .NET 10 assemblies. Runs via the existing `dotnet
test` in CI. Rules verified with a negative control (a known-true
dependency asserted forbidden fails as expected — so they're not vacuous).
Refs #12
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
timothy
merged commit c788ae57f1 into main2026-06-27 09:56:26 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Refs #12. New
ErsatzTV.Architecture.Testsproject that fails the build on layering violations, so the architecture can't erode one "just import it here" at a time.Rules (reflect the intended layering + today's reference graph)
Application/Infrastructure*/Scanner, nor onMicrosoft.EntityFrameworkCore/Pomelo/Microsoft.Data.Sqlite/Dapper.Infrastructure.Sqlite/Infrastructure.MySqlproviders (only theInfrastructureabstraction).Applicationor the concrete providers.Notes
NetArchTest.Rulesis unmaintained since 2021 and its older Mono.Cecil doesn't reliably parse .NET 10 assemblies). Concrete reason for the deviation from the issue's literal suggestion.dotnet testin CI — no workflow change.Infrastructure → Coredependency is forbidden) failed as expected and listed the real offending types, proving the assemblies load and the rules have teeth. Removed before commit.Verification
Docs: the enforced layering will be written up in the contributors guide (#10, done last so it documents the now-enforced rules).