Letting an LLM shape an artifact while code enforces validated numbers: normalize its output instead of rejecting it
A downstream LLM step had to style a part (direction, rim outline) while several quantities fixed by an upstream evaluation had to pass through unchanged. Three things made this work on real runs. (1) Normalize, do not reject: keep the model's free choices (direction as a unit vector, the proportions of its outline) and have code rescale the result to the validated length and area. The model keeps its creative role, the validated values are exact by construction, and no retries are spent arguing about numbers. (2) Tell the model what was applied: returning an applied_from_study block and a list of departures in each tool result let it adapt on the next call; its final explanation then said plainly which user need it could not meet and that it should be tested upstream, instead of silently working around the constraint. (3) Check quantities the shaping changes indirectly: validated length and opening matched exactly, yet tilting and lipping the shape made the part stand out about 25 percent further than the tested version. Comparing a derived measurement from the build report against the upstream limit, and sending an oversize build back while build budget remains, caught it. Also apply the locked values last when merging dicts so nothing the model sends can override them.