ADR-0039: explicit mapping diagnostics and schema responsibility¶
Status: accepted. All 47 generator tests and the refreshed actual analyzer-package consumer pass. The retained build-cost experiment (maintainer-local record) verifies six forced builds per arm, actual compiler GBSG008 failure/recovery, matching generated control source and no runtime analyzer dependency. Measured mean whole-build difference is 111.96 ms (4.59%) for this three-entity consumer; no general IDE/solution-latency claim.
Retain the existing optional incremental generator and its closed attributed contract. Add specific located errors GBSG006 for unsupported properties, GBSG007 for conflicting key declarations/roles, and GBSG008 for absent or invalid schema policy. Existing GBSG003 already covers unsupported edge endpoint mappings; deepen its evidence instead of introducing a duplicate edge diagnostic or new infrastructure.
Require GraphModel.SchemaPolicy = GraphSchemaPolicy.ExistingConstraints. This acknowledges that reviewed constraints are provisioned separately. It is not compile-time verification of a live schema and does not relax runtime schema guards. Reject unknown values; do not guess an automatic-deployment policy. Existing generator consumers must add the explicit attribute property; runtime-only applications remain unaffected. Finalized-model fingerprints retain the same storage meaning.
Keep stable key declarations separate from concurrency/version roles and diagnose conflicting EF/data-annotation key authorities at their source location. Preserve no-output behavior for invalid registrations and Roslyn incremental invalidation across entity files. Dynamic fluent configuration and all EF mapping forms remain outside this generator's authority; finalized EF metadata is still the runtime source of truth.
Measure serial forced builds with the optional generator enabled against the exact generated C# frozen as input, excluding dependency rebuild/restore from measured iterations. This estimates the build cost for the named consumer; it does not measure large solutions, IDE latency or arbitrary compiler hosts. The diagnostic contract records error codes and preview migration steps.