Let the Compiler Enforce Your Architecture
Every team has an architecture diagram with arrows pointing one way. Almost none of them can stop a developer drawing a new arrow at 5pm on a Friday.
The problem
"Infrastructure must not mutate domain state" is a convention. Conventions are enforced by code review, and code review is enforced by whoever is awake.
Making it structural
Mark the mutating method internal, then grant visibility to exactly the assemblies allowed to call it:
<ItemGroup>
<InternalsVisibleTo Include="MyApp.Application" />
<InternalsVisibleTo Include="MyApp.Domain.Tests" />
</ItemGroup>public sealed class Order
{
public OrderStatus Status { get; private set; }
// Only the Application layer may move an order. Persistence cannot,
// even by accident — it will not compile.
internal void ApplyTransition(OrderStatus next) => Status = next;
}Now the persistence layer physically cannot set a status. Not "shouldn't" — can't.
Why it matters
The rule stops depending on memory. A new developer doesn't need to have read the architecture doc; they need to get the build green, and the build knows the rule.
Keep that InternalsVisibleTo list short and treat additions to it as architectural changes, because that's what they are. The moment it lists every project, you've deleted the constraint while leaving the ceremony in place.