• Build the "unrecognized retired type" error message for a single document, or null when the document is not a legacy trait (#651). Pure and Foundry-free so it can be unit-tested.

    The trait item type was retired and is deliberately not auto-converted: a surviving trait document is flagged as unrecognized so the GM resolves it by hand (delete it, or recreate the data as a trauma/attribute), never silently transformed or deleted by the system.

    A legacy trait is detected by its stored type on either type (Foundry keeps the type) or _source.type (Foundry fell the document back to base but preserved the original type in its source) — so the check fires whichever way the client loads an unregistered-type document.

    Parameters

    • item:
          | undefined
          | null
          | {
              _source?: { type?: string };
              id?: string;
              name?: string;
              type?: string;
          }

      The document to check (its stored type / _source.type, plus name / id for the message).

    Returns string | null

    The error message, or null when item is not a retired trait.