You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RainTitle validator message claims 'alphanumeric ASCII letters and spaces' but the regex accepts all printable ASCII and rejects edge spaces #236
RainTitle's validator message (crates/cli/src/meta/types/common/v1.rs:47-53 at bba50a7) reads:
Must be alphanumeric ASCII letters and spaces.
Neither the regex nor the doc comment agrees with that message. REGEX_RAIN_TITLE (lines 21-25) is:
/// Titles in Rain are limited to printable ASCII chars and the space character./// The title MUST NOT begin or end with a space.Regex::new(r"^[!-~]([ -~]*[!-~]|[!-~]*)$")
Actual accepted language: any printable ASCII (letters, digits, punctuation — "#1: hello!" is valid), interior spaces allowed, no leading/trailing space, non-empty. The message a user sees on rejection claims a much narrower contract ("alphanumeric letters and spaces") and omits the real constraints that most often trigger rejection (leading/trailing space, empty string).
Fix is a one-line message change, e.g. "Must be printable ASCII, not beginning or ending with a space." — or, if the message reflects the intended contract, the regex is too loose instead.
Found during round-2 adversarial mutation testing.
Activity