You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(builder): evolution policy for data contracts and customer copies #294
Part of epic #261, phase 4 step 4. Design: docs/superpowers/specs/2026-11-26-builder-evolution-policy-design.md on feature/builder.
Problem
The data a host gives its templates changes. A renamed or removed field silently prints nothing in a stored template that still reads it: a customer's edited copy (DOCX/ODT) or a stored JSON definition. Templates built from code are rebuilt and need nothing.
Scope (reduced, decided 2026-11-26)
The library checks, the host decides (storage, when to re-check, how to show the result, fixing).
One check for any stored template against the current data catalogue (not the current template's contract): TemplateInspector.Check for DOCX/ODT copies, TemplateInspector.CheckDefinition for JSON definitions.
Result: status Ok / Warning (works, but outdated or of unknown origin) / Broken (will not fill correctly), and problems with code, data path and location.
Component versions ([ComponentVersion(n)]) recorded in the stamp; an older component makes a copy a warning. JSON definitions get the current component on every build.
DataCatalog.ToJson() for agents and for hosts that keep a snapshot.
Policy in the docs: adding fields is safe; renaming or removing one is a breaking change, re-check stored templates.
Out of scope
Contract diff, declared renames, rewriting templates, a definition hash in the stamp, reading a catalogue from JSON. Fixing broken templates (for example by an agent that reads the host's changelog of data changes) is the host's work.
Done on feature/builder (no release), reduced scope as described above.
TemplateInspector.Check(stream, TemplateCheckOptions) checks a DOCX/ODT copy against the current data catalogue: syntax (TB9300), unknown paths (TB9301), a trial fill with data of the catalogue's shape (TB9302), stamp: none (TB9303), other template (TB9304), older definition version (TB9305), older or unknown component (TB9306). Status Ok / Warning / Broken.
TemplateInspector.CheckDefinition(json, import, build?, expected?) checks a JSON definition: import with the catalogue (TB9203 with data path and JSON pointer) and, with build options, the build.
[ComponentVersion(n)] (opt-in) is recorded in the stamp (Templify.Components). A versioned component must be registered to be exported to JSON (TB9204), so builds from JSON always use its current version.
Developer docs: "Stamp and checking stored templates", codes table, "Changing the data" policy, known limits.
Final review fixes (each with a test): whole paths of loop items through the trial fill, loops over open shapes (dictionaries) validated, indexed paths ([n]) accepted, duplicate catalogue paths, ToJson for types nested in generic types.
Known limits (documented): a removed field deeper than the loop item read only in a condition, and a loop over a value in a branch the check's data does not take, are not detected (#299 for the engine side).
Deferred minors: CLR members of dictionaries (count, keys) resolve on closed witness objects; a loop over an object passes when the body reads nothing from the item; a stream positioned at its end reads as "not a template"; a DOCX with a damaged styles part is Ok; TB9204 messages repeat per occurrence; stamp component names are bare type names; TemplateStamp.ToString shows the dictionary type; CheckDefinition takes positional parameters; TB9300 covers all non-variable validation errors.
Activity
docs(builder): design and plan for checking stored templates (#294)
feat(builder): data catalogue as JSON and witness validation (#294)
feat(builder): component versions in the template stamp (#294)
feat(builder): check stored template copies against the data catalogue (
feat(builder): check stored JSON definitions (#294)
feat(builder): versioned terms component in the sample (#294)
docs(builder): checking stored templates and changing the data (#294)
fix(builder): final review of the stored-template check (#294)
docs(builder): what the stored-template check cannot see (#294)
vaceslav commentedon Nov 26, 2026
Done on
feature/builder(no release), reduced scope as described above.TemplateInspector.Check(stream, TemplateCheckOptions)checks a DOCX/ODT copy against the current data catalogue: syntax (TB9300), unknown paths (TB9301), a trial fill with data of the catalogue's shape (TB9302), stamp: none (TB9303), other template (TB9304), older definition version (TB9305), older or unknown component (TB9306). StatusOk/Warning/Broken.TemplateInspector.CheckDefinition(json, import, build?, expected?)checks a JSON definition: import with the catalogue (TB9203 with data path and JSON pointer) and, with build options, the build.[ComponentVersion(n)](opt-in) is recorded in the stamp (Templify.Components). A versioned component must be registered to be exported to JSON (TB9204), so builds from JSON always use its current version.DataCatalog.ToJson();CheckUpload/UploadCheckResult/TemplateOriginreplaced.Final review fixes (each with a test): whole paths of loop items through the trial fill, loops over open shapes (dictionaries) validated, indexed paths (
[n]) accepted, duplicate catalogue paths,ToJsonfor types nested in generic types.Known limits (documented): a removed field deeper than the loop item read only in a condition, and a loop over a value in a branch the check's data does not take, are not detected (#299 for the engine side).
Deferred minors: CLR members of dictionaries (
count,keys) resolve on closed witness objects; a loop over an object passes when the body reads nothing from the item; a stream positioned at its end reads as "not a template"; a DOCX with a damaged styles part is Ok; TB9204 messages repeat per occurrence; stamp component names are bare type names;TemplateStamp.ToStringshows the dictionary type;CheckDefinitiontakes positional parameters; TB9300 covers all non-variable validation errors.test(builder): the stored-template check finds nested item paths in c…
vaceslav commentedon Dec 2, 2026
Done on feature/builder, merged to main in #316 and released in builder 0.1.0.