Repository navigation
feat(templates): add example inputs, render-all validation, and template render -d - #56
Merged
ghchinoy merged 1 commit intoNov 9, 2026
Conversation
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.
Summary
Adds synthetic example inputs and end-to-end schema validation across all 43 shipped
.json.tmplpolicy templates, fixesdgem template render -d, and aligns the gateway template catalog (GET /api/templates):templates/**/*.examples.json) & minimal-input defaults:<name>.examples.jsonfiles (typical,edge, andminimalsynthetic inputs, plusunambiguousexpected_answerswhere deterministic) for everytemplates/**/*.json.tmplpolicy.intent_banking77,intent_clinc150,intent_tiebreak,tn_disambiguation,jevbench_generic) so rendering with{}produces a valid schema without changing behavior when caller options/levels are supplied.pkg/template/examples.go,pkg/template/examples_test.go):LoadExamplesFile,SampleVarsFromExamples,CoerceJSONVariableStrings, andValidateRenderedPayloadcheckingParseStructuredPayload, valid JSONschema/stateobjects, unique non-empty question IDs, non-empty instructions, valid question types,<= 26choice options (unlesslabelsisaz_aa/az_lowerorallow_wide_choicesis set), acyclicdepends_on/ask_ifreferences, andexpected_answersdomain membership.TestAllShippedTemplatesRenderAndValidatewalkstemplates/and validates every.json.tmplacrosstypical,edge,minimal, and stringifiedsample_varsround-trips.cmd/template.go,cmd/serve.go):-d/--dataindgem template render(with-voverrides on top) and addscmd/template_render_test.go.extractTemplateVarsincmd/serve.goto ignore string literals with escaped quotes and$-prefixed range variables, honorsmultimodaloverrides from.examples.json(multimodal/call_quality_audio->false), populatesexamplesandsample_varsonGET /api/templates, fillsdefaultSampleVarsgaps, and coerces JSON-array strings inPOST /api/decide.Verification
go build -o bin/dgem . && go vet ./... && env -u DGEM_VERTEX_URL go test ./...go -C examples vet ./... && go -C examples test ./...python3 -m unittest scripts/matrix/test_matrix.pypython3 scripts/docs_sync_check.py && python3 scripts/docs_link_check.pyCloses #55