While working for an employer if one modifies, rewrites, contributes or alters open source software in what cases can it ever be considered a trade secret?
A trade secret, FWIW, is defined by wikipedia as:
A trade secret is a formula, practice, process, design, instrument,
pattern, or compilation of information which is not generally known or
reasonably ascertainable, by which a business can obtain an economic
advantage over competitors or customers. In some jurisdictions, such
secrets are referred to as "confidential information", but should not
be referred to as "classified information", due to the nature of the
word in the USA.