Skip to content

[B] #514 slice 5: seam-surface guard — no persistence type crosses a seam #847

Description

@mforce

Slice 5 of #514 (modular monolith). Track B — enforcement only, no production code. Needs #842.

Nothing that crosses a module seam may expose persistence.

Scope

Reflection over every public interface in Cluckwork.Application.Features.* and
Cluckwork.Application.Common, recursing through parameter and return types. Reject any signature
reaching DbContext, DbSet, IQueryable, an EF metadata type, an aggregate base, or a repository
implementation type.

Why now rather than with the contracts

The guard is currently close to vacuous — there are zero IQueryable returns in Application
today, so it has no exemptions and starts perfectly clean. That is exactly when a pin is cheap. Add
it after the first contract ships and it arrives with a backlog of things to argue about.

Its real job is the day someone adds Task<IQueryable<Expense>> Query() to a repository because it
made one call site shorter.

Done when

Mutation Expected
add IQueryable<Flock> Query() to IFlockRepository red
return a DbSet<Expense> from any public Application interface red
accept an AppDbContext parameter on one red
return a plain DTO or a domain value object green — these are the allowed shapes

Explicitly not in this slice

Does not constrain Cluckwork.Infrastructure internals, where EF types are the point. Does not
define any module contract — it only fixes what a contract will be allowed to say once one exists.

Activity

  1. added this to the Modular monolith milestone on Sep 14, 2026
  2. added
    sliceThin vertical work item
    area:apiAPI/endpoint layer
    size:SHours to a day; few files, no migration
    epic-514Modular monolith architecture (#514)
    track:B#514 Track B — enforcement breadth; no production code; gated on Track A evidence
    on Sep 14, 2026
  3. changed the title [-]#514 slice 5: seam-surface guard — no persistence type crosses a seam[/-] [+][B] #514 slice 5: seam-surface guard — no persistence type crosses a seam[/+] on Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiAPI/endpoint layerepic-514Modular monolith architecture (#514)priority:tier4Deferred or speculativesize:SHours to a day; few files, no migrationsliceThin vertical work itemtrack:B#514 Track B — enforcement breadth; no production code; gated on Track A evidence

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions