agentinputlab 0.1.0a1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentinputlab/__init__.py +28 -0
- agentinputlab/algorithms/__init__.py +6 -0
- agentinputlab/algorithms/acquire/__init__.py +145 -0
- agentinputlab/algorithms/acquire/adaptive_rag/__init__.py +43 -0
- agentinputlab/algorithms/acquire/adaptive_rag/replay.py +367 -0
- agentinputlab/algorithms/acquire/adaptive_rag/runtime.py +1202 -0
- agentinputlab/algorithms/acquire/adaptive_rag_common_support.py +542 -0
- agentinputlab/algorithms/acquire/hyde.py +296 -0
- agentinputlab/algorithms/acquire/hyde_controlled.py +200 -0
- agentinputlab/algorithms/acquire/hyde_external.py +148 -0
- agentinputlab/algorithms/acquire/ircot.py +28 -0
- agentinputlab/algorithms/acquire/ircot_common_support.py +478 -0
- agentinputlab/algorithms/acquire/ircot_native.py +355 -0
- agentinputlab/algorithms/acquire/ircot_replay.py +327 -0
- agentinputlab/algorithms/acquire/qrag/__init__.py +79 -0
- agentinputlab/algorithms/acquire/qrag/bridge.py +828 -0
- agentinputlab/algorithms/acquire/qrag/common_support.py +891 -0
- agentinputlab/algorithms/acquire/qrag/native_axis.py +71 -0
- agentinputlab/algorithms/acquire/qrag/reader_adapter.py +139 -0
- agentinputlab/algorithms/acquire/r2ag/__init__.py +57 -0
- agentinputlab/algorithms/acquire/r2ag/bridge.py +1312 -0
- agentinputlab/algorithms/acquire/r2ag/common_support.py +1029 -0
- agentinputlab/algorithms/acquire/r2ag/socket_runtime.py +255 -0
- agentinputlab/algorithms/clarify/__init__.py +61 -0
- agentinputlab/algorithms/clarify/_structured.py +64 -0
- agentinputlab/algorithms/clarify/active_task_disambiguation.py +371 -0
- agentinputlab/algorithms/clarify/ask_or_assume/__init__.py +17 -0
- agentinputlab/algorithms/clarify/ask_or_assume/monitor.py +410 -0
- agentinputlab/algorithms/clarify/future_turns.py +379 -0
- agentinputlab/algorithms/clarify/udcs.py +255 -0
- agentinputlab/algorithms/clarify/udcs_deterministic.py +196 -0
- agentinputlab/algorithms/curate/__init__.py +65 -0
- agentinputlab/algorithms/curate/acon/__init__.py +27 -0
- agentinputlab/algorithms/curate/acon/common.py +284 -0
- agentinputlab/algorithms/curate/acon/common_support.py +136 -0
- agentinputlab/algorithms/curate/acon/history_bridge.py +309 -0
- agentinputlab/algorithms/curate/acon/observation_bridge.py +290 -0
- agentinputlab/algorithms/curate/llmlingua/__init__.py +30 -0
- agentinputlab/algorithms/curate/llmlingua/adapters.py +537 -0
- agentinputlab/algorithms/curate/llmlingua/budget.py +48 -0
- agentinputlab/algorithms/curate/llmlingua/controlled.py +175 -0
- agentinputlab/algorithms/curate/llmlingua/multilingual.py +105 -0
- agentinputlab/algorithms/curate/llmlingua/span_map.py +167 -0
- agentinputlab/algorithms/curate/recomp/__init__.py +47 -0
- agentinputlab/algorithms/curate/recomp/external.py +1129 -0
- agentinputlab/algorithms/curate/recomp/selective.py +304 -0
- agentinputlab/algorithms/decompose/__init__.py +107 -0
- agentinputlab/algorithms/decompose/decomp/__init__.py +53 -0
- agentinputlab/algorithms/decompose/decomp/common_support.py +478 -0
- agentinputlab/algorithms/decompose/decomp/planner_component.py +199 -0
- agentinputlab/algorithms/decompose/decomp/worker_bridge.py +416 -0
- agentinputlab/algorithms/decompose/llm_compiler/__init__.py +35 -0
- agentinputlab/algorithms/decompose/llm_compiler/bridge.py +520 -0
- agentinputlab/algorithms/decompose/llm_compiler/common_support.py +504 -0
- agentinputlab/algorithms/decompose/plan_and_budget/__init__.py +43 -0
- agentinputlab/algorithms/decompose/plan_and_budget/cached_soft_budget.py +362 -0
- agentinputlab/algorithms/decompose/plan_and_budget/decomposer_component.py +107 -0
- agentinputlab/algorithms/decompose/plan_and_budget/full.py +205 -0
- agentinputlab/algorithms/decompose/plan_and_budget/hard_cap.py +246 -0
- agentinputlab/algorithms/decompose/plan_and_budget/regenerated_soft_budget.py +448 -0
- agentinputlab/algorithms/decompose/plan_and_solve/__init__.py +33 -0
- agentinputlab/algorithms/decompose/plan_and_solve/plan_component.py +192 -0
- agentinputlab/algorithms/decompose/plan_and_solve/ps_prompt.py +127 -0
- agentinputlab/algorithms/decompose/self_ask/__init__.py +27 -0
- agentinputlab/algorithms/decompose/self_ask/loop.py +362 -0
- agentinputlab/algorithms/decompose/self_ask/planner_component.py +117 -0
- agentinputlab/algorithms/reformulate/__init__.py +85 -0
- agentinputlab/algorithms/reformulate/infocqr/__init__.py +40 -0
- agentinputlab/algorithms/reformulate/infocqr/cache_replay.py +362 -0
- agentinputlab/algorithms/reformulate/infocqr/external.py +675 -0
- agentinputlab/algorithms/reformulate/infocqr/student.py +189 -0
- agentinputlab/algorithms/reformulate/query2doc/__init__.py +42 -0
- agentinputlab/algorithms/reformulate/query2doc/controlled_live.py +190 -0
- agentinputlab/algorithms/reformulate/query2doc/models.py +95 -0
- agentinputlab/algorithms/reformulate/query2doc/official_cached.py +335 -0
- agentinputlab/algorithms/reformulate/query2doc/querygym_bridge.py +223 -0
- agentinputlab/algorithms/reformulate/query2doc/querygym_runtime.py +326 -0
- agentinputlab/algorithms/reformulate/reformer/__init__.py +23 -0
- agentinputlab/algorithms/reformulate/reformer/external.py +417 -0
- agentinputlab/algorithms/reformulate/rrr.py +696 -0
- agentinputlab/annotation/__init__.py +5 -0
- agentinputlab/annotation/independent.py +428 -0
- agentinputlab/annotation/server.py +233 -0
- agentinputlab/annotation/static/app.js +121 -0
- agentinputlab/annotation/static/index.html +60 -0
- agentinputlab/annotation/static/review.css +2 -0
- agentinputlab/annotation/static/review.html +10 -0
- agentinputlab/annotation/static/review.js +11 -0
- agentinputlab/annotation/static/styles.css +55 -0
- agentinputlab/annotation/store.py +444 -0
- agentinputlab/api.py +368 -0
- agentinputlab/artifacts/__init__.py +15 -0
- agentinputlab/artifacts/json_file.py +104 -0
- agentinputlab/artifacts/manifest.py +98 -0
- agentinputlab/artifacts/store.py +157 -0
- agentinputlab/backends/__init__.py +98 -0
- agentinputlab/backends/embedding/__init__.py +25 -0
- agentinputlab/backends/embedding/base.py +145 -0
- agentinputlab/backends/embedding/callable.py +75 -0
- agentinputlab/backends/embedding/replay.py +129 -0
- agentinputlab/backends/llm/__init__.py +31 -0
- agentinputlab/backends/llm/base.py +149 -0
- agentinputlab/backends/llm/callable.py +108 -0
- agentinputlab/backends/llm/decomp_completion.py +88 -0
- agentinputlab/backends/llm/final_content_stop.py +72 -0
- agentinputlab/backends/llm/gpt_oss_final_channel.py +84 -0
- agentinputlab/backends/llm/openai_compatible.py +332 -0
- agentinputlab/backends/llm/transformers.py +171 -0
- agentinputlab/backends/retrieval/__init__.py +35 -0
- agentinputlab/backends/retrieval/base.py +50 -0
- agentinputlab/backends/retrieval/dense.py +777 -0
- agentinputlab/backends/retrieval/memory.py +119 -0
- agentinputlab/backends/retrieval/sqlite_fts.py +155 -0
- agentinputlab/backends/user/__init__.py +15 -0
- agentinputlab/backends/user/base.py +66 -0
- agentinputlab/backends/user/callable.py +54 -0
- agentinputlab/backends/user/replay.py +89 -0
- agentinputlab/backends/vector.py +38 -0
- agentinputlab/benchmarks/__init__.py +246 -0
- agentinputlab/benchmarks/acquisition.py +106 -0
- agentinputlab/benchmarks/ale.py +540 -0
- agentinputlab/benchmarks/appworld_ul.py +669 -0
- agentinputlab/benchmarks/assets.py +226 -0
- agentinputlab/benchmarks/base.py +68 -0
- agentinputlab/benchmarks/beir_archive.py +235 -0
- agentinputlab/benchmarks/beir_sample.py +269 -0
- agentinputlab/benchmarks/bfcl_native.py +245 -0
- agentinputlab/benchmarks/bfcl_v3.py +607 -0
- agentinputlab/benchmarks/cache.py +218 -0
- agentinputlab/benchmarks/clariq.py +203 -0
- agentinputlab/benchmarks/data/registry.json +321 -0
- agentinputlab/benchmarks/data/smoke_assets.json +511 -0
- agentinputlab/benchmarks/data/statebench_v0_8_1_task_ids.json +475 -0
- agentinputlab/benchmarks/data/toolsandbox_165848b_scenario_names.json +1 -0
- agentinputlab/benchmarks/execution.py +1111 -0
- agentinputlab/benchmarks/interactive.py +257 -0
- agentinputlab/benchmarks/ir_query.py +204 -0
- agentinputlab/benchmarks/longbench.py +203 -0
- agentinputlab/benchmarks/paired_replay.py +479 -0
- agentinputlab/benchmarks/preprocess.py +2313 -0
- agentinputlab/benchmarks/production.py +236 -0
- agentinputlab/benchmarks/qa.py +963 -0
- agentinputlab/benchmarks/registry.py +110 -0
- agentinputlab/benchmarks/retrieval.py +459 -0
- agentinputlab/benchmarks/runtime.py +509 -0
- agentinputlab/benchmarks/statebench.py +938 -0
- agentinputlab/benchmarks/tau3.py +725 -0
- agentinputlab/benchmarks/toolsandbox.py +626 -0
- agentinputlab/benchmarks/trec_dl_sample.py +263 -0
- agentinputlab/campaign.py +654 -0
- agentinputlab/campaign_runner.py +953 -0
- agentinputlab/cli/__init__.py +6 -0
- agentinputlab/cli/main.py +933 -0
- agentinputlab/connectors/__init__.py +46 -0
- agentinputlab/connectors/knowledge/__init__.py +4 -0
- agentinputlab/connectors/tools/__init__.py +30 -0
- agentinputlab/connectors/tools/base.py +57 -0
- agentinputlab/connectors/tools/mcp.py +222 -0
- agentinputlab/connectors/tools/memory.py +41 -0
- agentinputlab/connectors/tools/openapi.py +695 -0
- agentinputlab/connectors/tools/schema.py +102 -0
- agentinputlab/contracts/__init__.py +91 -0
- agentinputlab/contracts/availability.py +24 -0
- agentinputlab/contracts/dependency.py +58 -0
- agentinputlab/contracts/enums.py +82 -0
- agentinputlab/contracts/errors.py +63 -0
- agentinputlab/contracts/evidence.py +43 -0
- agentinputlab/contracts/intent.py +110 -0
- agentinputlab/contracts/lifecycle.py +164 -0
- agentinputlab/contracts/patch.py +167 -0
- agentinputlab/contracts/serialization.py +93 -0
- agentinputlab/contracts/state.py +127 -0
- agentinputlab/contracts/trace.py +59 -0
- agentinputlab/contracts/worker.py +42 -0
- agentinputlab/core/__init__.py +7 -0
- agentinputlab/data/__init__.py +32 -0
- agentinputlab/data/checksums.py +9 -0
- agentinputlab/data/downloader.py +235 -0
- agentinputlab/data/http.py +171 -0
- agentinputlab/data/index.py +21 -0
- agentinputlab/data/overlap.py +28 -0
- agentinputlab/data/preprocess.py +32 -0
- agentinputlab/data/storage.py +57 -0
- agentinputlab/data/trec_sample.py +427 -0
- agentinputlab/evaluation/__init__.py +5 -0
- agentinputlab/evaluation/outcomes.py +32 -0
- agentinputlab/experiments/__init__.py +278 -0
- agentinputlab/experiments/analysis.py +981 -0
- agentinputlab/experiments/artifacts.py +687 -0
- agentinputlab/experiments/automatic_measurement.py +678 -0
- agentinputlab/experiments/auxiliary_matrix.py +203 -0
- agentinputlab/experiments/bindings.py +430 -0
- agentinputlab/experiments/blueprints.py +147 -0
- agentinputlab/experiments/builders/__init__.py +45 -0
- agentinputlab/experiments/builders/executable_external_payload.py +423 -0
- agentinputlab/experiments/builders/external_process_arena.py +1018 -0
- agentinputlab/experiments/builders/registry_intervention.py +463 -0
- agentinputlab/experiments/cli.py +158 -0
- agentinputlab/experiments/controls.py +340 -0
- agentinputlab/experiments/driver_guard.py +205 -0
- agentinputlab/experiments/drivers/__init__.py +89 -0
- agentinputlab/experiments/drivers/external_arena.py +2908 -0
- agentinputlab/experiments/drivers/method_process.py +662 -0
- agentinputlab/experiments/drivers/parity_process.py +1484 -0
- agentinputlab/experiments/drivers/static_production.py +1574 -0
- agentinputlab/experiments/executor.py +448 -0
- agentinputlab/experiments/loader.py +605 -0
- agentinputlab/experiments/measurement.py +675 -0
- agentinputlab/experiments/paper_analysis.py +1818 -0
- agentinputlab/experiments/parity_identity.py +605 -0
- agentinputlab/experiments/plan.py +277 -0
- agentinputlab/experiments/production_builders.py +3739 -0
- agentinputlab/experiments/readiness.py +432 -0
- agentinputlab/experiments/schema.py +514 -0
- agentinputlab/experiments/secrets.py +177 -0
- agentinputlab/experiments/stateful_analysis.py +1738 -0
- agentinputlab/experiments/transfer_analysis.py +1316 -0
- agentinputlab/experiments/unseen_analysis.py +1025 -0
- agentinputlab/integrations/__init__.py +1 -0
- agentinputlab/integrations/action_space/__init__.py +1 -0
- agentinputlab/integrations/external_workers/__init__.py +76 -0
- agentinputlab/integrations/external_workers/ace.py +431 -0
- agentinputlab/integrations/external_workers/base.py +181 -0
- agentinputlab/integrations/external_workers/decomp_live.py +249 -0
- agentinputlab/integrations/external_workers/decomp_planner.py +30 -0
- agentinputlab/integrations/external_workers/infocqr_student.py +280 -0
- agentinputlab/integrations/external_workers/ircot.py +576 -0
- agentinputlab/integrations/external_workers/llmcompiler_live.py +360 -0
- agentinputlab/integrations/external_workers/longllmlingua.py +162 -0
- agentinputlab/integrations/external_workers/method.py +314 -0
- agentinputlab/integrations/external_workers/process.py +678 -0
- agentinputlab/integrations/external_workers/supervisor.py +1071 -0
- agentinputlab/integrations/full_architecture/__init__.py +1 -0
- agentinputlab/integrations/full_architecture/hyde.py +212 -0
- agentinputlab/integrations/full_architecture/plan_and_budget.py +188 -0
- agentinputlab/integrations/live_history.py +222 -0
- agentinputlab/integrations/prompt_optimization/__init__.py +1 -0
- agentinputlab/integrations/training/__init__.py +1 -0
- agentinputlab/metrics/__init__.py +50 -0
- agentinputlab/metrics/catalog.py +313 -0
- agentinputlab/metrics/harm.py +95 -0
- agentinputlab/metrics/paired.py +40 -0
- agentinputlab/metrics/qa.py +76 -0
- agentinputlab/metrics/text.py +33 -0
- agentinputlab/metrics/third_party.py +161 -0
- agentinputlab/models/__init__.py +4 -0
- agentinputlab/observability/__init__.py +56 -0
- agentinputlab/observability/budget.py +316 -0
- agentinputlab/observability/instrumentation.py +754 -0
- agentinputlab/observability/models.py +403 -0
- agentinputlab/observability/monitor.py +380 -0
- agentinputlab/optimizers/__init__.py +1 -0
- agentinputlab/optimizers/clarify/__init__.py +12 -0
- agentinputlab/optimizers/context/__init__.py +22 -0
- agentinputlab/optimizers/decompose/__init__.py +64 -0
- agentinputlab/optimizers/evidence/__init__.py +22 -0
- agentinputlab/optimizers/rewrite/__init__.py +30 -0
- agentinputlab/parity/__init__.py +5 -0
- agentinputlab/parity/base.py +206 -0
- agentinputlab/production_campaign.py +763 -0
- agentinputlab/py.typed +1 -0
- agentinputlab/recipes/__init__.py +333 -0
- agentinputlab/recipes/ace.py +418 -0
- agentinputlab/recipes/ace_bfcl.py +273 -0
- agentinputlab/recipes/ace_common_support.py +169 -0
- agentinputlab/recipes/ace_native_plan.py +322 -0
- agentinputlab/recipes/ace_online.py +711 -0
- agentinputlab/recipes/ace_retrieval.py +330 -0
- agentinputlab/recipes/ace_statebench.py +382 -0
- agentinputlab/recipes/ace_tau.py +463 -0
- agentinputlab/recipes/ace_toolsandbox.py +432 -0
- agentinputlab/recipes/acon_guideline.py +22 -0
- agentinputlab/recipes/adaptive_rag.py +822 -0
- agentinputlab/recipes/llmlingua2_inference.py +146 -0
- agentinputlab/recipes/llmlingua2_training.py +796 -0
- agentinputlab/recipes/mce.py +1486 -0
- agentinputlab/recipes/mce_final.py +335 -0
- agentinputlab/recipes/mce_text_fit.py +499 -0
- agentinputlab/recipes/mce_text_only.py +298 -0
- agentinputlab/recipes/qrag.py +729 -0
- agentinputlab/recipes/qrag_inference.py +364 -0
- agentinputlab/recipes/r2ag_features.py +236 -0
- agentinputlab/recipes/r2ag_inference.py +503 -0
- agentinputlab/recipes/r2ag_training.py +948 -0
- agentinputlab/recipes/recomp_abstractive.py +592 -0
- agentinputlab/recipes/recomp_extractive.py +525 -0
- agentinputlab/recipes/reformer.py +17 -0
- agentinputlab/recipes/rqrag.py +1516 -0
- agentinputlab/recipes/rqrag_common_support.py +193 -0
- agentinputlab/recipes/rqrag_completion.py +147 -0
- agentinputlab/recipes/skillopt.py +462 -0
- agentinputlab/recipes/skillopt_common_support.py +154 -0
- agentinputlab/recipes/skillopt_environment.py +165 -0
- agentinputlab/recipes/skillopt_environment_cli.py +5 -0
- agentinputlab/recipes/skillopt_retrieval.py +188 -0
- agentinputlab/recipes/smartsearch.py +897 -0
- agentinputlab/recipes/smartsearch_curriculum.py +283 -0
- agentinputlab/recipes/smartsearch_grpo_contracts.py +58 -0
- agentinputlab/recipes/smartsearch_grpo_data.py +314 -0
- agentinputlab/recipes/smartsearch_grpo_meter.py +324 -0
- agentinputlab/recipes/smartsearch_grpo_prefix.py +144 -0
- agentinputlab/recipes/smartsearch_grpo_rollout.py +119 -0
- agentinputlab/recipes/smartsearch_grpo_tools.py +364 -0
- agentinputlab/recipes/smartsearch_grpo_training.py +305 -0
- agentinputlab/recipes/smartsearch_grpo_transport.py +248 -0
- agentinputlab/recipes/smartsearch_grpo_worker.py +364 -0
- agentinputlab/recipes/smartsearch_inference.py +524 -0
- agentinputlab/recipes/smartsearch_native_data.py +172 -0
- agentinputlab/recipes/smartsearch_policy.py +616 -0
- agentinputlab/recipes/smartsearch_policy_worker.py +9 -0
- agentinputlab/recipes/smartsearch_sampling.py +232 -0
- agentinputlab/recipes/smartsearch_teacher.py +203 -0
- agentinputlab/recipes/smartsearch_training.py +265 -0
- agentinputlab/registry/__init__.py +46 -0
- agentinputlab/registry/beta.py +727 -0
- agentinputlab/registry/data/algorithms.json +1959 -0
- agentinputlab/registry/data/auxiliary_method_profiles.json +34 -0
- agentinputlab/registry/loader.py +100 -0
- agentinputlab/registry/result_manifest.py +184 -0
- agentinputlab/registry/runtime.py +195 -0
- agentinputlab/registry/schema.py +449 -0
- agentinputlab/runner/__init__.py +30 -0
- agentinputlab/runner/balance.py +248 -0
- agentinputlab/runner/cache.py +135 -0
- agentinputlab/runner/composite.py +130 -0
- agentinputlab/runner/engine.py +285 -0
- agentinputlab/runner/runtime_guard.py +268 -0
- agentinputlab/runner/worker.py +80 -0
- agentinputlab/runtime_bootstrap.py +288 -0
- agentinputlab/selectors/__init__.py +196 -0
- agentinputlab/selectors/advanced.py +1514 -0
- agentinputlab/selectors/artifacts.py +1087 -0
- agentinputlab/selectors/base.py +112 -0
- agentinputlab/selectors/campaigns.py +1893 -0
- agentinputlab/selectors/catalog.py +86 -0
- agentinputlab/selectors/discovery.py +1860 -0
- agentinputlab/selectors/evaluation.py +1348 -0
- agentinputlab/selectors/features.py +383 -0
- agentinputlab/selectors/learned.py +502 -0
- agentinputlab/selectors/no_op.py +28 -0
- agentinputlab/selectors/outcome_table.py +475 -0
- agentinputlab/selectors/producer.py +853 -0
- agentinputlab/selectors/rules.py +109 -0
- agentinputlab/selectors/runtime.py +420 -0
- agentinputlab/studies/__init__.py +16 -0
- agentinputlab/studies/design.py +165 -0
- agentinputlab/studies/paired.py +322 -0
- agentinputlab/studio/__init__.py +6 -0
- agentinputlab/studio/campaigns.py +819 -0
- agentinputlab/studio/engine.py +1408 -0
- agentinputlab/studio/model_backends.py +425 -0
- agentinputlab/studio/prepared.py +410 -0
- agentinputlab/studio/server.py +613 -0
- agentinputlab/studio/static/app.js +397 -0
- agentinputlab/studio/static/campaigns.html +175 -0
- agentinputlab/studio/static/campaigns.js +426 -0
- agentinputlab/studio/static/index.html +192 -0
- agentinputlab/studio/static/result.html +103 -0
- agentinputlab/studio/static/result.js +273 -0
- agentinputlab/studio/static/styles.css +467 -0
- agentinputlab-0.1.0a1.data/data/share/agentinputlab/CITATION.cff +22 -0
- agentinputlab-0.1.0a1.dist-info/METADATA +392 -0
- agentinputlab-0.1.0a1.dist-info/RECORD +469 -0
- agentinputlab-0.1.0a1.dist-info/WHEEL +5 -0
- agentinputlab-0.1.0a1.dist-info/entry_points.txt +6 -0
- agentinputlab-0.1.0a1.dist-info/licenses/LICENSE +21 -0
- agentinputlab-0.1.0a1.dist-info/licenses/NOTICE +31 -0
- agentinputlab-0.1.0a1.dist-info/licenses/THIRD_PARTY_NOTICES.md +94 -0
- agentinputlab-0.1.0a1.dist-info/top_level.txt +2 -0
- workers/README.md +94 -0
- workers/ace/README.md +261 -0
- workers/ace/__init__.py +1 -0
- workers/ace/compatibility_manifest.json +39 -0
- workers/ace/driver.py +1682 -0
- workers/acon/README.md +215 -0
- workers/acon/__init__.py +5 -0
- workers/acon/compatibility_manifest.json +93 -0
- workers/acon/driver.py +1859 -0
- workers/acon/fitted.py +395 -0
- workers/acon/guideline.py +470 -0
- workers/acon/guideline_source_manifest.json +20 -0
- workers/adaptive_rag/README.md +96 -0
- workers/adaptive_rag/__init__.py +15 -0
- workers/adaptive_rag/compatibility_manifest.json +61 -0
- workers/adaptive_rag/driver.py +1470 -0
- workers/adaptive_rag/fixture_runtime.py +163 -0
- workers/adaptive_rag/runtime.py +252 -0
- workers/ask_or_assume/README.md +124 -0
- workers/ask_or_assume/__init__.py +1 -0
- workers/ask_or_assume/compatibility_manifest.json +36 -0
- workers/ask_or_assume/driver.py +1227 -0
- workers/decomp/README.md +133 -0
- workers/decomp/UPSTREAM_LICENSE.Apache-2.0.txt +201 -0
- workers/decomp/__init__.py +5 -0
- workers/decomp/compatibility_manifest.json +205 -0
- workers/decomp/driver.py +1015 -0
- workers/decomp/live.py +137 -0
- workers/decomp/runtime.py +231 -0
- workers/infocqr/README.md +106 -0
- workers/infocqr/__init__.py +1 -0
- workers/infocqr/compatibility_manifest.json +84 -0
- workers/infocqr/driver.py +1766 -0
- workers/ircot/README.md +167 -0
- workers/ircot/__init__.py +7 -0
- workers/ircot/compatibility_manifest.json +121 -0
- workers/ircot/controlled.py +457 -0
- workers/ircot/driver.py +1373 -0
- workers/ircot/fixture_bindings.json +39 -0
- workers/ircot/fixture_config.json +48 -0
- workers/ircot/fixture_prompt.txt +2 -0
- workers/ircot/native_qa.py +398 -0
- workers/ircot/qa_compatibility_manifest.json +57 -0
- workers/ircot/runtime.py +97 -0
- workers/llmcompiler/README.md +160 -0
- workers/llmcompiler/__init__.py +1 -0
- workers/llmcompiler/compatibility_manifest.json +45 -0
- workers/llmcompiler/driver.py +1514 -0
- workers/llmcompiler/export_prompts.py +74 -0
- workers/llmcompiler/live.py +174 -0
- workers/llmcompiler/patch_manifest.json +147 -0
- workers/mce/README.md +198 -0
- workers/mce/__init__.py +29 -0
- workers/mce/compatibility_manifest.json +115 -0
- workers/mce/driver.py +2585 -0
- workers/mce/final_eval.py +173 -0
- workers/official_arenas/README.md +25 -0
- workers/official_arenas/__init__.py +1 -0
- workers/official_arenas/capture_records.py +110 -0
- workers/official_arenas/driver.py +619 -0
- workers/official_arenas/protocol.py +334 -0
- workers/official_arenas/providers/__init__.py +1 -0
- workers/official_arenas/providers/_live_history.py +228 -0
- workers/official_arenas/providers/_message_compat.py +77 -0
- workers/official_arenas/providers/appworld_ul.py +196 -0
- workers/official_arenas/providers/fixture.py +112 -0
- workers/official_arenas/providers/statebench.py +960 -0
- workers/official_arenas/providers/tau3.py +1672 -0
- workers/official_arenas/providers/tau_retail.py +586 -0
- workers/official_arenas/providers/toolsandbox.py +1321 -0
- workers/official_arenas/providers/tooltalk.py +699 -0
- workers/official_arenas/retail_capture.py +188 -0
- workers/official_arenas/retail_driver.py +275 -0
- workers/qrag/README.md +172 -0
- workers/qrag/__init__.py +1 -0
- workers/qrag/compatibility_manifest.json +64 -0
- workers/qrag/driver.py +673 -0
- workers/r2ag/README.md +154 -0
- workers/r2ag/__init__.py +5 -0
- workers/r2ag/compatibility_manifest.json +55 -0
- workers/r2ag/driver.py +1287 -0
- workers/r2ag/feature_schema.json +8 -0
- workers/r2ag/runtime.py +589 -0
- workers/recomp/README.md +120 -0
- workers/recomp/__init__.py +1 -0
- workers/recomp/compatibility_manifest.json +43 -0
- workers/recomp/driver.py +1653 -0
- workers/reformer/README.md +125 -0
- workers/reformer/__init__.py +1 -0
- workers/reformer/compatibility_manifest.json +68 -0
- workers/reformer/driver.py +1459 -0
- workers/reformer/induction.py +457 -0
- workers/rrr/README.md +126 -0
- workers/rrr/__init__.py +1 -0
- workers/rrr/compatibility_manifest.json +57 -0
- workers/rrr/driver.py +1133 -0
- workers/smartsearch/README.md +331 -0
- workers/smartsearch/__init__.py +1 -0
- workers/smartsearch/compatibility_manifest.json +41 -0
- workers/smartsearch/driver.py +1643 -0
|
@@ -0,0 +1,933 @@
|
|
|
1
|
+
"""Dependency-free AgentInputLab command line interface."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
import sys
|
|
8
|
+
from collections.abc import Sequence
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from typing import Any
|
|
11
|
+
|
|
12
|
+
from agentinputlab.contracts.enums import ReleaseTier, SemanticFamily, SupportStatus
|
|
13
|
+
from agentinputlab.contracts.errors import AgentInputLabError, RegistryError
|
|
14
|
+
from agentinputlab.contracts.serialization import to_jsonable
|
|
15
|
+
from agentinputlab.registry import (
|
|
16
|
+
AlgorithmCard,
|
|
17
|
+
AlgorithmRegistry,
|
|
18
|
+
find_repository_registry,
|
|
19
|
+
load_packaged_registry,
|
|
20
|
+
load_registry_file,
|
|
21
|
+
validate_snapshot_sync,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _cmd_smoke(args: argparse.Namespace) -> int:
|
|
26
|
+
"""Run the dependency-free Query2doc to BM25 reference loop."""
|
|
27
|
+
|
|
28
|
+
from agentinputlab import FrozenAgentState, InterventionContext
|
|
29
|
+
from agentinputlab.algorithms.reformulate.query2doc import (
|
|
30
|
+
OfficialQuery2DocRow,
|
|
31
|
+
Query2DocCache,
|
|
32
|
+
Query2DocFixtureCached,
|
|
33
|
+
)
|
|
34
|
+
from agentinputlab.backends.retrieval import Document, InMemoryBM25Retriever
|
|
35
|
+
from agentinputlab.runner import InterventionRunner
|
|
36
|
+
|
|
37
|
+
state = FrozenAgentState(task_id="tiny-q1", query="capital france")
|
|
38
|
+
cache = Query2DocCache(
|
|
39
|
+
(
|
|
40
|
+
OfficialQuery2DocRow(
|
|
41
|
+
query_id="tiny-q1",
|
|
42
|
+
query=state.query,
|
|
43
|
+
pseudo_doc="Paris is the capital of France.",
|
|
44
|
+
split="tiny",
|
|
45
|
+
),
|
|
46
|
+
)
|
|
47
|
+
)
|
|
48
|
+
algorithm = Query2DocFixtureCached(cache, split="tiny")
|
|
49
|
+
record = InterventionRunner().run(
|
|
50
|
+
algorithm,
|
|
51
|
+
state,
|
|
52
|
+
InterventionContext(seed=0),
|
|
53
|
+
)
|
|
54
|
+
transformed = record.patch.apply(state)
|
|
55
|
+
retriever = InMemoryBM25Retriever(
|
|
56
|
+
(
|
|
57
|
+
Document(
|
|
58
|
+
doc_id="fr",
|
|
59
|
+
text="Paris is the capital of France.",
|
|
60
|
+
corpus_revision="synthetic-v1",
|
|
61
|
+
),
|
|
62
|
+
Document(
|
|
63
|
+
doc_id="de",
|
|
64
|
+
text="Berlin is the capital of Germany.",
|
|
65
|
+
corpus_revision="synthetic-v1",
|
|
66
|
+
),
|
|
67
|
+
)
|
|
68
|
+
)
|
|
69
|
+
results = retriever.retrieve(transformed.query, top_k=2)
|
|
70
|
+
payload = {
|
|
71
|
+
"ok": bool(results and results[0].document.doc_id == "fr"),
|
|
72
|
+
"offline": True,
|
|
73
|
+
"profile_kind": record.patch.profile_kind,
|
|
74
|
+
"release_id": algorithm.release_id,
|
|
75
|
+
"input_state_hash": record.input_state_hash,
|
|
76
|
+
"patch_hash": record.patch.patch_hash,
|
|
77
|
+
"top_document_id": results[0].document.doc_id if results else None,
|
|
78
|
+
}
|
|
79
|
+
if args.json:
|
|
80
|
+
_json_dump(payload)
|
|
81
|
+
else:
|
|
82
|
+
print(
|
|
83
|
+
"offline smoke: "
|
|
84
|
+
f"{'OK' if payload['ok'] else 'FAILED'} - "
|
|
85
|
+
f"{payload['release_id']} -> {payload['top_document_id']}"
|
|
86
|
+
)
|
|
87
|
+
return 0 if payload["ok"] else 1
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def _json_dump(value: Any) -> None:
|
|
91
|
+
print(json.dumps(value, ensure_ascii=False, indent=2, sort_keys=True))
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def _table(headers: Sequence[str], rows: Sequence[Sequence[str]]) -> str:
|
|
95
|
+
widths = [len(header) for header in headers]
|
|
96
|
+
for row in rows:
|
|
97
|
+
for index, cell in enumerate(row):
|
|
98
|
+
widths[index] = max(widths[index], len(cell))
|
|
99
|
+
lines = [
|
|
100
|
+
" ".join(header.ljust(widths[index]) for index, header in enumerate(headers)),
|
|
101
|
+
" ".join("-" * width for width in widths),
|
|
102
|
+
]
|
|
103
|
+
lines.extend(
|
|
104
|
+
" ".join(cell.ljust(widths[index]) for index, cell in enumerate(row)) for row in rows
|
|
105
|
+
)
|
|
106
|
+
return "\n".join(lines)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def _registry_from_argument(path: str | None) -> AlgorithmRegistry:
|
|
110
|
+
document = load_registry_file(path) if path else load_packaged_registry()
|
|
111
|
+
return AlgorithmRegistry(document)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def _cmd_list(args: argparse.Namespace) -> int:
|
|
115
|
+
registry = _registry_from_argument(args.registry)
|
|
116
|
+
if args.releases:
|
|
117
|
+
records = registry.list_releases(
|
|
118
|
+
family=args.family,
|
|
119
|
+
tier=args.tier,
|
|
120
|
+
status=args.status,
|
|
121
|
+
delivery_tier=args.delivery_tier,
|
|
122
|
+
)
|
|
123
|
+
if args.json:
|
|
124
|
+
_json_dump(
|
|
125
|
+
[
|
|
126
|
+
{
|
|
127
|
+
"method_id": method.method_id,
|
|
128
|
+
"display_name": method.display_name,
|
|
129
|
+
"semantic_family": method.semantic_family.value,
|
|
130
|
+
"release_tier": method.release_tier.value,
|
|
131
|
+
**release.to_dict(),
|
|
132
|
+
"entrypoint_available": release.entrypoint_available,
|
|
133
|
+
"runnable": release.runnable,
|
|
134
|
+
"availability": release.availability,
|
|
135
|
+
"blocker": release.blocker,
|
|
136
|
+
}
|
|
137
|
+
for method, release in records
|
|
138
|
+
]
|
|
139
|
+
)
|
|
140
|
+
return 0
|
|
141
|
+
rows = [
|
|
142
|
+
(
|
|
143
|
+
release.id,
|
|
144
|
+
method.display_name,
|
|
145
|
+
method.semantic_family.value,
|
|
146
|
+
release.status.value,
|
|
147
|
+
release.delivery_tier,
|
|
148
|
+
"yes" if release.entrypoint_available else "no",
|
|
149
|
+
"yes" if release.runnable else "no",
|
|
150
|
+
release.availability,
|
|
151
|
+
release.blocker,
|
|
152
|
+
)
|
|
153
|
+
for method, release in records
|
|
154
|
+
]
|
|
155
|
+
print(
|
|
156
|
+
_table(
|
|
157
|
+
(
|
|
158
|
+
"RELEASE",
|
|
159
|
+
"METHOD",
|
|
160
|
+
"FAMILY",
|
|
161
|
+
"STATUS",
|
|
162
|
+
"DELIVERY",
|
|
163
|
+
"ENTRYPOINT",
|
|
164
|
+
"RUNNABLE",
|
|
165
|
+
"AVAILABILITY",
|
|
166
|
+
"BLOCKER",
|
|
167
|
+
),
|
|
168
|
+
rows,
|
|
169
|
+
)
|
|
170
|
+
)
|
|
171
|
+
return 0
|
|
172
|
+
|
|
173
|
+
methods = registry.list_methods(family=args.family, tier=args.tier, status=args.status)
|
|
174
|
+
if args.json:
|
|
175
|
+
_json_dump([method.to_dict() for method in methods])
|
|
176
|
+
return 0
|
|
177
|
+
rows = [
|
|
178
|
+
(
|
|
179
|
+
method.method_id,
|
|
180
|
+
method.display_name,
|
|
181
|
+
method.semantic_family.value,
|
|
182
|
+
method.release_tier.value,
|
|
183
|
+
method.status.value,
|
|
184
|
+
str(len(method.releases)),
|
|
185
|
+
)
|
|
186
|
+
for method in methods
|
|
187
|
+
]
|
|
188
|
+
print(_table(("METHOD", "NAME", "FAMILY", "TIER", "STATUS", "RELEASES"), rows))
|
|
189
|
+
return 0
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def _cmd_show(args: argparse.Namespace) -> int:
|
|
193
|
+
registry = _registry_from_argument(args.registry)
|
|
194
|
+
result = registry.get(args.identity)
|
|
195
|
+
if isinstance(result, AlgorithmCard):
|
|
196
|
+
payload = result.to_dict()
|
|
197
|
+
else:
|
|
198
|
+
method, release = result
|
|
199
|
+
payload = {"method": method.to_dict(), "release": release.to_dict()}
|
|
200
|
+
_json_dump(payload)
|
|
201
|
+
return 0
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def _cmd_validate_registry(args: argparse.Namespace) -> int:
|
|
205
|
+
if args.path:
|
|
206
|
+
document = load_registry_file(args.path)
|
|
207
|
+
source = Path(args.path).expanduser().resolve()
|
|
208
|
+
else:
|
|
209
|
+
repository_source = find_repository_registry()
|
|
210
|
+
if repository_source is None:
|
|
211
|
+
document = load_packaged_registry()
|
|
212
|
+
source = Path("agentinputlab.registry/data/algorithms.json")
|
|
213
|
+
else:
|
|
214
|
+
document = load_registry_file(repository_source)
|
|
215
|
+
source = repository_source
|
|
216
|
+
if args.check_snapshot and source.is_file():
|
|
217
|
+
validate_snapshot_sync(source)
|
|
218
|
+
registry = AlgorithmRegistry(document)
|
|
219
|
+
report = registry.doctor()
|
|
220
|
+
payload = {
|
|
221
|
+
"valid": report.ok,
|
|
222
|
+
"source": str(source),
|
|
223
|
+
**report.to_dict(),
|
|
224
|
+
}
|
|
225
|
+
if args.json:
|
|
226
|
+
_json_dump(payload)
|
|
227
|
+
else:
|
|
228
|
+
print(
|
|
229
|
+
f"registry valid: {source} "
|
|
230
|
+
f"({report.method_count} methods, {report.release_count} releases, "
|
|
231
|
+
f"{report.must_ship_count} must-ship, {report.entrypoint_count} entrypoints, "
|
|
232
|
+
f"{report.locked_count} locked)"
|
|
233
|
+
)
|
|
234
|
+
return 0 if report.ok else 1
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
def _cmd_doctor(args: argparse.Namespace) -> int:
|
|
238
|
+
registry = _registry_from_argument(args.registry)
|
|
239
|
+
report = registry.doctor()
|
|
240
|
+
source_path = Path(args.source).expanduser().resolve() if args.source else None
|
|
241
|
+
if source_path is None:
|
|
242
|
+
source_path = find_repository_registry()
|
|
243
|
+
|
|
244
|
+
sync_ok: bool | None = None
|
|
245
|
+
errors = list(report.errors)
|
|
246
|
+
if source_path is not None:
|
|
247
|
+
try:
|
|
248
|
+
validate_snapshot_sync(source_path)
|
|
249
|
+
sync_ok = True
|
|
250
|
+
except RegistryError as exc:
|
|
251
|
+
sync_ok = False
|
|
252
|
+
errors.append(str(exc))
|
|
253
|
+
|
|
254
|
+
ok = report.ok and sync_ok is not False
|
|
255
|
+
payload = {
|
|
256
|
+
**report.to_dict(),
|
|
257
|
+
"ok": ok,
|
|
258
|
+
"offline": bool(args.offline),
|
|
259
|
+
"source_registry": str(source_path) if source_path else None,
|
|
260
|
+
"snapshot_synchronized": sync_ok,
|
|
261
|
+
"errors": errors,
|
|
262
|
+
}
|
|
263
|
+
if args.json:
|
|
264
|
+
_json_dump(payload)
|
|
265
|
+
else:
|
|
266
|
+
state = "OK" if ok else "FAILED"
|
|
267
|
+
print(
|
|
268
|
+
f"registry doctor: {state} — {report.method_count} methods, "
|
|
269
|
+
f"{report.release_count} releases, {report.must_ship_count} must-ship, "
|
|
270
|
+
f"{report.entrypoint_count} entrypoints, {report.locked_count} locked"
|
|
271
|
+
)
|
|
272
|
+
if sync_ok is True:
|
|
273
|
+
print("source snapshot: synchronized")
|
|
274
|
+
elif sync_ok is False:
|
|
275
|
+
print("source snapshot: OUT OF SYNC")
|
|
276
|
+
elif source_path is None:
|
|
277
|
+
print("source snapshot: not checked (installed-package mode)")
|
|
278
|
+
for warning in report.warnings:
|
|
279
|
+
print(f"warning: {warning}")
|
|
280
|
+
for error in errors:
|
|
281
|
+
print(f"error: {error}", file=sys.stderr)
|
|
282
|
+
return 0 if ok else 1
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
def _cmd_selector_list(args: argparse.Namespace) -> int:
|
|
286
|
+
from agentinputlab.selectors import list_selector_cards
|
|
287
|
+
|
|
288
|
+
cards = list_selector_cards()
|
|
289
|
+
payload = [
|
|
290
|
+
{
|
|
291
|
+
"selector_id": card.selector_id,
|
|
292
|
+
"display_name": card.display_name,
|
|
293
|
+
"kind": card.kind.value,
|
|
294
|
+
"requires_fit": card.requires_fit,
|
|
295
|
+
"optional_dependency": card.optional_dependency or None,
|
|
296
|
+
}
|
|
297
|
+
for card in cards
|
|
298
|
+
]
|
|
299
|
+
if args.json:
|
|
300
|
+
_json_dump(payload)
|
|
301
|
+
else:
|
|
302
|
+
print(
|
|
303
|
+
_table(
|
|
304
|
+
("SELECTOR", "NAME", "KIND", "REQUIRES_FIT", "OPTIONAL_DEPENDENCY"),
|
|
305
|
+
[
|
|
306
|
+
(
|
|
307
|
+
item["selector_id"],
|
|
308
|
+
item["display_name"],
|
|
309
|
+
item["kind"],
|
|
310
|
+
"yes" if item["requires_fit"] else "no",
|
|
311
|
+
item["optional_dependency"] or "-",
|
|
312
|
+
)
|
|
313
|
+
for item in payload
|
|
314
|
+
],
|
|
315
|
+
)
|
|
316
|
+
)
|
|
317
|
+
return 0
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
def _cmd_selector_features(args: argparse.Namespace) -> int:
|
|
321
|
+
from agentinputlab.contracts import FrozenAgentState
|
|
322
|
+
from agentinputlab.selectors import VisibleStateFeatureExtractor
|
|
323
|
+
|
|
324
|
+
state = FrozenAgentState(
|
|
325
|
+
query=args.query,
|
|
326
|
+
instruction=args.instruction,
|
|
327
|
+
tool_names=tuple(args.tool_name),
|
|
328
|
+
)
|
|
329
|
+
observation = VisibleStateFeatureExtractor().extract(state)
|
|
330
|
+
_json_dump(
|
|
331
|
+
{
|
|
332
|
+
"state_hash": state.state_hash,
|
|
333
|
+
"feature_hash": observation.feature_hash,
|
|
334
|
+
"features": to_jsonable(observation.features),
|
|
335
|
+
"extractor": {
|
|
336
|
+
"id": observation.extractor_id,
|
|
337
|
+
"revision": observation.extractor_revision,
|
|
338
|
+
},
|
|
339
|
+
"access_domains": [item.value for item in observation.access_domains],
|
|
340
|
+
"provenance": to_jsonable(observation.provenance),
|
|
341
|
+
"raw_text_persisted": False,
|
|
342
|
+
}
|
|
343
|
+
)
|
|
344
|
+
return 0
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
def _cmd_selector_inspect(args: argparse.Namespace) -> int:
|
|
348
|
+
from agentinputlab.selectors import (
|
|
349
|
+
SelectorArtifactIdentity,
|
|
350
|
+
SelectorArtifactStore,
|
|
351
|
+
)
|
|
352
|
+
|
|
353
|
+
identity = SelectorArtifactIdentity(
|
|
354
|
+
selector_id=args.selector_id,
|
|
355
|
+
revision=args.revision,
|
|
356
|
+
sha256=args.sha256,
|
|
357
|
+
)
|
|
358
|
+
_selector, bundle = SelectorArtifactStore(args.store).load(identity)
|
|
359
|
+
_json_dump(
|
|
360
|
+
{
|
|
361
|
+
"identity": to_jsonable(identity),
|
|
362
|
+
"stage": bundle.stage.value,
|
|
363
|
+
"bundle_hash": bundle.bundle_hash,
|
|
364
|
+
"model_hash": bundle.model_hash,
|
|
365
|
+
"extractor": {
|
|
366
|
+
"id": bundle.extractor_id,
|
|
367
|
+
"revision": bundle.extractor_revision,
|
|
368
|
+
"sha256": bundle.extractor_hash,
|
|
369
|
+
},
|
|
370
|
+
"feature_schema": {
|
|
371
|
+
"id": bundle.feature_schema_id,
|
|
372
|
+
"sha256": bundle.feature_schema_hash,
|
|
373
|
+
},
|
|
374
|
+
"representative_by_family": {
|
|
375
|
+
family.value: release_id
|
|
376
|
+
for family, release_id in bundle.representative_by_family.items()
|
|
377
|
+
},
|
|
378
|
+
"training_table_sha256": bundle.training_table_sha256,
|
|
379
|
+
"split_provenance_hash": bundle.split_provenance_hash,
|
|
380
|
+
"comparison_profile_hash": bundle.comparison_profile_hash,
|
|
381
|
+
}
|
|
382
|
+
)
|
|
383
|
+
return 0
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
def _cmd_dataset_prepare(args: argparse.Namespace) -> int:
|
|
387
|
+
from agentinputlab.benchmarks import prepare_benchmark
|
|
388
|
+
|
|
389
|
+
_json_dump(
|
|
390
|
+
prepare_benchmark(
|
|
391
|
+
args.cell_id,
|
|
392
|
+
cache_dir=args.cache_dir,
|
|
393
|
+
offline=args.offline,
|
|
394
|
+
accept_license_review=args.accept_license_review,
|
|
395
|
+
max_download_bytes=args.max_download_mib * 1024 * 1024,
|
|
396
|
+
max_prepared_bytes=args.max_prepared_mib * 1024 * 1024,
|
|
397
|
+
)
|
|
398
|
+
)
|
|
399
|
+
return 0
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
def _cmd_trec_sample(args: argparse.Namespace) -> int:
|
|
403
|
+
from agentinputlab.data import prepare_trec_dl_sample
|
|
404
|
+
|
|
405
|
+
_json_dump(
|
|
406
|
+
prepare_trec_dl_sample(
|
|
407
|
+
args.root,
|
|
408
|
+
year=args.year,
|
|
409
|
+
query_count=args.query_count,
|
|
410
|
+
query_offset=args.query_offset,
|
|
411
|
+
offline=args.offline,
|
|
412
|
+
accept_license_review=args.accept_license_review,
|
|
413
|
+
max_download_bytes=args.max_download_mib * 1024 * 1024,
|
|
414
|
+
expected_corpus_revision=args.corpus_revision,
|
|
415
|
+
source_sample_root=args.source_sample_root,
|
|
416
|
+
source_manifest_sha256=args.source_manifest_sha256,
|
|
417
|
+
)
|
|
418
|
+
)
|
|
419
|
+
return 0
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
def _cmd_campaign_doctor(args: argparse.Namespace) -> int:
|
|
423
|
+
from agentinputlab.campaign import campaign_doctor
|
|
424
|
+
|
|
425
|
+
readiness = args.readiness
|
|
426
|
+
if readiness is None:
|
|
427
|
+
candidate = Path("configs/parity/adapter_readiness.json")
|
|
428
|
+
readiness = candidate if candidate.is_file() else None
|
|
429
|
+
report = campaign_doctor(
|
|
430
|
+
args.prepared,
|
|
431
|
+
readiness_path=readiness,
|
|
432
|
+
)
|
|
433
|
+
_json_dump(to_jsonable(report))
|
|
434
|
+
target_ready = (
|
|
435
|
+
report["static_data_ready"] if args.target == "static" else report["full_campaign_ready"]
|
|
436
|
+
)
|
|
437
|
+
return 0 if target_ready else 2
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
def _cmd_campaign_prepare(args: argparse.Namespace) -> int:
|
|
441
|
+
from agentinputlab.benchmarks import (
|
|
442
|
+
BenchmarkSmokeAssetRegistry,
|
|
443
|
+
materialize_benchmark_asset,
|
|
444
|
+
)
|
|
445
|
+
from agentinputlab.campaign import existing_campaign_assets
|
|
446
|
+
|
|
447
|
+
registry = BenchmarkSmokeAssetRegistry.default()
|
|
448
|
+
reports: list[dict[str, Any]] = []
|
|
449
|
+
blocked: list[dict[str, str]] = []
|
|
450
|
+
for asset_id in existing_campaign_assets():
|
|
451
|
+
asset = registry.get(asset_id)
|
|
452
|
+
if asset.status == "license_review_required" and not args.accept_license_review:
|
|
453
|
+
blocked.append(
|
|
454
|
+
{
|
|
455
|
+
"asset_id": asset_id,
|
|
456
|
+
"reason": (
|
|
457
|
+
"license review is required; rerun with "
|
|
458
|
+
"--accept-license-review after reviewing the source terms"
|
|
459
|
+
),
|
|
460
|
+
}
|
|
461
|
+
)
|
|
462
|
+
continue
|
|
463
|
+
reports.append(
|
|
464
|
+
materialize_benchmark_asset(
|
|
465
|
+
asset_id,
|
|
466
|
+
store_root=args.store,
|
|
467
|
+
prepared_root=args.prepared,
|
|
468
|
+
allow_network=args.allow_network,
|
|
469
|
+
accept_license_review=args.accept_license_review,
|
|
470
|
+
)
|
|
471
|
+
)
|
|
472
|
+
_json_dump(
|
|
473
|
+
{
|
|
474
|
+
"schema_version": 1,
|
|
475
|
+
"protocol": "agentinputlab.campaign-prepare.v1",
|
|
476
|
+
"scope": "existing-data-main",
|
|
477
|
+
"assets": reports,
|
|
478
|
+
"blocked": blocked,
|
|
479
|
+
"inventory_only_cells_touched": 0,
|
|
480
|
+
"experiment_executed": False,
|
|
481
|
+
}
|
|
482
|
+
)
|
|
483
|
+
return 0 if not blocked else 2
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
def _cmd_campaign_bootstrap(args: argparse.Namespace) -> int:
|
|
487
|
+
from agentinputlab.runtime_bootstrap import bootstrap_runtime_sources
|
|
488
|
+
|
|
489
|
+
report = bootstrap_runtime_sources(
|
|
490
|
+
args.root,
|
|
491
|
+
method_ids=args.method or None,
|
|
492
|
+
include_arenas=not args.no_arenas,
|
|
493
|
+
allow_network=args.allow_network,
|
|
494
|
+
)
|
|
495
|
+
_json_dump(to_jsonable(report))
|
|
496
|
+
return 0 if report["ready_count"] == report["source_count"] else 2
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
def _cmd_campaign_smoke(args: argparse.Namespace) -> int:
|
|
500
|
+
from agentinputlab.campaign import campaign_data_smoke
|
|
501
|
+
|
|
502
|
+
_json_dump(to_jsonable(campaign_data_smoke(args.prepared)))
|
|
503
|
+
return 0
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
def _cmd_campaign_methods(args: argparse.Namespace) -> int:
|
|
507
|
+
from agentinputlab.campaign import campaign_method_matrix
|
|
508
|
+
|
|
509
|
+
report = campaign_method_matrix(args.catalog, args.readiness)
|
|
510
|
+
_json_dump(to_jsonable(report))
|
|
511
|
+
return 0 if report["adapter_ready"] == report["method_count"] else 2
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
def _cmd_campaign_run(args: argparse.Namespace) -> int:
|
|
515
|
+
from agentinputlab.experiments.cli import main as experiment_main
|
|
516
|
+
|
|
517
|
+
arguments = ["run", str(args.manifest)]
|
|
518
|
+
if args.driver:
|
|
519
|
+
arguments.extend(("--driver", args.driver))
|
|
520
|
+
if args.no_resolve_units:
|
|
521
|
+
arguments.append("--no-resolve-units")
|
|
522
|
+
if args.shard_count is not None:
|
|
523
|
+
arguments.extend(("--shard-count", str(args.shard_count)))
|
|
524
|
+
arguments.extend(("--shard-index", str(args.shard_index)))
|
|
525
|
+
if args.execute:
|
|
526
|
+
arguments.append("--execute")
|
|
527
|
+
arguments.extend(("--output-root", str(args.output_root)))
|
|
528
|
+
if args.resume:
|
|
529
|
+
arguments.append("--resume")
|
|
530
|
+
if args.fail_fast:
|
|
531
|
+
arguments.append("--fail-fast")
|
|
532
|
+
return experiment_main(arguments)
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
def _cmd_campaign_verify(args: argparse.Namespace) -> int:
|
|
536
|
+
from agentinputlab.campaign import campaign_verify_run
|
|
537
|
+
|
|
538
|
+
_json_dump(
|
|
539
|
+
to_jsonable(
|
|
540
|
+
campaign_verify_run(
|
|
541
|
+
args.run_dir,
|
|
542
|
+
allow_incomplete=args.allow_incomplete,
|
|
543
|
+
)
|
|
544
|
+
)
|
|
545
|
+
)
|
|
546
|
+
return 0
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
def _cmd_campaign_analyze(args: argparse.Namespace) -> int:
|
|
550
|
+
from agentinputlab.experiments import analyze_confirmatory_protocol
|
|
551
|
+
|
|
552
|
+
result = analyze_confirmatory_protocol(
|
|
553
|
+
tuple(str(path) for path in args.run_dir),
|
|
554
|
+
protocol=args.protocol,
|
|
555
|
+
metric=args.metric,
|
|
556
|
+
algorithm_failure_value=args.algorithm_failure_value,
|
|
557
|
+
bootstrap_samples=args.bootstrap_samples,
|
|
558
|
+
permutation_samples=args.permutation_samples,
|
|
559
|
+
random_seed=args.random_seed,
|
|
560
|
+
)
|
|
561
|
+
_json_dump(to_jsonable(result))
|
|
562
|
+
return 0
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
def _cmd_campaign_run_all(args: argparse.Namespace) -> int:
|
|
566
|
+
from agentinputlab.campaign_runner import (
|
|
567
|
+
load_one_click_campaign,
|
|
568
|
+
run_one_click_campaign,
|
|
569
|
+
)
|
|
570
|
+
|
|
571
|
+
campaign = load_one_click_campaign(args.config)
|
|
572
|
+
result = run_one_click_campaign(campaign, execute=args.execute)
|
|
573
|
+
_json_dump(to_jsonable(result))
|
|
574
|
+
if not args.execute:
|
|
575
|
+
return 0 if result["ready"] else 2
|
|
576
|
+
if result.get("execution_blocked") is True:
|
|
577
|
+
return 2
|
|
578
|
+
return 0 if result["all_succeeded"] else 3
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
def _cmd_campaign_run_production(args: argparse.Namespace) -> int:
|
|
582
|
+
from agentinputlab.production_campaign import (
|
|
583
|
+
load_production_campaign,
|
|
584
|
+
run_production_campaign,
|
|
585
|
+
)
|
|
586
|
+
|
|
587
|
+
campaign = load_production_campaign(args.config)
|
|
588
|
+
result = run_production_campaign(campaign, execute=args.execute)
|
|
589
|
+
_json_dump(to_jsonable(result))
|
|
590
|
+
if not args.execute:
|
|
591
|
+
return 0 if result["ready"] else 2
|
|
592
|
+
if result.get("execution_blocked") is True:
|
|
593
|
+
return 2
|
|
594
|
+
return 0 if result["all_succeeded"] else 3
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
598
|
+
parser = argparse.ArgumentParser(
|
|
599
|
+
prog="agentinputlab",
|
|
600
|
+
description="Inspect and validate the AgentInputLab algorithm registry.",
|
|
601
|
+
)
|
|
602
|
+
parser.add_argument(
|
|
603
|
+
"--registry",
|
|
604
|
+
help="Use a source registry instead of the packaged snapshot.",
|
|
605
|
+
)
|
|
606
|
+
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
607
|
+
|
|
608
|
+
data_parser = subparsers.add_parser(
|
|
609
|
+
"datasets", help="Prepare source-locked datasets with bounded automatic downloads."
|
|
610
|
+
)
|
|
611
|
+
data_commands = data_parser.add_subparsers(dest="dataset_command", required=True)
|
|
612
|
+
data_prepare = data_commands.add_parser(
|
|
613
|
+
"prepare", help="Reuse a cache or download missing pinned source files."
|
|
614
|
+
)
|
|
615
|
+
data_prepare.add_argument("cell_id")
|
|
616
|
+
data_prepare.add_argument("--cache-dir", type=Path)
|
|
617
|
+
data_prepare.add_argument("--offline", action="store_true")
|
|
618
|
+
data_prepare.add_argument("--accept-license-review", action="store_true")
|
|
619
|
+
data_prepare.add_argument(
|
|
620
|
+
"--max-download-mib",
|
|
621
|
+
type=int,
|
|
622
|
+
default=512,
|
|
623
|
+
help="Total missing source-file limit; default 512 MiB. No full multi-GB download by default.",
|
|
624
|
+
)
|
|
625
|
+
data_prepare.set_defaults(func=_cmd_dataset_prepare)
|
|
626
|
+
data_prepare.add_argument(
|
|
627
|
+
"--max-prepared-mib",
|
|
628
|
+
type=int,
|
|
629
|
+
default=512,
|
|
630
|
+
help="Per-asset normalized-output limit; default 512 MiB. Keeps a further 1 GiB free.",
|
|
631
|
+
)
|
|
632
|
+
trec = data_commands.add_parser(
|
|
633
|
+
"prepare-trec-sample", help="Prepare a bounded official-source TREC compatibility sample."
|
|
634
|
+
)
|
|
635
|
+
trec.add_argument("root", type=Path)
|
|
636
|
+
trec.add_argument("--year", required=True, type=int, choices=(2019, 2020))
|
|
637
|
+
trec.add_argument("--query-count", type=int, default=2)
|
|
638
|
+
trec.add_argument("--query-offset", type=int, default=0)
|
|
639
|
+
trec.add_argument("--offline", action="store_true")
|
|
640
|
+
trec.add_argument("--accept-license-review", action="store_true")
|
|
641
|
+
trec.add_argument("--max-download-mib", type=int, default=16)
|
|
642
|
+
trec.add_argument("--corpus-revision")
|
|
643
|
+
trec.add_argument("--source-sample-root", type=Path)
|
|
644
|
+
trec.add_argument("--source-manifest-sha256")
|
|
645
|
+
trec.set_defaults(func=_cmd_trec_sample)
|
|
646
|
+
|
|
647
|
+
list_parser = subparsers.add_parser("list", help="List methods or release profiles.")
|
|
648
|
+
list_parser.add_argument(
|
|
649
|
+
"--family", choices=[item.value for item in SemanticFamily], help="Filter by family."
|
|
650
|
+
)
|
|
651
|
+
list_parser.add_argument(
|
|
652
|
+
"--tier", choices=[item.value for item in ReleaseTier], help="Filter by release tier."
|
|
653
|
+
)
|
|
654
|
+
list_parser.add_argument(
|
|
655
|
+
"--status", choices=[item.value for item in SupportStatus], help="Filter by status."
|
|
656
|
+
)
|
|
657
|
+
list_parser.add_argument(
|
|
658
|
+
"--delivery-tier",
|
|
659
|
+
choices=["must_ship", "stretch", "blocked_or_post_v1"],
|
|
660
|
+
help="Filter release profiles by engineering delivery tier.",
|
|
661
|
+
)
|
|
662
|
+
list_parser.add_argument(
|
|
663
|
+
"--releases", action="store_true", help="List release profiles instead of methods."
|
|
664
|
+
)
|
|
665
|
+
list_parser.add_argument("--json", action="store_true", help="Emit JSON.")
|
|
666
|
+
list_parser.set_defaults(func=_cmd_list)
|
|
667
|
+
|
|
668
|
+
show_parser = subparsers.add_parser("show", help="Show one method or release profile.")
|
|
669
|
+
show_parser.add_argument("identity", help="Canonical method ID or exact release ID.")
|
|
670
|
+
show_parser.set_defaults(func=_cmd_show)
|
|
671
|
+
|
|
672
|
+
doctor_parser = subparsers.add_parser("doctor", help="Run registry integrity diagnostics.")
|
|
673
|
+
doctor_parser.add_argument("--source", help="Source registry to compare with the snapshot.")
|
|
674
|
+
doctor_parser.add_argument(
|
|
675
|
+
"--offline",
|
|
676
|
+
action="store_true",
|
|
677
|
+
help="Assert that diagnostics must not contact external services.",
|
|
678
|
+
)
|
|
679
|
+
doctor_parser.add_argument("--json", action="store_true", help="Emit JSON.")
|
|
680
|
+
doctor_parser.set_defaults(func=_cmd_doctor)
|
|
681
|
+
|
|
682
|
+
validate_parser = subparsers.add_parser(
|
|
683
|
+
"validate-registry", help="Validate a source or packaged registry."
|
|
684
|
+
)
|
|
685
|
+
validate_parser.add_argument(
|
|
686
|
+
"path", nargs="?", help="Registry path; defaults to checkout source."
|
|
687
|
+
)
|
|
688
|
+
validate_parser.add_argument(
|
|
689
|
+
"--check-snapshot",
|
|
690
|
+
action="store_true",
|
|
691
|
+
help="Also require equality with the packaged snapshot.",
|
|
692
|
+
)
|
|
693
|
+
validate_parser.add_argument("--json", action="store_true", help="Emit JSON.")
|
|
694
|
+
validate_parser.set_defaults(func=_cmd_validate_registry)
|
|
695
|
+
|
|
696
|
+
smoke_parser = subparsers.add_parser(
|
|
697
|
+
"smoke",
|
|
698
|
+
help="Run the dependency-free Query2doc and BM25 reference loop.",
|
|
699
|
+
)
|
|
700
|
+
smoke_parser.add_argument("--json", action="store_true", help="Emit JSON.")
|
|
701
|
+
smoke_parser.set_defaults(func=_cmd_smoke)
|
|
702
|
+
|
|
703
|
+
selector_parser = subparsers.add_parser(
|
|
704
|
+
"selector",
|
|
705
|
+
help="Inspect selector catalog, visible features, and exact frozen artifacts.",
|
|
706
|
+
)
|
|
707
|
+
selector_subparsers = selector_parser.add_subparsers(
|
|
708
|
+
dest="selector_command",
|
|
709
|
+
required=True,
|
|
710
|
+
)
|
|
711
|
+
selector_list = selector_subparsers.add_parser("list", help="List selector cards.")
|
|
712
|
+
selector_list.add_argument("--json", action="store_true", help="Emit JSON.")
|
|
713
|
+
selector_list.set_defaults(func=_cmd_selector_list)
|
|
714
|
+
|
|
715
|
+
selector_features = selector_subparsers.add_parser(
|
|
716
|
+
"features",
|
|
717
|
+
help="Extract evaluator-blind visible-state features.",
|
|
718
|
+
)
|
|
719
|
+
selector_features.add_argument("--query", default="")
|
|
720
|
+
selector_features.add_argument("--instruction", default="")
|
|
721
|
+
selector_features.add_argument("--tool-name", action="append", default=[])
|
|
722
|
+
selector_features.set_defaults(func=_cmd_selector_features)
|
|
723
|
+
|
|
724
|
+
selector_inspect = selector_subparsers.add_parser(
|
|
725
|
+
"inspect",
|
|
726
|
+
help="Inspect one exact content-addressed selector artifact.",
|
|
727
|
+
)
|
|
728
|
+
selector_inspect.add_argument("--store", type=Path, required=True)
|
|
729
|
+
selector_inspect.add_argument("--selector-id", required=True)
|
|
730
|
+
selector_inspect.add_argument("--revision", required=True)
|
|
731
|
+
selector_inspect.add_argument("--sha256", required=True)
|
|
732
|
+
selector_inspect.set_defaults(func=_cmd_selector_inspect)
|
|
733
|
+
|
|
734
|
+
campaign_parser = subparsers.add_parser(
|
|
735
|
+
"campaign",
|
|
736
|
+
help=(
|
|
737
|
+
"Prepare, diagnose, smoke, run, verify, and analyze the frozen existing-data campaign."
|
|
738
|
+
),
|
|
739
|
+
)
|
|
740
|
+
campaign_subparsers = campaign_parser.add_subparsers(
|
|
741
|
+
dest="campaign_command",
|
|
742
|
+
required=True,
|
|
743
|
+
)
|
|
744
|
+
|
|
745
|
+
campaign_doctor_parser = campaign_subparsers.add_parser(
|
|
746
|
+
"doctor",
|
|
747
|
+
help="Inspect real prepared data, method surfaces, and stateful-runtime blockers.",
|
|
748
|
+
)
|
|
749
|
+
campaign_doctor_parser.add_argument(
|
|
750
|
+
"--prepared",
|
|
751
|
+
type=Path,
|
|
752
|
+
default=Path("data/normalized"),
|
|
753
|
+
)
|
|
754
|
+
campaign_doctor_parser.add_argument(
|
|
755
|
+
"--readiness",
|
|
756
|
+
type=Path,
|
|
757
|
+
help="Adapter readiness matrix; defaults to the checkout catalog when present.",
|
|
758
|
+
)
|
|
759
|
+
campaign_doctor_parser.add_argument(
|
|
760
|
+
"--target",
|
|
761
|
+
choices=("static", "full"),
|
|
762
|
+
default="full",
|
|
763
|
+
help="Choose whether missing stateful runtime bridges are fatal.",
|
|
764
|
+
)
|
|
765
|
+
campaign_doctor_parser.set_defaults(func=_cmd_campaign_doctor)
|
|
766
|
+
|
|
767
|
+
campaign_prepare_parser = campaign_subparsers.add_parser(
|
|
768
|
+
"prepare",
|
|
769
|
+
help="Acquire and preprocess accepted sources only; never touches D0 inventory cells.",
|
|
770
|
+
)
|
|
771
|
+
campaign_prepare_parser.add_argument(
|
|
772
|
+
"--store",
|
|
773
|
+
type=Path,
|
|
774
|
+
default=Path("data/raw"),
|
|
775
|
+
)
|
|
776
|
+
campaign_prepare_parser.add_argument(
|
|
777
|
+
"--prepared",
|
|
778
|
+
type=Path,
|
|
779
|
+
default=Path("data/normalized"),
|
|
780
|
+
)
|
|
781
|
+
campaign_prepare_parser.add_argument("--allow-network", action="store_true")
|
|
782
|
+
campaign_prepare_parser.add_argument(
|
|
783
|
+
"--accept-license-review",
|
|
784
|
+
action="store_true",
|
|
785
|
+
help="Process ClariQ locally only after reviewing its source terms.",
|
|
786
|
+
)
|
|
787
|
+
campaign_prepare_parser.set_defaults(func=_cmd_campaign_prepare)
|
|
788
|
+
|
|
789
|
+
campaign_bootstrap_parser = campaign_subparsers.add_parser(
|
|
790
|
+
"bootstrap",
|
|
791
|
+
help=(
|
|
792
|
+
"Verify or fetch exact public method/arena source checkouts; "
|
|
793
|
+
"does not install packages, download weights, or run experiments."
|
|
794
|
+
),
|
|
795
|
+
)
|
|
796
|
+
campaign_bootstrap_parser.add_argument(
|
|
797
|
+
"--root",
|
|
798
|
+
type=Path,
|
|
799
|
+
default=Path("operator/checkouts"),
|
|
800
|
+
)
|
|
801
|
+
campaign_bootstrap_parser.add_argument(
|
|
802
|
+
"--method",
|
|
803
|
+
action="append",
|
|
804
|
+
help="Limit bootstrap to one method ID; repeat for multiple methods.",
|
|
805
|
+
)
|
|
806
|
+
campaign_bootstrap_parser.add_argument(
|
|
807
|
+
"--no-arenas",
|
|
808
|
+
action="store_true",
|
|
809
|
+
help="Do not include the four official common-support source checkouts.",
|
|
810
|
+
)
|
|
811
|
+
campaign_bootstrap_parser.add_argument(
|
|
812
|
+
"--allow-network",
|
|
813
|
+
action="store_true",
|
|
814
|
+
help="Fetch absent or mismatched public checkouts at their exact pinned commits.",
|
|
815
|
+
)
|
|
816
|
+
campaign_bootstrap_parser.set_defaults(func=_cmd_campaign_bootstrap)
|
|
817
|
+
|
|
818
|
+
campaign_smoke_parser = campaign_subparsers.add_parser(
|
|
819
|
+
"smoke",
|
|
820
|
+
help="Load and score one real prepared example from all seven static D2 cells.",
|
|
821
|
+
)
|
|
822
|
+
campaign_smoke_parser.add_argument(
|
|
823
|
+
"--prepared",
|
|
824
|
+
type=Path,
|
|
825
|
+
default=Path("data/normalized"),
|
|
826
|
+
)
|
|
827
|
+
campaign_smoke_parser.set_defaults(func=_cmd_campaign_smoke)
|
|
828
|
+
|
|
829
|
+
campaign_methods_parser = campaign_subparsers.add_parser(
|
|
830
|
+
"methods",
|
|
831
|
+
help="List exact launch commands and reviewed adapter gates for all 27 methods.",
|
|
832
|
+
)
|
|
833
|
+
campaign_methods_parser.add_argument(
|
|
834
|
+
"--catalog",
|
|
835
|
+
type=Path,
|
|
836
|
+
default=Path("configs/parity/methods.json"),
|
|
837
|
+
)
|
|
838
|
+
campaign_methods_parser.add_argument(
|
|
839
|
+
"--readiness",
|
|
840
|
+
type=Path,
|
|
841
|
+
default=Path("configs/parity/adapter_readiness.json"),
|
|
842
|
+
)
|
|
843
|
+
campaign_methods_parser.set_defaults(func=_cmd_campaign_methods)
|
|
844
|
+
|
|
845
|
+
campaign_run_parser = campaign_subparsers.add_parser(
|
|
846
|
+
"run",
|
|
847
|
+
help="Preflight a frozen manifest by default; execute only with --execute.",
|
|
848
|
+
)
|
|
849
|
+
campaign_run_parser.add_argument("manifest", type=Path)
|
|
850
|
+
campaign_run_parser.add_argument("--driver")
|
|
851
|
+
campaign_run_parser.add_argument("--no-resolve-units", action="store_true")
|
|
852
|
+
campaign_run_parser.add_argument("--shard-count", type=int)
|
|
853
|
+
campaign_run_parser.add_argument("--shard-index", type=int, default=0)
|
|
854
|
+
campaign_run_parser.add_argument("--execute", action="store_true")
|
|
855
|
+
campaign_run_parser.add_argument("--output-root", type=Path, default=Path("results"))
|
|
856
|
+
campaign_run_parser.add_argument("--resume", action="store_true")
|
|
857
|
+
campaign_run_parser.add_argument("--fail-fast", action="store_true")
|
|
858
|
+
campaign_run_parser.set_defaults(func=_cmd_campaign_run)
|
|
859
|
+
|
|
860
|
+
campaign_verify_parser = campaign_subparsers.add_parser(
|
|
861
|
+
"verify",
|
|
862
|
+
help="Verify manifest, plan, driver identity, and cell checksums.",
|
|
863
|
+
)
|
|
864
|
+
campaign_verify_parser.add_argument("run_dir", type=Path)
|
|
865
|
+
campaign_verify_parser.add_argument("--allow-incomplete", action="store_true")
|
|
866
|
+
campaign_verify_parser.set_defaults(func=_cmd_campaign_verify)
|
|
867
|
+
|
|
868
|
+
campaign_analyze_parser = campaign_subparsers.add_parser(
|
|
869
|
+
"analyze",
|
|
870
|
+
help="Run the strict confirmatory analyzer over verified run directories.",
|
|
871
|
+
)
|
|
872
|
+
campaign_analyze_parser.add_argument("run_dir", type=Path, nargs="+")
|
|
873
|
+
campaign_analyze_parser.add_argument("--protocol", default="auto")
|
|
874
|
+
campaign_analyze_parser.add_argument("--metric", default="valid_success")
|
|
875
|
+
campaign_analyze_parser.add_argument("--bootstrap-samples", type=int, default=2_000)
|
|
876
|
+
campaign_analyze_parser.add_argument("--permutation-samples", type=int, default=2_000)
|
|
877
|
+
campaign_analyze_parser.add_argument("--random-seed", type=int, default=2027)
|
|
878
|
+
campaign_analyze_parser.add_argument("--algorithm-failure-value", type=float)
|
|
879
|
+
campaign_analyze_parser.set_defaults(func=_cmd_campaign_analyze)
|
|
880
|
+
|
|
881
|
+
campaign_run_all_parser = campaign_subparsers.add_parser(
|
|
882
|
+
"run-all",
|
|
883
|
+
help=(
|
|
884
|
+
"Preflight all 27 methods and ten accepted-source cells, then execute "
|
|
885
|
+
"every frozen job with one explicit --execute."
|
|
886
|
+
),
|
|
887
|
+
)
|
|
888
|
+
campaign_run_all_parser.add_argument(
|
|
889
|
+
"config",
|
|
890
|
+
type=Path,
|
|
891
|
+
help="Strict self-hashed one-click campaign bundle.",
|
|
892
|
+
)
|
|
893
|
+
campaign_run_all_parser.add_argument(
|
|
894
|
+
"--execute",
|
|
895
|
+
action="store_true",
|
|
896
|
+
help="Start model/external-runtime calls only after every job preflight is ready.",
|
|
897
|
+
)
|
|
898
|
+
campaign_run_all_parser.set_defaults(func=_cmd_campaign_run_all)
|
|
899
|
+
|
|
900
|
+
campaign_run_production_parser = campaign_subparsers.add_parser(
|
|
901
|
+
"run-production",
|
|
902
|
+
help=(
|
|
903
|
+
"Preflight or start the complete ordered production DAG: data, "
|
|
904
|
+
"27-method library parity/discovery, confirmations, selector, robustness, "
|
|
905
|
+
"stateful replications, and paper export."
|
|
906
|
+
),
|
|
907
|
+
)
|
|
908
|
+
campaign_run_production_parser.add_argument(
|
|
909
|
+
"config",
|
|
910
|
+
type=Path,
|
|
911
|
+
help="Strict self-hashed production campaign DAG.",
|
|
912
|
+
)
|
|
913
|
+
campaign_run_production_parser.add_argument(
|
|
914
|
+
"--execute",
|
|
915
|
+
action="store_true",
|
|
916
|
+
help="Start the complete DAG only after every initial prerequisite passes.",
|
|
917
|
+
)
|
|
918
|
+
campaign_run_production_parser.set_defaults(func=_cmd_campaign_run_production)
|
|
919
|
+
return parser
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
def main(argv: Sequence[str] | None = None) -> int:
|
|
923
|
+
parser = build_parser()
|
|
924
|
+
args = parser.parse_args(argv)
|
|
925
|
+
try:
|
|
926
|
+
return int(args.func(args))
|
|
927
|
+
except AgentInputLabError as exc:
|
|
928
|
+
print(f"agentinputlab: {exc}", file=sys.stderr)
|
|
929
|
+
return 2
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
if __name__ == "__main__":
|
|
933
|
+
raise SystemExit(main())
|