Repository navigation
feat: a declaration needs its contributor's registration, and a package the kernel of its own version - #142
Merged
Conversation
…ge the kernel of its own version The kernel's UseSchemaKit() stamps a model and renders nothing. With UseNpgsql(cs).UseSchemaKit(), DeclarePostgres passed on that stamp and the refusal came at the first diff. Declare and Redeclare now ask for a contributor of the declaration's owner as well, and name the package whose registration is missing. The owners are kept beside the model, not as an annotation, which would land in the snapshot. The PostgreSQL package asks SchemaKitPackages.RequireKernel first in both registrations. A direct reference to another kernel builds with NU1608; the pair is now refused with both versions, where it failed with a MissingMethodException at the first member that differed. The consumer smoke test has a consumer that mixes the two versions. The name of the kernel's own UseSchemaKit() is #141. Closes #113 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Decided by the maintainer on 2026-11-14. The plan's section 7 records it, and the guide no longer says the name is open. Closes #141 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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 #113
Closes #141
Problem
Two wrong wirings were refused late, by a message that did not say what to do:
UseNpgsql(cs).UseSchemaKit()is the kernel's method. It stamps the model and registers no contributor, soDeclarePostgrespassed and the first diff was refused with "no contributor with that owner is registered", naming a package the consumer already references.CodoMetis.EFCore.SchemaKitat another version than the PostgreSQL package's breaks the package's exact pin. NuGet answers with the warning NU1608 and builds; the pair failed at run time with aMissingMethodExceptionat whichever member differed first.Point 4 of the issue (the consumer's model told by reference) is #98, merged. Point 2 (the name of the kernel's
UseSchemaKit()) was a decision about the public surface (#141): the maintainer decided on 2026-11-14 that the name stays, and the second commit records it in the plan and the guide.Change
AddSchemaContributoralso adds aSchemaContributorRegistration(owner and type), a plain value, since no contributor may be resolved while a model is built.SchemaKitWiringConventionstamps the model and puts the registered owners into aConditionalWeakTablekeyed by the model.DeclareandRedeclarerequire the declaration's owner there and name the declaration's assembly as the package to register. It is not an annotation: that would be written into the snapshot and change with the packages a context registers.SchemaKitPackages.RequireKernel(Assembly), part of the contract (SK9001): compares the informational versions without the commit. The PostgreSQL package calls it first inUseSchemaKit()andAddEntityFrameworkSchemaKitNpgsql(), from a method that calls nothing else of the kernel; the rest moved into aNoInliningmethod, since the runtime binds a method's calls when it compiles the method.AddSchemaContributorcan no longer be declared for; the method's documentation says so.CLAUDE.mdsay what is now true.Tests
A_declaration_whose_contributor_the_options_do_not_register_is_refused_where_it_is_writtenon Npgsql, SQL Server and SQLite, andOnly_the_owners_the_options_register_may_be_declaredwith its allowed twin;The_kernels_call_alone_is_refused_where_a_PostgreSQL_object_is_declaredin the PostgreSQL suite.A_declaration_with_no_contributor_is_refused_on_either_sidenow diffs another context's model, which is what a snapshot is.PackageVersionTests: the same version with and without a commit passes, another is refused with both names and versions, the assembly version alone does not pass.kernelrows expect the new refusal, and a new consumerMixed/references a kernel packed as<version>.mixedbeside the package. The row requires NU1608 in the build's log, so that it tests a pair NuGet really lets through.RequireKerneltaken out of the package'sUseSchemaKit(), the mixed consumer printsREGISTEREDand the smoke test stops at that row.SMOKE_BREAK=kernel-onlystill fails the run.🤖 Generated with Claude Code