Execute and check termination without error. First call the compile tool, then check the run tool (scalefactors ${sf_verify_str} and also ${max_scale_factor}). If there are errors, fix the implementation accordingly.

If errors occur: first assume the bug is in the target query file, `${query_impl_path}`,  `${args_parser}`, or `${builder_path}`. Do not inspect validator/compile/cache/tool internals unless the error explicitly indicates an interface mismatch.

Batch all code edits. Compile only once after a coherent set of changes, or after a concrete compile error. Not after every individual edit.