Compile-time validation for NSID strings (the dxn: prefix is absent here).
Checks two rules expressible with template literal types:
Three-segment minimum (at least two dots) for names that are fully known at
compile time — matches the runtime grammar in DXN_SPEC_REGEXP and
parse.
Final segment (after the last dot) is a valid Segment.
The three-segment minimum only applies once Head (the portion before the
first dot) resolves to a concrete literal, so a fully literal two-segment
name like a.b is rejected. Template-literal call sites whose prefix is a
runtime string (e.g. `${meta.key}.event`) can't be proven to have
enough segments at compile time — Head there infers as string itself —
so only the known final segment is checked; the rest is validated at
runtime by the regex inside parse.
Compile-time validation for NSID strings (the
dxn:prefix is absent here).Checks two rules expressible with template literal types:
parse.The three-segment minimum only applies once
Head(the portion before the first dot) resolves to a concrete literal, so a fully literal two-segment name likea.bis rejected. Template-literal call sites whose prefix is a runtimestring(e.g.`${meta.key}.event`) can't be proven to have enough segments at compile time —Headthere infers asstringitself — so only the known final segment is checked; the rest is validated at runtime by the regex insideparse.