enforce ID length limits to guard against buffer overflows
some wkspace_alloc() usage standardization