88import logging
99from collections .abc import Sequence
1010from pathlib import Path
11+ from typing import TYPE_CHECKING
1112
12- from rewardharness import __version__
13- from rewardharness .benchmark import run_benchmark
14- from rewardharness .clients .endpoints import EndpointPool
15- from rewardharness .config import RewardHarnessConfig
16- from rewardharness .evaluation .engine import SUBAGENT_MODEL , SubAgent
17- from rewardharness .evaluation .router import Router
18- from rewardharness .evolution .pipeline import SelfEvolutionPipeline
19- from rewardharness .library import Library
13+ from rewardharness ._version import __version__
2014from rewardharness .paths import PROJECT_ROOT , default_endpoints_path , default_library_path
15+ from rewardharness .release import ReleaseIdentity
16+
17+ if TYPE_CHECKING :
18+ from rewardharness .config import RewardHarnessConfig
2119
2220
2321def _path (value : str ) -> Path :
@@ -41,6 +39,7 @@ def build_parser() -> argparse.ArgumentParser:
4139 subparsers = parser .add_subparsers (dest = "command" , required = True )
4240
4341 subparsers .add_parser ("check" , help = "validate local credentials and endpoints" )
42+ subparsers .add_parser ("release-status" , help = "show canonical package and release identifiers" )
4443
4544 inspect_parser = subparsers .add_parser ("inspect" , help = "inspect a Library registry" )
4645 inspect_parser .add_argument ("--library-dir" , default = str (default_library_path ()))
@@ -68,10 +67,14 @@ def build_parser() -> argparse.ArgumentParser:
6867
6968
7069def _load_config (path : str ) -> RewardHarnessConfig :
70+ from rewardharness .config import RewardHarnessConfig
71+
7172 return RewardHarnessConfig .from_yaml (_path (path ))
7273
7374
7475def _inspect (library_dir : str , validate : bool = False ) -> int :
76+ from rewardharness .library import Library
77+
7578 library = Library (str (_path (library_dir )))
7679 if validate :
7780 for name in library .registry :
@@ -81,6 +84,8 @@ def _inspect(library_dir: str, validate: bool = False) -> int:
8184
8285
8386def _evolve (args : argparse .Namespace ) -> int :
87+ from rewardharness .evolution .pipeline import SelfEvolutionPipeline
88+
8489 config = _load_config (args .config )
8590 pipeline = SelfEvolutionPipeline (config , args .library_dir , args .results_dir )
8691 iterations = args .max_iters or config .evolution .max_iterations
@@ -92,12 +97,19 @@ def _evolve(args: argparse.Namespace) -> int:
9297
9398
9499def _benchmark (args : argparse .Namespace ) -> int :
100+ from rewardharness .benchmark import run_benchmark
101+
95102 config = _load_config (args .config )
96103 run_benchmark (config .to_legacy_dict (), args .library_dir , args .results_dir )
97104 return 0
98105
99106
100107def _score_pair (args : argparse .Namespace ) -> int :
108+ from rewardharness .clients .endpoints import EndpointPool
109+ from rewardharness .evaluation .engine import SUBAGENT_MODEL , SubAgent
110+ from rewardharness .evaluation .router import Router
111+ from rewardharness .library import Library
112+
101113 library = Library (str (_path (args .library_dir )))
102114 context = Router (library ).prepare_context (args .prompt )
103115 pool = EndpointPool (endpoints_file = str (_path (args .endpoints )))
@@ -126,6 +138,9 @@ def main(argv: Sequence[str] | None = None) -> int:
126138 from rewardharness .diagnostics import main as diagnostics_main
127139
128140 return diagnostics_main ()
141+ if args .command == "release-status" :
142+ print (json .dumps (ReleaseIdentity .current ().to_dict (), indent = 2 , sort_keys = True ))
143+ return 0
129144 if args .command == "inspect" :
130145 return _inspect (args .library_dir )
131146 if args .command == "validate-library" :
0 commit comments