Render the complete fragment: an optional specialization block, then the runtime-state block. Returns an empty string if nothing was supplied, so callers can skip appending an empty message.
Render just the three state sections, unwrapped, in the system-prompt template's shape. Exposed so the snapshot test can compare it against the template's own rendering.
Builds the trailing-message fragment for the loop agent's volatile state.
Pure: no I/O, no framework dependencies. The caller (BaseAgent's prompt-execution prep) resolves the strings and decides which blocks to include; this class only renders them.