Skip to content

feat: the read model and Redeclare carry no experimental mark, and Declare carries its own - #91

Merged
CaffeinatedCoder merged 1 commit into
mainfrom
feat/read-model-unmarked
Nov 12, 2026
Merged

CaffeinatedCoder merged 1 commit into
mainfrom
feat/read-model-unmarked

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

Closes #90

Problem

Decided on 2026-11-12: features ship without the experimental mark. GetDeclarations, FindDeclaration and Redeclare sat on a class marked SK9001 as a whole.

Measured with the SDK's compiler while building this: a mark on a static class reaches a call only where the class is written. So entity.Redeclare<PgExclusion>(…) compiled without an opt-in all along and only SchemaDeclarationExtensions.Redeclare(entity, …) did not. For the same reason entity.Declare(…), which is a contributor's call and meant to ask for the opt-in, did not ask.

Change

  • SchemaDeclarationExtensions loses the mark, and Declare carries it itself. Reading and amending ask for nothing in either call syntax; Declare asks in both.
  • ConsumerCompileTests: a consumer's code compiled with Roslyn against the shipped assemblies with nothing suppressed. Every other test project opts into SK9001, so none of them would notice a feature that asks a consumer for the same.
  • PublicSurfaceTests holds which of the class's methods is marked, so a method added later has to be put on one side.

No other class-level mark in the kernel is on a class of extension methods: AddSchemaContributor was marked on the method from the start.

Tests

458 kernel, 70 PostgreSQL offline, 125 probes. No statement that reaches a server changed.

  • The consumer's code: a declaration kept in a field, DeclarePostgres with a list, SuppressBtreeGistInjection, Predicate.Of over an interface, Redeclare with AndWhere, GetDeclarations with a walk over the elements and a with, FindDeclaration, and one call that names the class. No error and no SK9001.
  • Its premise: Metadata.Declare([…]) in the same compilation reports exactly one SK9001. A compiler that reported no experimental diagnostic at all would pass the first test.

Each guard shown to fail, in a scratch copy:

Mutation Fails
The class marked again the consumer test (through the call that names the class), Of_the_declaration_methods_only_Declare_is_marked_experimental
Declare unmarked The_kernels_own_Declare_asks_for_the_opt_in, the kernel's
Redeclare marked the consumer test, the kernel's
KeyTarget marked the consumer test, No_declaration_value_is_marked_experimental

🤖 Generated with Claude Code

…clare carries its own

Closes #90.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@CaffeinatedCoder CaffeinatedCoder added this to the 11.0.0 milestone Nov 12, 2026
@CaffeinatedCoder CaffeinatedCoder added enhancement New feature or request package/core Affects CodoMetis.EFCore.SchemaKit (the kernel) package/postgresql Affects CodoMetis.EFCore.SchemaKit.PostgreSQL area/constraints Exclusion constraints, row guards and other constraint-like objects labels Nov 12, 2026
@CaffeinatedCoder
CaffeinatedCoder merged commit 18dc647 into main Nov 12, 2026
7 checks passed
@CaffeinatedCoder
CaffeinatedCoder deleted the feat/read-model-unmarked branch November 12, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/constraints Exclusion constraints, row guards and other constraint-like objects enhancement New feature or request package/core Affects CodoMetis.EFCore.SchemaKit (the kernel) package/postgresql Affects CodoMetis.EFCore.SchemaKit.PostgreSQL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PgExclusion, third slice: the read model and Redeclare without the experimental mark

1 participant