validate_filename, which checks that a candidate output filename
contains only safe characters (alphanumeric, underscores, hyphens, periods, and
spaces) and falls within a reasonable length limit. Used to prevent path-traversal
or shell-injection issues when writing decomposition output files.
Functions
FUNC validate_filename
candidate_str: The filename candidate to validate.
Trueif the string is a safe, valid filename;Falseotherwise.