Repository navigation
fix: a contributor that implements ISchemaContributor itself is refused where it is added and by the registry - #57
Merged
Conversation
…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
force-pushed
the
fix/48-direct-contributor
branch
from
November 12, 2026 07:39
befe37c to
d492540
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #48
Problem
The refusals that make a contributor's answers trustworthy are in
SchemaContributor<TDeclaration, TDescriptor>: anInPlacewith no statement, statements beside another answer, a null answer, a descriptor that is not a record.ISchemaContributoris public andAddSchemaContributor<T>()took any implementation, so a class implementing the interface itself was registered and called with none of them. On the base class,ResolveandClaimsreturning 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 fromSchemaContributor<,>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 fromResolveand fromClaims, as it does forPlanandImpactOf. The interface's remarks say that it is what the kernel calls, not what a package implements.CLAUDE.md: the rule.ISchemaContributorstays 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 twinA_contributor_that_derives_through_a_base_class_of_its_package_is_taken, andA_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):
…_is_refused_by_the_registry_however_it_was_addedAddSchemaContributor…_is_refused_where_it_is_addedA_contributor_that_derives_through_a_base_class_of_its_package_is_takenResolvenull refusalA_resolution_or_a_list_of_claims_that_is_null_is_refusedClaimsnull refusalA_resolution_or_a_list_of_claims_that_is_null_is_refused🤖 Generated with Claude Code