From 1f8e155cddd0bb895169caa134ac6befee44fc09 Mon Sep 17 00:00:00 2001 From: "kapil.madan" Date: Sun, 30 Aug 2026 13:12:21 +0530 Subject: [PATCH] fix(cli): remove --evaluators, which never affected a run aicertify_app_for_policy derives the evaluator set from the RequiredMetrics the selected policies declare: it calls discover_evaluators(metrics) and runs what that returns. _run_evaluate accepted an evaluators argument and did not forward it, so a value supplied on the command line reached nothing. The parser accepted the flag, argparse bound it, and the run proceeded identically. Wiring it through was considered and rejected. Restricting the evaluator set below what a policy requires leaves that policy's metric absent from the OPA input, and an absent metric is not a failed one: a rule that reads it goes undefined and its default stands. A flag whose plain meaning is "run fewer evaluators" would therefore turn a policy that should deny into one that reports no obstacle, which is a worse outcome than the flag doing nothing. Selecting evaluators explicitly remains available on evaluate_by_policy for callers using the API directly. Removing the registration rather than warning on it makes the change visible at the point of use. `aicertify evaluate --evaluators Fairness` now exits 2 with "unrecognized arguments" instead of accepting the flag and ignoring it. Nothing depended on its effect, because it had none; only its acceptance changes. #90 removed the flag from the documented options at the same time. Every other flag the parser registers was checked: all sixteen have a destination that is read. --evaluators was the only one that did not. --- aicertify/cli.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/aicertify/cli.py b/aicertify/cli.py index 959412d..33a9cbb 100644 --- a/aicertify/cli.py +++ b/aicertify/cli.py @@ -32,7 +32,6 @@ async def _run_evaluate( policy_folder: str, output_dir: Optional[str] = None, report_format: str = "pdf", - evaluators: Optional[list] = None, custom_params: Optional[Dict[str, Any]] = None, ) -> Dict[str, Any]: """Run a contract evaluation using the existing API.""" @@ -80,7 +79,6 @@ def _cmd_evaluate(args: argparse.Namespace) -> int: policy_folder=args.policy, output_dir=args.output_dir, report_format=args.report_format, - evaluators=args.evaluators, custom_params=custom_params, ) ) @@ -348,11 +346,6 @@ def _build_parser() -> argparse.ArgumentParser: default="pdf", help="Report format (default: pdf)", ) - ev.add_argument( - "--evaluators", - nargs="+", - help="Specific evaluators to use (space-separated list)", - ) ev.add_argument( "--params", help="JSON string or path to JSON file with custom OPA parameters",