code: def check_version_order(
      config: Config, system: System
  ) -> ActionReturn:
      try:
          out = system.run(
              "git for-each-ref --sort=-taggerdate --format '%(tag)' refs/tags"
          )
          tags = [x.strip("'\"") for x in out.split("\n")]
  
          if all(
              V(config.version) > V(tag)
              for tag in tags
              if tag.startswith(config.release_level)
          ):
              return PASSED(
                  f"Version {config.version!r} is newer than any tag at release level {config.release_level!r}"
              )
          else:
              return FAILED(
                  f"Version {config.version!r} is older than an existing tag at release level {config.release_level!r}"
              )
  
      except RuntimeError as e:
          return FAILED(
              "Could compare tag version order", details=e.args
          )
  
imports: from __future__ import annotations
  import json
  import os
  from pathlib import Path
  from packaging.version import Version
  from .action import FAILED, PASSED, ActionReturn
  from .config import Config
  from .pipeline import StepType
  from .system import System
  from .util import skip_for_prerelease
label_desc: Use image node_id 9 for calling a global function with example usage: check_version_order(config, system) and returns: PASSED, FAILED, FAILED