Skip to content

fix: a contributor that implements ISchemaContributor itself is refused where it is added and by the registry - #57

Merged
CaffeinatedCoder merged 1 commit into
mainfrom
fix/48-direct-contributor
Nov 12, 2026
Merged

CaffeinatedCoder merged 1 commit into
mainfrom
fix/48-direct-contributor

Conversation

@CaffeinatedCoder

@CaffeinatedCoder CaffeinatedCoder commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Closes #48

Problem

The refusals that make a contributor's answers trustworthy are in SchemaContributor<TDeclaration, TDescriptor>: an InPlace with no statement, statements beside another answer, a null answer, a descriptor that is not a record. ISchemaContributor is public and AddSchemaContributor<T>() took any implementation, so a class implementing the interface itself was registered and called with none of them. On the base class, Resolve and Claims returning null were not refused.

Change

The issue left the choice open: refuse in the registry, or have the planner (#24) check around every call. This takes the registry: it is one check when the registry is built, and it does not wait for a planner that does not exist yet.

  • Contributors/Internal/SchemaContributorRegistry.cs: a contributor whose type does not derive from SchemaContributor<,> is refused, however it reached the collection. A base class of a package's own in between is taken.
  • SchemaKitServiceCollectionExtensions.cs: AddSchemaContributor<T>() refuses the same at the call, since C# cannot say it as a constraint.
  • Contributors/ISchemaContributor.cs: the base class refuses a null from Resolve and from Claims, as it does for Plan and ImpactOf. The interface's remarks say that it is what the kernel calls, not what a package implements.
  • CLAUDE.md: the rule.

ISchemaContributor stays public: descriptors and tests are written against it, and making it internal is a surface change for the freeze, not for this fix.

Tests

Kernel tests without a server, on SDK 11.0.100 in the checkout: 287 on #56, 291 here. The probes: 125 pass. The PostgreSQL integration tests did not run locally; CI runs them.

New: A_contributor_that_implements_the_interface_itself_is_refused_where_it_is_added, …_is_refused_by_the_registry_however_it_was_added, the allowed twin A_contributor_that_derives_through_a_base_class_of_its_package_is_taken, and A_resolution_or_a_list_of_claims_that_is_null_is_refused.

Each check undone in a scratch copy (before the rebase onto #56, 283 tests):

Undone Fails
The check in the registry …_is_refused_by_the_registry_however_it_was_added
The check in AddSchemaContributor …_is_refused_where_it_is_added
The walk up the base types (direct base only) A_contributor_that_derives_through_a_base_class_of_its_package_is_taken
The Resolve null refusal A_resolution_or_a_list_of_claims_that_is_null_is_refused
The Claims null refusal A_resolution_or_a_list_of_claims_that_is_null_is_refused

🤖 Generated with Claude Code

@CaffeinatedCoder CaffeinatedCoder added this to the 11.0.0 milestone Nov 12, 2026
@CaffeinatedCoder CaffeinatedCoder added bug Something isn't working stacked Base is another open PR; merge in order package/core Affects CodoMetis.EFCore.SchemaKit (the kernel) severity/medium Inconsistency or failure in a narrow scenario area/migrations The differ and generator decorators, snapshot format, EnsureCreated and the UseSchemaKit wiring labels Nov 12, 2026
Base automatically changed from test/52-guards-held-by-tests to main November 12, 2026 07:38
…ed where it is added and by the registry

The refusals that make a contributor's answers trustworthy are in
SchemaContributor<TDeclaration, TDescriptor>. A class implementing the
interface directly was registered and called with none of them.
AddSchemaContributor now refuses it at the call, and the registry refuses it
however it reached the collection. A base class of a package's own in between
is taken.

Resolve and Claims returning null are refused by the base class, like Plan
and ImpactOf.

Closes #48

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@CaffeinatedCoder
CaffeinatedCoder force-pushed the fix/48-direct-contributor branch from befe37c to d492540 Compare November 12, 2026 07:39
@CaffeinatedCoder CaffeinatedCoder removed the stacked Base is another open PR; merge in order label Nov 12, 2026
@CaffeinatedCoder
CaffeinatedCoder merged commit 0d48dd3 into main Nov 12, 2026
7 checks passed
@CaffeinatedCoder
CaffeinatedCoder deleted the fix/48-direct-contributor branch November 12, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/migrations The differ and generator decorators, snapshot format, EnsureCreated and the UseSchemaKit wiring bug Something isn't working package/core Affects CodoMetis.EFCore.SchemaKit (the kernel) severity/medium Inconsistency or failure in a narrow scenario

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A contributor that implements ISchemaContributor directly passes the base class's refusals by

1 participant