Skip to content

[B] #514 slice 3: table-owner completeness, walked from the EF model #845

Closed

Description

@mforce

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

Every relational table has exactly one owner, proven by walking the EF model rather than by reading a
list.

Scope

  • Extend the ledger (tests/Cluckwork.Application.Tests/Architecture/Data/module-ledger.json) with
    an owner→tables mapping and a declared cross-owner foreign-key set.
  • A walk over IModel.GetEntityTypes() resolving each mapped relational table to exactly one owner.
  • Enumerate cross-owner FKs from the model; each must be declared with a stated purpose.

Run against a model-only AppDbContext so the test needs no Docker and stays in the application
matrix leg.

Why a walk rather than a list

Today's 38 mapped tables map onto the 2026-08 design's §3.3 owner list with no gap (verified
2026-09-14 against docs/schema/). That will not stay true. #795 would add four OpenIddict tables,
and BusinessRecordModel.cs:21-34 already shows the failure mode — a Platform-side list of module
types that #819's own rule says grows with every new time-paged table. A walk fails the moment a
table is mapped with no owner. A list quietly stays green.

Done when

Mutation Expected
remove Payments from its owner's table list red — table has no owner
assign Expenses to two owners red — exactly-one violated
map a new entity with no ledger row red
drop FK_Expenses_Flocks_FlockId from the declared cross-owner FK set red — undeclared cross-owner FK

Red output attached to the PR, mutation reverted before commit.

Explicitly not in this slice

No schema change, no migration, no InitialCreate edit (#407). Does not move any EF configuration —
ownership is recorded, not relocated.

Activity

  1. added this to the Modular monolith milestone on Sep 14, 2026
  2. added
    sliceThin vertical work item
    area:apiAPI/endpoint layer
    size:MA day or two; migration or a multi-state UI
    epic-514Modular monolith architecture (#514)
    on Sep 14, 2026
  3. changed the title [-]#514 slice 3: table-owner completeness, walked from the EF model[/-] [+][B] #514 slice 3: table-owner completeness, walked from the EF model[/+] on Sep 14, 2026
  4. added
    track:B#514 Track B — enforcement breadth; no production code; gated on Track A evidence
    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:MA day or two; migration or a multi-state UIsliceThin 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