pub fn validate_thread_id(value: &str) -> Result<(), ThreadIdError>Expand description
The single rule for thread-id validity. A valid id is non-empty, made up
only of the safe slug set (ASCII alphanumerics plus _ - . / @ : + =), has
no .. segment, and does not begin with /. This is deliberately the same
safe set the shell quoting rule treats as needing no quoting, so a valid
thread id is always a single shell token: feature/x, v1.2, my-thread,
and team@scope are accepted; spaces, quotes, ;, |, $, &, *,
backticks, and newlines are rejected. Thread ids flow into worktree paths,
so .. and a leading / are rejected to keep them in-tree. A leading -
is also rejected: it is in the safe set (for my-thread) but a breadcrumb
like heddle land --thread -foo parses -foo as a flag, not the value.