Add an ArchUnitNET architecture-fitness suite with a ratcheting baseline#7
Closed
ChrisonSimtian wants to merge 1 commit into
Closed
Add an ArchUnitNET architecture-fitness suite with a ratcheting baseline#7ChrisonSimtian wants to merge 1 commit into
ChrisonSimtian wants to merge 1 commit into
Conversation
Introduce tests/Fallout.Architecture.Tests, a solution-wide ArchUnitNET suite that locks in the runtime layering so new code can't silently invert a dependency edge that still compiles. Rules are scoped by assembly (the legacy NUKE namespaces span assemblies), covering foundation purity, utility -satellite confinement, downward-only layering, the Cli composition root, and the Nuke.* shim direction. Known-broken areas are governed by a one-way ratchet: each rule is allowed exactly its documented baseline of pre-existing violations (KnownViolations), and fails on any new violation or any baseline entry that has been fixed, so the debt can only shrink. The namespace/assembly-alignment rule ships with a ~220-entry baseline capturing today's Fallout.Common.* sprawl. Migrate the issue-Fallout-build#88 Fallout.Core purity guard off the unmaintained NetArchTest.Rules onto ArchUnitNET and retire that package. Document the suite in docs/architecture-tests.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ChrisonSimtian
added a commit
that referenced
this pull request
Jun 29, 2026
…line Brings the solution-wide architecture-fitness suite into the Core sweep so the layering this PR tidies up is now enforced by tests and can't silently drift back. Originally drafted as a standalone PR (#7), folded in here. - tests/Fallout.Architecture.Tests: assembly-scoped ArchUnitNET rules — Core/Utilities foundation purity, utility-satellite confinement, downward-only layering, "nothing depends on the Cli composition root", "Fallout.* never depends on the Nuke.* shims", Core I/O-purity, and a namespace-rooted-at-assembly naming rule. - Ratchet + KnownViolations: a one-way ratchet over a documented baseline. Known-broken areas are grandfathered; new violations fail, and fixed baseline entries must be removed — so the debt can only shrink. Lets us be deliberately less strict today while locking in every future gain. - Migrated the issue-Fallout-build#88 Core purity guard off the unmaintained NetArchTest.Rules onto ArchUnitNET; removed that package and the old Fallout.Core.Tests guard. - docs/architecture-tests.md, CHANGELOG, dependencies docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
|
Folding this work into the two onion-architecture PRs rather than landing it standalone:
Same suite, same ratchet, same baseline — just delivered alongside the refactors it enforces so the architecture work and its guardrails land together. Closing in favour of those. |
ChrisonSimtian
added a commit
that referenced
this pull request
Jun 29, 2026
…line Brings the solution-wide architecture-fitness suite into the Core sweep so the layering this PR tidies up is now enforced by tests and can't silently drift back. Originally drafted as a standalone PR (#7), folded in here. - tests/Fallout.Architecture.Tests: assembly-scoped ArchUnitNET rules — Core/Utilities foundation purity, utility-satellite confinement, downward-only layering, "nothing depends on the Cli composition root", "Fallout.* never depends on the Nuke.* shims", Core I/O-purity, and a namespace-rooted-at-assembly naming rule. - Ratchet + KnownViolations: a one-way ratchet over a documented baseline. Known-broken areas are grandfathered; new violations fail, and fixed baseline entries must be removed — so the debt can only shrink. Lets us be deliberately less strict today while locking in every future gain. - Migrated the issue-Fallout-build#88 Core purity guard off the unmaintained NetArchTest.Rules onto ArchUnitNET; removed that package and the old Fallout.Core.Tests guard. - docs/architecture-tests.md, CHANGELOG, dependencies docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ChrisonSimtian
added a commit
that referenced
this pull request
Jun 30, 2026
…line Brings the solution-wide architecture-fitness suite into the Core sweep so the layering this PR tidies up is now enforced by tests and can't silently drift back. Originally drafted as a standalone PR (#7), folded in here. - tests/Fallout.Architecture.Tests: assembly-scoped ArchUnitNET rules — Core/Utilities foundation purity, utility-satellite confinement, downward-only layering, "nothing depends on the Cli composition root", "Fallout.* never depends on the Nuke.* shims", Core I/O-purity, and a namespace-rooted-at-assembly naming rule. - Ratchet + KnownViolations: a one-way ratchet over a documented baseline. Known-broken areas are grandfathered; new violations fail, and fixed baseline entries must be removed — so the debt can only shrink. Lets us be deliberately less strict today while locking in every future gain. - Migrated the issue-Fallout-build#88 Core purity guard off the unmaintained NetArchTest.Rules onto ArchUnitNET; removed that package and the old Fallout.Core.Tests guard. - docs/architecture-tests.md, CHANGELOG, dependencies docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds
tests/Fallout.Architecture.Tests— a solution-wide ArchUnitNET suite that codifies Fallout's intended runtime architecture so future work can't silently invert a dependency edge that still compiles. This is the broader-suite half of Fallout-build#95, and it absorbs the Fallout-build#88Fallout.Corepurity guard.15 tests, all green. 14 are strict invariants that hold today; 1 — the namespace/assembly-alignment rule — carries a documented baseline of the current legacy debt.
Key decisions
NetArchTest.Rules. NetArchTest is effectively unmaintained (last release 2023); ArchUnitNET is maintained and far more expressive. The [Foundation] Extract Fallout.Core domain project Fallout-build/Fallout#88Fallout.Coreguard was migrated onto it andNetArchTest.Ruleswas retired fromDirectory.Packages.props.Fallout.Common.*types live inFallout.Build,Fallout.Build.SharedandFallout.Common; theFallout.Utilities.Netassembly still emitsFallout.Common.Utilities.Net.*), so namespace-based layering would be meaningless. Every subject/target usesResideInAssembly(...), additionally filtered to first-party (Fallout.*/Nuke.*) types to strip tooling-generated noise (ThisAssembly,RefSafetyRulesAttribute, coverlet).KnownViolations). The test fails on any new violation and on any baseline entry that has been fixed — so the debt register can only shrink.Enforced strictly (empty baseline — these hold today)
Fallout.CoreandFallout.Utilitiesare foundations: no in-repo dependencies.Fallout.Utilities.*satellite depends only onFallout.Utilities.Fallout.Tooling,Fallout.ProjectModel,Fallout.Build.Shareddon't reach upward;Fallout.Solutionis a thin facade over the vendored parser.Fallout.Clicomposition root.Fallout.*never depends on theNuke.*transition shims (they point inward only).Fallout.Coretakes no dependency onSystem.IO/System.Diagnostics.Process/System.Console/ Serilog (the [Foundation] Extract Fallout.Core domain project Fallout-build/Fallout#88 purity bar).Baselined (known debt, ratcheting down)
Fallout.Common.*sprawl (chiefly underFallout.Build/Common/Tooling), plus the satellites still emittingFallout.Common.Utilities.*and theFallout.Solutions.*facade types. Shrinks as the onion-architecture refactor renames things; each removed entry is a permanent gain the ratchet locks in.Relationship to
refactor/architectureThat branch already has an onion/ring architecture-test suite (NetArchTest, ring-based) targeting a structure not yet on
main(Fallout.Domain,Fallout.Application.*, …). This PR is deliberately the fresh suite onmainencoding today's assembly layering — independent of the refactor. Whenrefactor/architecturelands, the two reconcile (ideally that suite also moves to ArchUnitNET so there's one tool).Out of scope (not governed)
The Roslyn build-time tooling (
Fallout.SourceGenerators,Fallout.Tooling.Generator,Fallout.Migrate[.Analyzers],Fallout.MSBuildTasks) and the vendoredFallout.Persistence.Solutionparser — composition-root / build-time / vendored code outside the runtime layering.Notes
main. Noversion.jsonchange.target/2026label didn't exist on this repo — created it to follow the PR-creation flow.docs/architecture-tests.md.🤖 Generated with Claude Code