()
| 838 | |
| 839 | |
| 840 | def build_parser() -> argparse.ArgumentParser: |
| 841 | parser = argparse.ArgumentParser( |
| 842 | prog="run_compare", |
| 843 | description=__doc__, |
| 844 | formatter_class=argparse.RawDescriptionHelpFormatter, |
| 845 | ) |
| 846 | sub = parser.add_subparsers(dest="command", required=True) |
| 847 | |
| 848 | # ---- prepare ---- |
| 849 | p_prep = sub.add_parser("prepare", help="Build openclaude and the SWE-bench text dataset.") |
| 850 | _add_common_path_args(p_prep) |
| 851 | _add_dataset_args(p_prep) |
| 852 | p_prep.add_argument( |
| 853 | "--skip-openclaude-build", |
| 854 | action="store_true", |
| 855 | help="Don't try to bun install / bun run build inside openclaude.", |
| 856 | ) |
| 857 | p_prep.set_defaults(func=cmd_prepare) |
| 858 | |
| 859 | # ---- run ---- |
| 860 | p_run = sub.add_parser("run", help="Run predictions + harness for both agents.") |
| 861 | _add_common_path_args(p_run) |
| 862 | _add_dataset_args(p_run) |
| 863 | p_run.add_argument( |
| 864 | "--clawcodex-repo", |
| 865 | default=None, |
| 866 | help="Path to clawcodex/ (default: this repo). Forwarded as CLAWCODEX_REPO.", |
| 867 | ) |
| 868 | p_run.add_argument( |
| 869 | "--agents", |
| 870 | default="clawcodex,openclaude", |
| 871 | help="Comma-separated list of agents to run (default: both).", |
| 872 | ) |
| 873 | p_run.add_argument( |
| 874 | "--scope", |
| 875 | choices=("smoke", "instances", "all"), |
| 876 | default="smoke", |
| 877 | help="Run scope (default: smoke).", |
| 878 | ) |
| 879 | p_run.add_argument( |
| 880 | "--smoke-instances", |
| 881 | nargs="*", |
| 882 | default=None, |
| 883 | help=f"Override smoke instance list (default: {DEFAULT_SMOKE_INSTANCES}).", |
| 884 | ) |
| 885 | p_run.add_argument( |
| 886 | "--instance-ids", |
| 887 | default="", |
| 888 | help="Comma-separated instance ids when --scope=instances.", |
| 889 | ) |
| 890 | preset_help = "; ".join( |
| 891 | f"'{name}': {p.description}" for name, p in PROVIDER_PRESETS.items() |
| 892 | ) |
| 893 | p_run.add_argument( |
| 894 | "--provider", |
| 895 | choices=sorted(PROVIDER_PRESETS), |
| 896 | default=DEFAULT_PROVIDER_PRESET, |
| 897 | help=( |
no test coverage detected