Repository navigation
Persistence: givens are part of a table's key, and a builder gets a complete plan - #3173
Merged
Merged
Conversation
…omplete plan The builder and the manifest lookup compile a persisted source's key SQL with givens bound the same way, through one function, so a table built for one value is never found by a query asking for another. getBuildTargets takes a build's givens and virtualMap over the Runtime's, reports a source whose SQL cannot be written in `unbuildable` instead of failing the plan, and each target produces its own build SQL under the options that keyed it. Importing a persisted source that reads a given the importer cannot supply is a translate error.
…it is found before compiling
…s point, not explain internal.md is reorganized around what has to stay true (one key both sides, key SQL differs from executed SQL only by substitution, the walk's path list, identity not leaking through derivation, canonical names, digests computed not stored), then the design decisions, then a map of the pieces with addresses in place of step-by-step walkthroughs. Both persist docs name this directory and the code as the design of record. CONTEXT entries and two JSDoc comments shrink to what the code cannot say; the strict-miss message for a given-reading source says what to check.
This was referenced Oct 26, 2026
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.
#3165 raised some issues; looking at the interactions between givens and persistence, it turned out there were more. This PR addresses:
runtime.getBuildTargets(model, {givens?, virtualMap?})returns{connections, tagParseLog, unbuildable}: a persisted source whose SQL cannot be written is reported inunbuildablewith the reason, and the rest of the model is planned. EachBuildTargetcarriesbuildSQL(manifest), compiled under the same givens andvirtualMapas its key, andreadsGivens.PersistSource.getSQL()andmakeBuildId()are deprecated for builders.strict. RunninggetBuildTargetsonce per set of values builds the variants.unsatisfied-given-in-persist-source). A build with no value for a given reportsruntime-persist-given-no-value, naming the given by this model's name for it.doc/persist/api.md,internal.md, theapi,foundation, andlangCONTEXT files, andscripts/simple_builder.Behaviour change for builders: a model that used to fail
getBuildTargetsoutright now plans with fewer targets; a builder that relied on the throw readsunbuildable.Replaces #3165. Resolves #3041.