build-prompt-validates-custom-templates

IN premise

`build_prompt` raises `ValueError("unknown placeholder")` for unrecognized `{fields}` and `ValueError("malformed braces")` for unclosed braces in custom prompt templates

Summary

The prompt construction function actively validates custom templates before use, rejecting any template that references placeholder fields the system doesn't recognize or that has broken curly-brace syntax. This means malformed or unsupported templates fail fast with clear error messages rather than producing silently wrong prompts downstream.

Details

Sourceentries/2026/05/11/tests-test_derive.md