Repository navigation
feat!: a lambda in a declaration is bound when its model is finalized - #183
Merged
Merged
Conversation
The second slice of #114, measured first in spike F. A lambda was SQL from the call that wrote it. It is checked there now and held as it was written, and becomes SQL when the model is finalized. - The factory translates the lambda once and throws the result away, so a refusal is still on the consumer's line. Every value the lambda reads from outside becomes a constant at the call. - The entity type holds the declaration itself: under its final key when it has a name, otherwise under CodoMetis:{Owner}:~{number}, in the order written. - SchemaKitBindingConvention, last among the finalizing conventions, writes each held declaration with a writer that makes segments of its lambdas. The contract has no new member. - A name that is taken, and a declaration without a name that equals one already held, are refused at the call. Two that are written differently and are one key once they are SQL are refused when the model is finalized, naming both. - GetDeclarations, FindDeclaration and Redeclare work in both states; SqlTemplate.IsBound says which one a template is in. The translator asks nothing of the model yet, so the second binding on the finalized model has nothing to guard and comes with #180. Closes #179 Co-Authored-By: Claude Fable 5.2 <[email protected]>
The note that came with the decision said nothing was built. The stored form and the binding at finalization are in; what is left is #180. Co-Authored-By: Claude Fable 5.2 <[email protected]>
CaffeinatedCoder
enabled auto-merge
November 24, 2026 22:21
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 #179
Problem
A lambda became SQL where it was written, with no model at hand. #114 decided on 2026-11-24 that it is bound when the model is finalized; spike F (#177) measured that this works. This is the second slice: the machinery, with the translator still asking nothing of the model.
Change
UnboundLambda).CodoMetis:{Owner}:~{number}, numbered in the order written.GetDeclarations,FindDeclarationandRedeclarework on it, andSqlTemplate.IsBoundsays which state a template is in.SchemaKitBindingConvention, last among the finalizing conventions, writes each held declaration with a writer that makes segments of its lambdas, and stores key and value as for any other. The contract has no new member.Not as #179 was written, and recorded there:
PredicateandKeyTarget.Templategot their shape in Binder, slice 1: templates stored as segments, format v 3, and a resolver that scans nothing #178.Harness/Bound.cs, with anAudit:comment).Tests
Measured on 2026-11-24:
main.UnboundDeclarationTests, the rows of spike F against the kernel as a consumer declares; the unbound state inDeclarationValueTests; a lambda in any property of a declaration inDeclarationCodecTests.Each rule removed in turn, with the test that failed:
Two_lambdas_that_say_the_same_are_one_value,What_is_said_twice_is_refused_at_the_call,A_captured_local_is_read_where_the_declaration_is_writtenA_lambda_the_translator_has_no_sql_for_fails_at_the_declaration,A_cast_that_can_change_the_value_fails_at_the_declarationWhat_is_said_twice_is_refused_at_the_callWhat_is_said_twice_is_refused_at_the_callTwo_lambdas_that_are_one_sql_are_refused_when_the_model_is_finalizedA_lambda_that_binds_to_what_is_stored_already_is_refused_when_the_model_is_finalizedA_finalized_model_holds_text_aloneamong themAndknowing its own lambdaAnd_adds_to_a_lambda_that_is_not_boundA ninth rule, that a lambda in an operational property is noticed before the writer decides to write it, had no test that could fail without it, and is gone.
🤖 Generated with Claude Code