adaptorch 0.1.1__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.
- adaptorch/__init__.py +399 -0
- adaptorch/__main__.py +4 -0
- adaptorch/_wilson.py +64 -0
- adaptorch/a2a_adapter.py +243 -0
- adaptorch/ab_stats.py +1545 -0
- adaptorch/accuracy_features.py +148 -0
- adaptorch/accuracy_gate.py +43 -0
- adaptorch/acquisition/__init__.py +76 -0
- adaptorch/acquisition/events.py +451 -0
- adaptorch/acquisition/lanes.py +539 -0
- adaptorch/acquisition/liveness.py +412 -0
- adaptorch/acquisition/receipt.py +269 -0
- adaptorch/aeg_te/__init__.py +265 -0
- adaptorch/aeg_te/candidate_fixtures.py +364 -0
- adaptorch/aeg_te/clustering.py +163 -0
- adaptorch/aeg_te/drift.py +98 -0
- adaptorch/aeg_te/evidence_dag.py +687 -0
- adaptorch/aeg_te/evidence_merge.py +46 -0
- adaptorch/aeg_te/hermetic.py +636 -0
- adaptorch/aeg_te/hx2.py +2785 -0
- adaptorch/aeg_te/issue_repro.py +700 -0
- adaptorch/aeg_te/lcb_calibration.py +280 -0
- adaptorch/aeg_te/matrix_selector.py +583 -0
- adaptorch/aeg_te/models.py +348 -0
- adaptorch/aeg_te/pipeline.py +447 -0
- adaptorch/aeg_te/product_repro.py +328 -0
- adaptorch/aeg_te/repair.py +181 -0
- adaptorch/aeg_te/repro_execution.py +444 -0
- adaptorch/aeg_te/repro_overfit.py +555 -0
- adaptorch/aeg_te/repro_runner.py +528 -0
- adaptorch/aeg_te/repro_targeting.py +425 -0
- adaptorch/aeg_te/routing.py +201 -0
- adaptorch/aeg_te/scoring.py +490 -0
- adaptorch/aeg_te/testing.py +424 -0
- adaptorch/aeg_te/trace.py +263 -0
- adaptorch/agent_adapters.py +817 -0
- adaptorch/ai_disclosure.py +144 -0
- adaptorch/answer_semantic.py +174 -0
- adaptorch/api.py +392 -0
- adaptorch/apply_rate_control.py +364 -0
- adaptorch/audit_report.py +802 -0
- adaptorch/b2c_first_run.py +529 -0
- adaptorch/b2c_readiness.py +953 -0
- adaptorch/behavioral_ranking.py +118 -0
- adaptorch/bench85b/__init__.py +196 -0
- adaptorch/bench85b/attestation.py +310 -0
- adaptorch/bench85b/backend_tristate.py +320 -0
- adaptorch/bench85b/canonical.py +179 -0
- adaptorch/bench85b/canonical_status.py +94 -0
- adaptorch/bench85b/capability_extraction.py +416 -0
- adaptorch/bench85b/capability_signature.py +262 -0
- adaptorch/bench85b/classifier.py +215 -0
- adaptorch/bench85b/control_plane_ready.py +100 -0
- adaptorch/bench85b/decision_receipt.py +127 -0
- adaptorch/bench85b/exercise_receipt.py +1733 -0
- adaptorch/bench85b/freshness.py +108 -0
- adaptorch/bench85b/image_trust.py +255 -0
- adaptorch/bench85b/oracle.py +102 -0
- adaptorch/bench85b/paired_replay.py +143 -0
- adaptorch/bench85b/policy_gates.py +158 -0
- adaptorch/bench85b/preflight.py +103 -0
- adaptorch/bench85b/repro_contract.py +184 -0
- adaptorch/bench85b/roots.py +220 -0
- adaptorch/bench85b/run_state.py +89 -0
- adaptorch/bench85b/smoke.py +247 -0
- adaptorch/bench85b/types_.py +23 -0
- adaptorch/bench85b_execution/__init__.py +348 -0
- adaptorch/bench85b_execution/attestation_signer.py +305 -0
- adaptorch/bench85b_execution/candidate_failure_classifier.py +61 -0
- adaptorch/bench85b_execution/canonical_status.py +34 -0
- adaptorch/bench85b_execution/clean_host_replay_manifest.py +321 -0
- adaptorch/bench85b_execution/clean_host_replay_runner.py +137 -0
- adaptorch/bench85b_execution/clock.py +31 -0
- adaptorch/bench85b_execution/decision_append_log.py +275 -0
- adaptorch/bench85b_execution/dry_run_backend.py +91 -0
- adaptorch/bench85b_execution/dry_run_image.py +64 -0
- adaptorch/bench85b_execution/dry_run_paired.py +64 -0
- adaptorch/bench85b_execution/dry_run_smoke.py +102 -0
- adaptorch/bench85b_execution/durable_nonce_evidence.py +432 -0
- adaptorch/bench85b_execution/durable_nonce_verifier.py +229 -0
- adaptorch/bench85b_execution/engine.py +223 -0
- adaptorch/bench85b_execution/errors.py +22 -0
- adaptorch/bench85b_execution/evidence_freeze.py +601 -0
- adaptorch/bench85b_execution/expansion_gate.py +222 -0
- adaptorch/bench85b_execution/expansion_queue.py +857 -0
- adaptorch/bench85b_execution/expansion_queue_status.py +277 -0
- adaptorch/bench85b_execution/expansion_runner.py +113 -0
- adaptorch/bench85b_execution/expansion_scheduler.py +136 -0
- adaptorch/bench85b_execution/expansion_worker_adapter.py +159 -0
- adaptorch/bench85b_execution/expansion_worker_entrypoint.py +326 -0
- adaptorch/bench85b_execution/expansion_worker_loop.py +507 -0
- adaptorch/bench85b_execution/freeze_replay_bundle.py +339 -0
- adaptorch/bench85b_execution/freeze_verifier.py +293 -0
- adaptorch/bench85b_execution/live_backend.py +213 -0
- adaptorch/bench85b_execution/merkle.py +118 -0
- adaptorch/bench85b_execution/official_evaluator_manifest.py +533 -0
- adaptorch/bench85b_execution/oracle_runner.py +385 -0
- adaptorch/bench85b_execution/pair_validator.py +119 -0
- adaptorch/bench85b_execution/paired_replay_orchestrator.py +332 -0
- adaptorch/bench85b_execution/positive_evidence_orchestrator.py +287 -0
- adaptorch/bench85b_execution/protocols.py +52 -0
- adaptorch/bench85b_execution/release_bound_evidence.py +795 -0
- adaptorch/bench85b_execution/release_control_plane.py +769 -0
- adaptorch/bench85b_execution/release_decision_planes.py +697 -0
- adaptorch/bench85b_execution/release_decision_signatures.py +749 -0
- adaptorch/bench85b_execution/release_gate_contract.py +350 -0
- adaptorch/bench85b_execution/release_m7_ledger.py +330 -0
- adaptorch/bench85b_execution/release_predicate_evidence.py +653 -0
- adaptorch/bench85b_execution/release_trust_io.py +539 -0
- adaptorch/bench85b_execution/release_trust_manifest.py +1240 -0
- adaptorch/bench85b_execution/release_workflow.py +2184 -0
- adaptorch/bench85b_execution/replay_runner.py +205 -0
- adaptorch/bench85b_execution/runtime_evidence_matrix.py +1195 -0
- adaptorch/bench85b_execution/runtime_matrix_axes.py +1389 -0
- adaptorch/bench85b_execution/signed_evidence_bundle.py +1005 -0
- adaptorch/bench85b_execution/signer_trust_bundle.py +290 -0
- adaptorch/bench85b_execution/signer_trust_bundle_parser.py +109 -0
- adaptorch/bench85b_execution/signing_keys.py +154 -0
- adaptorch/bench85b_execution/substrate_warmup.py +216 -0
- adaptorch/bench85b_execution/trust_bootstrap.py +850 -0
- adaptorch/bench85b_execution/trust_join.py +585 -0
- adaptorch/bench85b_execution/verdict_matrix.py +145 -0
- adaptorch/bench85b_live/__init__.py +72 -0
- adaptorch/bench85b_live/cosign_image.py +78 -0
- adaptorch/bench85b_live/errors.py +22 -0
- adaptorch/bench85b_live/http_client.py +73 -0
- adaptorch/bench85b_live/oci_availability.py +41 -0
- adaptorch/bench85b_live/oci_probe_receipt.py +308 -0
- adaptorch/bench85b_live/opt_in.py +58 -0
- adaptorch/bench85b_live/paired_side_runner.py +95 -0
- adaptorch/bench85b_live/podman_backend.py +139 -0
- adaptorch/bench85b_live/podman_smoke.py +330 -0
- adaptorch/bench85b_live/process_runner.py +115 -0
- adaptorch/benchmark_bundle.py +1242 -0
- adaptorch/benchmark_cursor_integrity.py +125 -0
- adaptorch/benchmark_direct_arm.py +281 -0
- adaptorch/benchmark_harness.py +568 -0
- adaptorch/benchmark_progress.py +1655 -0
- adaptorch/benchmark_registry.py +560 -0
- adaptorch/benchmarking.py +7093 -0
- adaptorch/beta_quantile.py +77 -0
- adaptorch/brand_report.py +511 -0
- adaptorch/budget_router.py +1303 -0
- adaptorch/calibration.py +611 -0
- adaptorch/cascade_router.py +360 -0
- adaptorch/cek/__init__.py +76 -0
- adaptorch/cek/_coerce.py +120 -0
- adaptorch/cek/adapters/__init__.py +19 -0
- adaptorch/cek/adapters/aeg_te_shadow.py +267 -0
- adaptorch/cek/constitution_bundle.py +177 -0
- adaptorch/cek/constitutional.py +39 -0
- adaptorch/cek/constitutional_review.py +406 -0
- adaptorch/cek/correctness_wall.py +354 -0
- adaptorch/cek/deterministic_gates.py +13 -0
- adaptorch/cek/docker_evidence.py +199 -0
- adaptorch/cek/evidence_card.py +206 -0
- adaptorch/cek/models.py +266 -0
- adaptorch/cek/observability.py +158 -0
- adaptorch/cek/provenance.py +77 -0
- adaptorch/cek/reducer.py +194 -0
- adaptorch/cek/shadow_report.py +468 -0
- adaptorch/cek/types.py +95 -0
- adaptorch/circuit_breaker.py +358 -0
- adaptorch/cli.py +1310 -0
- adaptorch/cli_subscription_health.py +222 -0
- adaptorch/cloud_auth.py +1585 -0
- adaptorch/confidence_weighted_vote.py +50 -0
- adaptorch/conformal_calibration.py +138 -0
- adaptorch/conformal_gate.py +108 -0
- adaptorch/consensus_weighting.py +729 -0
- adaptorch/contract_error.py +17 -0
- adaptorch/control_plane/__init__.py +10340 -0
- adaptorch/control_plane/auth.py +501 -0
- adaptorch/control_plane/auto_mode.py +91 -0
- adaptorch/control_plane/billing.py +40 -0
- adaptorch/control_plane/dashboard_projections.py +222 -0
- adaptorch/control_plane/env_utils.py +29 -0
- adaptorch/control_plane/execution_ensemble.py +328 -0
- adaptorch/control_plane/execution_judge.py +149 -0
- adaptorch/control_plane/execution_provider.py +308 -0
- adaptorch/control_plane/execution_verifier.py +252 -0
- adaptorch/control_plane/fingerprint.py +10 -0
- adaptorch/control_plane/marketing_api.py +139 -0
- adaptorch/control_plane/marketing_email.py +146 -0
- adaptorch/control_plane/marketing_sink.py +56 -0
- adaptorch/control_plane/marketing_validation.py +219 -0
- adaptorch/control_plane/models.py +653 -0
- adaptorch/control_plane/ops_router.py +388 -0
- adaptorch/control_plane/polar_billing.py +221 -0
- adaptorch/control_plane/provenance_backfill.py +129 -0
- adaptorch/control_plane/redis_health.py +97 -0
- adaptorch/control_plane/request_credential.py +160 -0
- adaptorch/control_plane/run_authenticity.py +123 -0
- adaptorch/control_plane/shared_backend.py +276 -0
- adaptorch/control_plane/storage.py +164 -0
- adaptorch/control_plane/supabase_artifact_store.py +494 -0
- adaptorch/control_plane/supabase_run_store.py +457 -0
- adaptorch/control_plane/time_utils.py +30 -0
- adaptorch/control_plane/validation.py +77 -0
- adaptorch/control_plane/vera_bridge.py +110 -0
- adaptorch/correlation_contract.py +156 -0
- adaptorch/correlation_matrix.py +64 -0
- adaptorch/correlation_policy.py +242 -0
- adaptorch/correlation_support.py +48 -0
- adaptorch/cse_estimator.py +194 -0
- adaptorch/d1_analysis.py +263 -0
- adaptorch/d1_liveness.py +130 -0
- adaptorch/d1_mcnemar.py +49 -0
- adaptorch/d1_preregistration.py +169 -0
- adaptorch/d1_preregistration_types.py +175 -0
- adaptorch/dag.py +544 -0
- adaptorch/decision_trace.py +697 -0
- adaptorch/durable_store.py +108 -0
- adaptorch/edgar/__init__.py +9 -0
- adaptorch/edgar/expansion.py +192 -0
- adaptorch/edgar/groq_expansion_client.py +86 -0
- adaptorch/embedding_consistency.py +564 -0
- adaptorch/engine.py +2368 -0
- adaptorch/ensemble.py +2331 -0
- adaptorch/ensemble_judge.py +549 -0
- adaptorch/evidence_canonical.py +103 -0
- adaptorch/evidence_kernel.py +204 -0
- adaptorch/evidence_kernel_store.py +152 -0
- adaptorch/evidence_kernel_types.py +171 -0
- adaptorch/evidence_receipt.py +228 -0
- adaptorch/evidence_seal.py +272 -0
- adaptorch/exact_binomial.py +83 -0
- adaptorch/executors.py +1105 -0
- adaptorch/file_safety.py +377 -0
- adaptorch/formulas.py +203 -0
- adaptorch/full50_alignment.py +881 -0
- adaptorch/full50_attempt_ledger.py +272 -0
- adaptorch/full50_attempt_ledger_identity.py +224 -0
- adaptorch/full50_attempt_ledger_identity_io.py +133 -0
- adaptorch/full50_attempt_ledger_schema.py +247 -0
- adaptorch/full50_authorization.py +209 -0
- adaptorch/full50_authorization_models.py +209 -0
- adaptorch/full50_durable_anchor.py +185 -0
- adaptorch/full50_exact50_adapter.py +234 -0
- adaptorch/full50_freeze.py +292 -0
- adaptorch/full50_input_bundle.py +170 -0
- adaptorch/full50_n4_validation.py +219 -0
- adaptorch/full50_orchestration.py +399 -0
- adaptorch/full50_outcome_denial_lifetime.py +172 -0
- adaptorch/full50_outcome_store_policy.py +284 -0
- adaptorch/full50_outcome_store_probe_io.py +54 -0
- adaptorch/full50_path_policy.py +309 -0
- adaptorch/full50_post_run.py +139 -0
- adaptorch/full50_postgres_ledger.py +386 -0
- adaptorch/full50_quality_reproducibility.py +165 -0
- adaptorch/full50_release_models.py +96 -0
- adaptorch/full50_release_runner.py +187 -0
- adaptorch/full50_renderer.py +621 -0
- adaptorch/full50_source_bundle.py +234 -0
- adaptorch/gmail_automation/__init__.py +21 -0
- adaptorch/gmail_automation/browser.py +122 -0
- adaptorch/gmail_automation/creator.py +178 -0
- adaptorch/gmail_automation/models.py +52 -0
- adaptorch/guardrails.py +443 -0
- adaptorch/hard_v3_verifier.py +266 -0
- adaptorch/harness_dashboard/__init__.py +11 -0
- adaptorch/harness_dashboard/scanner.py +190 -0
- adaptorch/higgsfield_graph.py +499 -0
- adaptorch/immutable_file.py +86 -0
- adaptorch/learned_router.py +1457 -0
- adaptorch/lexicons/__init__.py +8 -0
- adaptorch/lexicons/en.json +21 -0
- adaptorch/live_benchmark_profile.py +682 -0
- adaptorch/logprobs_extractor.py +579 -0
- adaptorch/mcp_adapter.py +171 -0
- adaptorch/mcp_local_backend.py +199 -0
- adaptorch/mcp_server.py +2648 -0
- adaptorch/measurement_cassette.py +166 -0
- adaptorch/measurement_replay.py +302 -0
- adaptorch/middleware_connectors.py +745 -0
- adaptorch/multiple_testing.py +23 -0
- adaptorch/n8n_connector.py +674 -0
- adaptorch/native/adaptorch_native.c +334 -0
- adaptorch/native_backend.py +180 -0
- adaptorch/numeric_answer_verifier.py +332 -0
- adaptorch/official_evaluation.py +373 -0
- adaptorch/offline_outcome.py +86 -0
- adaptorch/online_router.py +1124 -0
- adaptorch/oracle_firewall.py +193 -0
- adaptorch/orchestration_value.py +260 -0
- adaptorch/plan_catalog.py +95 -0
- adaptorch/plan_expiry.py +97 -0
- adaptorch/policy.py +173 -0
- adaptorch/provider_adapter.py +314 -0
- adaptorch/providers.py +2923 -0
- adaptorch/proxy_matrix/__init__.py +22 -0
- adaptorch/proxy_matrix/models.py +78 -0
- adaptorch/proxy_matrix/selector.py +175 -0
- adaptorch/proxy_matrix/storage.py +310 -0
- adaptorch/py.typed +1 -0
- adaptorch/quality_signal.py +108 -0
- adaptorch/receipt_chain.py +198 -0
- adaptorch/receipt_types.py +198 -0
- adaptorch/resource_ledger.py +192 -0
- adaptorch/risk_coverage.py +142 -0
- adaptorch/router.py +404 -0
- adaptorch/routing_calibration.py +77 -0
- adaptorch/run_manifest.py +93 -0
- adaptorch/runtime_action_lattice.py +50 -0
- adaptorch/runtime_actuator.py +262 -0
- adaptorch/runtime_change_v2.py +63 -0
- adaptorch/runtime_channels_v2.py +91 -0
- adaptorch/runtime_control.py +948 -0
- adaptorch/runtime_controller_v2.py +192 -0
- adaptorch/runtime_risk_v2.py +112 -0
- adaptorch/runtime_sensor_quality.py +94 -0
- adaptorch/runtime_sensors_v2.py +251 -0
- adaptorch/runtime_state_filter.py +276 -0
- adaptorch/seal_trust.py +101 -0
- adaptorch/selection_fusion.py +37 -0
- adaptorch/selective_risk.py +217 -0
- adaptorch/selective_risk_registry.py +55 -0
- adaptorch/self_consistency.py +722 -0
- adaptorch/sensors.py +454 -0
- adaptorch/session_guard/__init__.py +14 -0
- adaptorch/session_guard/guard.py +238 -0
- adaptorch/session_guard/models.py +51 -0
- adaptorch/shadow_hashes.py +77 -0
- adaptorch/shadow_planner.py +239 -0
- adaptorch/shadow_types.py +173 -0
- adaptorch/source_capture.py +265 -0
- adaptorch/source_revision.py +280 -0
- adaptorch/surrogate_mix.py +75 -0
- adaptorch/synthesis.py +4147 -0
- adaptorch/synthesis_ranking.py +548 -0
- adaptorch/synthesis_scoring.py +1007 -0
- adaptorch/synthesis_tuning.py +395 -0
- adaptorch/token_estimation.py +507 -0
- adaptorch/tracing.py +137 -0
- adaptorch/tuning_corpus.py +304 -0
- adaptorch/types.py +732 -0
- adaptorch/url_security.py +407 -0
- adaptorch/vera_cli.py +200 -0
- adaptorch/vera_config.py +280 -0
- adaptorch/vera_config_env.py +188 -0
- adaptorch/vera_contract_schema.py +266 -0
- adaptorch/vera_diagnostics.py +38 -0
- adaptorch/vera_engine.py +248 -0
- adaptorch/vera_evaluation.py +284 -0
- adaptorch/vera_pipeline.py +141 -0
- adaptorch/vera_policy.py +211 -0
- adaptorch/vera_profile_validation.py +246 -0
- adaptorch/vera_receipt_factory.py +44 -0
- adaptorch/vera_receipt_store.py +35 -0
- adaptorch/vera_record_dedup.py +35 -0
- adaptorch/vera_runtime.py +117 -0
- adaptorch/vera_types.py +285 -0
- adaptorch/verifiability.py +305 -0
- adaptorch/verification.py +898 -0
- adaptorch/verification_evidence.py +277 -0
- adaptorch/verification_posterior.py +268 -0
- adaptorch/verification_profiles.py +96 -0
- adaptorch/verification_scheduler.py +280 -0
- adaptorch/verifier_calibration.py +271 -0
- adaptorch/verifier_constitution.py +80 -0
- adaptorch/verifier_outcomes.py +144 -0
- adaptorch/verifier_registry.py +228 -0
- adaptorch-0.1.1.dist-info/METADATA +1078 -0
- adaptorch-0.1.1.dist-info/RECORD +369 -0
- adaptorch-0.1.1.dist-info/WHEEL +5 -0
- adaptorch-0.1.1.dist-info/entry_points.txt +3 -0
- adaptorch-0.1.1.dist-info/licenses/LICENSE +201 -0
- adaptorch-0.1.1.dist-info/licenses/NOTICE +7 -0
- adaptorch-0.1.1.dist-info/top_level.txt +1 -0
adaptorch/__init__.py
ADDED
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
2
|
+
|
|
3
|
+
from adaptorch.ab_stats import (
|
|
4
|
+
PairedABReport,
|
|
5
|
+
paired_ab_from_unit_scores,
|
|
6
|
+
paired_ab_report,
|
|
7
|
+
)
|
|
8
|
+
from adaptorch.agent_adapters import (
|
|
9
|
+
AgentAdapterError,
|
|
10
|
+
AgentInvocation,
|
|
11
|
+
SubprocessAgentConfig,
|
|
12
|
+
build_chat_sdk_agent,
|
|
13
|
+
build_claude_code_cli_agent,
|
|
14
|
+
build_cline_cli_agent,
|
|
15
|
+
build_codex_cli_agent,
|
|
16
|
+
build_cursor_cli_agent,
|
|
17
|
+
build_gemini_cli_agent,
|
|
18
|
+
build_google_genai_agent,
|
|
19
|
+
build_grok_openai_compatible_agent,
|
|
20
|
+
build_langchain_runnable_agent,
|
|
21
|
+
build_lovable_cli_agent,
|
|
22
|
+
build_named_cli_agent,
|
|
23
|
+
build_openai_compatible_responses_agent,
|
|
24
|
+
build_openai_responses_agent,
|
|
25
|
+
build_opencode_cli_agent,
|
|
26
|
+
build_rag_agent,
|
|
27
|
+
build_roocode_cli_agent,
|
|
28
|
+
build_subprocess_agent,
|
|
29
|
+
build_windsurf_cli_agent,
|
|
30
|
+
wrap_structured_agent,
|
|
31
|
+
)
|
|
32
|
+
from adaptorch.api import (
|
|
33
|
+
bundle_benchmark,
|
|
34
|
+
detect_provider,
|
|
35
|
+
load_task_payload,
|
|
36
|
+
onepager_benchmark,
|
|
37
|
+
report_benchmark,
|
|
38
|
+
run_benchmark,
|
|
39
|
+
run_task,
|
|
40
|
+
run_task_file,
|
|
41
|
+
summarize_benchmark,
|
|
42
|
+
)
|
|
43
|
+
from adaptorch.benchmark_registry import (
|
|
44
|
+
HARNESS_REGISTRY,
|
|
45
|
+
MODEL_PRESETS,
|
|
46
|
+
HarnessSpec,
|
|
47
|
+
ModelPreset,
|
|
48
|
+
estimate_ensemble_cost,
|
|
49
|
+
list_harness_ids,
|
|
50
|
+
list_model_keys,
|
|
51
|
+
lookup_harness,
|
|
52
|
+
lookup_model,
|
|
53
|
+
)
|
|
54
|
+
from adaptorch.benchmarking import (
|
|
55
|
+
execute_benchmark_run,
|
|
56
|
+
load_benchmark_config,
|
|
57
|
+
report_benchmark_run,
|
|
58
|
+
summarize_benchmark_run,
|
|
59
|
+
)
|
|
60
|
+
from adaptorch.cascade_router import CascadedRoutingDecision, CascadedTopologyRouter
|
|
61
|
+
from adaptorch.circuit_breaker import CircuitBreaker, CircuitBreakerPolicy
|
|
62
|
+
from adaptorch.dag import TaskDAG
|
|
63
|
+
from adaptorch.engine import AdaptOrchEngine
|
|
64
|
+
from adaptorch.ensemble import (
|
|
65
|
+
EMAWeightTracker,
|
|
66
|
+
EnsembleResult,
|
|
67
|
+
ModelProvider,
|
|
68
|
+
ModelResponse,
|
|
69
|
+
ParallelModelExecutor,
|
|
70
|
+
PromptComplexityRouter,
|
|
71
|
+
SelectionStrategy,
|
|
72
|
+
SemanticPromptCache,
|
|
73
|
+
ThompsonSelectionTracker,
|
|
74
|
+
apply_dynamic_relative_culling,
|
|
75
|
+
)
|
|
76
|
+
from adaptorch.formulas import (
|
|
77
|
+
ConvergenceReport,
|
|
78
|
+
DominanceReport,
|
|
79
|
+
RobustConvergenceReport,
|
|
80
|
+
convergence_report,
|
|
81
|
+
dominance_ratio_lower_bound,
|
|
82
|
+
dominance_report,
|
|
83
|
+
epsilon_gap,
|
|
84
|
+
quorum_agreement,
|
|
85
|
+
robust_convergence_report,
|
|
86
|
+
score_dispersion,
|
|
87
|
+
weighted_epsilon_gap,
|
|
88
|
+
)
|
|
89
|
+
from adaptorch.logprobs_extractor import ExtractionResult, LogprobsExtractor
|
|
90
|
+
from adaptorch.mcp_server import (
|
|
91
|
+
AdaptOrchMCPServer,
|
|
92
|
+
MCPServerConfig,
|
|
93
|
+
build_default_mcp_server,
|
|
94
|
+
build_run_resource_uri,
|
|
95
|
+
create_default_mcp_http_app,
|
|
96
|
+
create_mcp_http_app,
|
|
97
|
+
run_http_server,
|
|
98
|
+
)
|
|
99
|
+
from adaptorch.middleware_connectors import (
|
|
100
|
+
AnthropicMiddlewareConnector,
|
|
101
|
+
ClaudeCodeMiddlewareConnector,
|
|
102
|
+
ClineMiddlewareConnector,
|
|
103
|
+
CodexMiddlewareConnector,
|
|
104
|
+
CohereMiddlewareConnector,
|
|
105
|
+
ConnectorRegistry,
|
|
106
|
+
CursorMiddlewareConnector,
|
|
107
|
+
DeepSeekMiddlewareConnector,
|
|
108
|
+
GeminiMiddlewareConnector,
|
|
109
|
+
GoogleGenAIMiddlewareConnector,
|
|
110
|
+
GrokMiddlewareConnector,
|
|
111
|
+
GroqMiddlewareConnector,
|
|
112
|
+
LangChainMiddlewareConnector,
|
|
113
|
+
LangGraphMiddlewareConnector,
|
|
114
|
+
LovableMiddlewareConnector,
|
|
115
|
+
MakeMiddlewareConnector,
|
|
116
|
+
MCPMiddlewareConnector,
|
|
117
|
+
MiddlewareConnectorError,
|
|
118
|
+
MiddlewareDispatchOptions,
|
|
119
|
+
MistralMiddlewareConnector,
|
|
120
|
+
N8nMiddlewareConnector,
|
|
121
|
+
OllamaMiddlewareConnector,
|
|
122
|
+
OpenAIMiddlewareConnector,
|
|
123
|
+
OpenCodeMiddlewareConnector,
|
|
124
|
+
PerplexityMiddlewareConnector,
|
|
125
|
+
PromptMiddlewareConnector,
|
|
126
|
+
RooCodeMiddlewareConnector,
|
|
127
|
+
WebhookMiddlewareConnector,
|
|
128
|
+
WindsurfMiddlewareConnector,
|
|
129
|
+
XAIMiddlewareConnector,
|
|
130
|
+
ZapierMiddlewareConnector,
|
|
131
|
+
build_default_connector_registry,
|
|
132
|
+
)
|
|
133
|
+
from adaptorch.n8n_connector import (
|
|
134
|
+
N8nConnectorConfig,
|
|
135
|
+
N8nConnectorError,
|
|
136
|
+
N8nControlPlaneConnector,
|
|
137
|
+
N8nHttpError,
|
|
138
|
+
N8nRetryPolicy,
|
|
139
|
+
N8nTransportError,
|
|
140
|
+
build_n8n_benchmark_node_output,
|
|
141
|
+
build_n8n_node_output,
|
|
142
|
+
)
|
|
143
|
+
from adaptorch.native_backend import native_backend_available
|
|
144
|
+
from adaptorch.online_router import (
|
|
145
|
+
OnlineRouteDiagnostics,
|
|
146
|
+
OnlineTopologyRouter,
|
|
147
|
+
RoutingObservation,
|
|
148
|
+
)
|
|
149
|
+
from adaptorch.policy import BudgetPolicy, build_budget_policy
|
|
150
|
+
from adaptorch.provider_adapter import (
|
|
151
|
+
ProviderAdapterConfig,
|
|
152
|
+
ProviderModelAdapter,
|
|
153
|
+
build_ensemble_providers,
|
|
154
|
+
)
|
|
155
|
+
from adaptorch.providers import (
|
|
156
|
+
build_recording_provider,
|
|
157
|
+
build_replay_provider,
|
|
158
|
+
build_runtime_agent,
|
|
159
|
+
build_runtime_agent_with_logprobs,
|
|
160
|
+
build_streaming_agent,
|
|
161
|
+
build_synthesis_mode_plan,
|
|
162
|
+
close_all_provider_clients,
|
|
163
|
+
detect_provider_configuration,
|
|
164
|
+
provider_request_hash,
|
|
165
|
+
resolve_provider,
|
|
166
|
+
resolve_synthesis_mode_for_model,
|
|
167
|
+
)
|
|
168
|
+
from adaptorch.router import TopologyRouter
|
|
169
|
+
from adaptorch.runtime_actuator import BoundedRuntimeActuator
|
|
170
|
+
from adaptorch.runtime_controller_v2 import CseNcmhControllerV2
|
|
171
|
+
from adaptorch.runtime_state_filter import RuntimeStateFilter
|
|
172
|
+
from adaptorch.sensors import collect_from_api_response
|
|
173
|
+
from adaptorch.synthesis import adaptive_synthesis, consistency_score
|
|
174
|
+
from adaptorch.synthesis_tuning import (
|
|
175
|
+
TuningCase,
|
|
176
|
+
TuningResult,
|
|
177
|
+
evaluate_config,
|
|
178
|
+
tune_synthesis_config,
|
|
179
|
+
)
|
|
180
|
+
from adaptorch.token_estimation import TokenEstimationCalibrator, estimate_text_tokens
|
|
181
|
+
from adaptorch.tracing import (
|
|
182
|
+
FileTraceSink,
|
|
183
|
+
InMemoryTraceSink,
|
|
184
|
+
NullTraceSink,
|
|
185
|
+
TraceEvent,
|
|
186
|
+
TraceSink,
|
|
187
|
+
TraceSinkSummary,
|
|
188
|
+
)
|
|
189
|
+
from adaptorch.tuning_corpus import (
|
|
190
|
+
CorpusBuildReport,
|
|
191
|
+
CorpusBuildResult,
|
|
192
|
+
build_tuning_cases,
|
|
193
|
+
load_corpus_file,
|
|
194
|
+
)
|
|
195
|
+
from adaptorch.vera_engine import VeraVerificationEngine
|
|
196
|
+
from adaptorch.vera_receipt_store import FileReceiptSink
|
|
197
|
+
from adaptorch.vera_runtime import build_vera_runtime
|
|
198
|
+
from adaptorch.vera_types import (
|
|
199
|
+
VerificationDecision,
|
|
200
|
+
VerificationEvidenceEvent,
|
|
201
|
+
VerificationReceipt,
|
|
202
|
+
VerifierReliabilityProfile,
|
|
203
|
+
)
|
|
204
|
+
from adaptorch.verification import (
|
|
205
|
+
CommandVerifier,
|
|
206
|
+
SandboxLimits,
|
|
207
|
+
VerificationCommandResult,
|
|
208
|
+
VerificationOutcome,
|
|
209
|
+
)
|
|
210
|
+
from adaptorch.verification_posterior import EvidencePosteriorEngine
|
|
211
|
+
from adaptorch.verification_scheduler import SequentialVerificationScheduler
|
|
212
|
+
|
|
213
|
+
try:
|
|
214
|
+
__version__ = version("adaptorch")
|
|
215
|
+
except PackageNotFoundError:
|
|
216
|
+
__version__ = "0.0.0"
|
|
217
|
+
|
|
218
|
+
__all__ = [
|
|
219
|
+
"AdaptOrchEngine",
|
|
220
|
+
"BoundedRuntimeActuator",
|
|
221
|
+
"CseNcmhControllerV2",
|
|
222
|
+
"EvidencePosteriorEngine",
|
|
223
|
+
"FileReceiptSink",
|
|
224
|
+
"RuntimeStateFilter",
|
|
225
|
+
"SequentialVerificationScheduler",
|
|
226
|
+
"VerificationDecision",
|
|
227
|
+
"VerificationEvidenceEvent",
|
|
228
|
+
"VerificationReceipt",
|
|
229
|
+
"VerifierReliabilityProfile",
|
|
230
|
+
"VeraVerificationEngine",
|
|
231
|
+
"build_vera_runtime",
|
|
232
|
+
"AgentAdapterError",
|
|
233
|
+
"AgentInvocation",
|
|
234
|
+
"CircuitBreaker",
|
|
235
|
+
"CircuitBreakerPolicy",
|
|
236
|
+
"ConvergenceReport",
|
|
237
|
+
"OnlineRouteDiagnostics",
|
|
238
|
+
"OnlineTopologyRouter",
|
|
239
|
+
"PairedABReport",
|
|
240
|
+
"RoutingObservation",
|
|
241
|
+
"SelectionStrategy",
|
|
242
|
+
"ThompsonSelectionTracker",
|
|
243
|
+
"TokenEstimationCalibrator",
|
|
244
|
+
"TuningCase",
|
|
245
|
+
"TuningResult",
|
|
246
|
+
"CorpusBuildReport",
|
|
247
|
+
"CorpusBuildResult",
|
|
248
|
+
"DominanceReport",
|
|
249
|
+
"RobustConvergenceReport",
|
|
250
|
+
"EMAWeightTracker",
|
|
251
|
+
"EnsembleResult",
|
|
252
|
+
"ExtractionResult",
|
|
253
|
+
"HARNESS_REGISTRY",
|
|
254
|
+
"HarnessSpec",
|
|
255
|
+
"MODEL_PRESETS",
|
|
256
|
+
"ModelPreset",
|
|
257
|
+
"LogprobsExtractor",
|
|
258
|
+
"ModelProvider",
|
|
259
|
+
"ModelResponse",
|
|
260
|
+
"ParallelModelExecutor",
|
|
261
|
+
"PromptComplexityRouter",
|
|
262
|
+
"ProviderAdapterConfig",
|
|
263
|
+
"ProviderModelAdapter",
|
|
264
|
+
"SandboxLimits",
|
|
265
|
+
"SemanticPromptCache",
|
|
266
|
+
"SubprocessAgentConfig",
|
|
267
|
+
"TaskDAG",
|
|
268
|
+
"TopologyRouter",
|
|
269
|
+
"TraceEvent",
|
|
270
|
+
"TraceSink",
|
|
271
|
+
"CascadedRoutingDecision",
|
|
272
|
+
"CascadedTopologyRouter",
|
|
273
|
+
"CommandVerifier",
|
|
274
|
+
"VerificationCommandResult",
|
|
275
|
+
"VerificationOutcome",
|
|
276
|
+
"BudgetPolicy",
|
|
277
|
+
"AnthropicMiddlewareConnector",
|
|
278
|
+
"ClaudeCodeMiddlewareConnector",
|
|
279
|
+
"CohereMiddlewareConnector",
|
|
280
|
+
"ClineMiddlewareConnector",
|
|
281
|
+
"CodexMiddlewareConnector",
|
|
282
|
+
"ConnectorRegistry",
|
|
283
|
+
"CursorMiddlewareConnector",
|
|
284
|
+
"DeepSeekMiddlewareConnector",
|
|
285
|
+
"GeminiMiddlewareConnector",
|
|
286
|
+
"GoogleGenAIMiddlewareConnector",
|
|
287
|
+
"GrokMiddlewareConnector",
|
|
288
|
+
"GroqMiddlewareConnector",
|
|
289
|
+
"LangChainMiddlewareConnector",
|
|
290
|
+
"LangGraphMiddlewareConnector",
|
|
291
|
+
"LovableMiddlewareConnector",
|
|
292
|
+
"MCPMiddlewareConnector",
|
|
293
|
+
"MCPServerConfig",
|
|
294
|
+
"MakeMiddlewareConnector",
|
|
295
|
+
"MistralMiddlewareConnector",
|
|
296
|
+
"MiddlewareConnectorError",
|
|
297
|
+
"MiddlewareDispatchOptions",
|
|
298
|
+
"N8nConnectorConfig",
|
|
299
|
+
"N8nConnectorError",
|
|
300
|
+
"N8nMiddlewareConnector",
|
|
301
|
+
"N8nControlPlaneConnector",
|
|
302
|
+
"N8nHttpError",
|
|
303
|
+
"N8nRetryPolicy",
|
|
304
|
+
"N8nTransportError",
|
|
305
|
+
"AdaptOrchMCPServer",
|
|
306
|
+
"OllamaMiddlewareConnector",
|
|
307
|
+
"OpenAIMiddlewareConnector",
|
|
308
|
+
"OpenCodeMiddlewareConnector",
|
|
309
|
+
"PerplexityMiddlewareConnector",
|
|
310
|
+
"PromptMiddlewareConnector",
|
|
311
|
+
"RooCodeMiddlewareConnector",
|
|
312
|
+
"WebhookMiddlewareConnector",
|
|
313
|
+
"WindsurfMiddlewareConnector",
|
|
314
|
+
"XAIMiddlewareConnector",
|
|
315
|
+
"ZapierMiddlewareConnector",
|
|
316
|
+
"__version__",
|
|
317
|
+
"adaptive_synthesis",
|
|
318
|
+
"apply_dynamic_relative_culling",
|
|
319
|
+
"paired_ab_from_unit_scores",
|
|
320
|
+
"paired_ab_report",
|
|
321
|
+
"evaluate_config",
|
|
322
|
+
"tune_synthesis_config",
|
|
323
|
+
"build_tuning_cases",
|
|
324
|
+
"estimate_text_tokens",
|
|
325
|
+
"load_corpus_file",
|
|
326
|
+
"convergence_report",
|
|
327
|
+
"consistency_score",
|
|
328
|
+
"build_runtime_agent",
|
|
329
|
+
"build_runtime_agent_with_logprobs",
|
|
330
|
+
"build_streaming_agent",
|
|
331
|
+
"build_ensemble_providers",
|
|
332
|
+
"bundle_benchmark",
|
|
333
|
+
"collect_from_api_response",
|
|
334
|
+
"close_all_provider_clients",
|
|
335
|
+
"build_n8n_benchmark_node_output",
|
|
336
|
+
"build_n8n_node_output",
|
|
337
|
+
"build_budget_policy",
|
|
338
|
+
"build_default_connector_registry",
|
|
339
|
+
"build_default_mcp_server",
|
|
340
|
+
"create_default_mcp_http_app",
|
|
341
|
+
"create_mcp_http_app",
|
|
342
|
+
"build_run_resource_uri",
|
|
343
|
+
"run_http_server",
|
|
344
|
+
"build_recording_provider",
|
|
345
|
+
"build_replay_provider",
|
|
346
|
+
"build_synthesis_mode_plan",
|
|
347
|
+
"detect_provider",
|
|
348
|
+
"detect_provider_configuration",
|
|
349
|
+
"estimate_ensemble_cost",
|
|
350
|
+
"execute_benchmark_run",
|
|
351
|
+
"dominance_ratio_lower_bound",
|
|
352
|
+
"dominance_report",
|
|
353
|
+
"epsilon_gap",
|
|
354
|
+
"quorum_agreement",
|
|
355
|
+
"robust_convergence_report",
|
|
356
|
+
"score_dispersion",
|
|
357
|
+
"weighted_epsilon_gap",
|
|
358
|
+
"build_claude_code_cli_agent",
|
|
359
|
+
"build_chat_sdk_agent",
|
|
360
|
+
"build_cline_cli_agent",
|
|
361
|
+
"build_codex_cli_agent",
|
|
362
|
+
"build_cursor_cli_agent",
|
|
363
|
+
"build_gemini_cli_agent",
|
|
364
|
+
"build_google_genai_agent",
|
|
365
|
+
"build_grok_openai_compatible_agent",
|
|
366
|
+
"build_langchain_runnable_agent",
|
|
367
|
+
"build_lovable_cli_agent",
|
|
368
|
+
"build_named_cli_agent",
|
|
369
|
+
"build_openai_compatible_responses_agent",
|
|
370
|
+
"build_openai_responses_agent",
|
|
371
|
+
"build_opencode_cli_agent",
|
|
372
|
+
"build_rag_agent",
|
|
373
|
+
"build_roocode_cli_agent",
|
|
374
|
+
"build_subprocess_agent",
|
|
375
|
+
"build_windsurf_cli_agent",
|
|
376
|
+
"list_harness_ids",
|
|
377
|
+
"list_model_keys",
|
|
378
|
+
"load_benchmark_config",
|
|
379
|
+
"load_task_payload",
|
|
380
|
+
"lookup_harness",
|
|
381
|
+
"lookup_model",
|
|
382
|
+
"native_backend_available",
|
|
383
|
+
"onepager_benchmark",
|
|
384
|
+
"provider_request_hash",
|
|
385
|
+
"FileTraceSink",
|
|
386
|
+
"InMemoryTraceSink",
|
|
387
|
+
"NullTraceSink",
|
|
388
|
+
"TraceSinkSummary",
|
|
389
|
+
"resolve_provider",
|
|
390
|
+
"resolve_synthesis_mode_for_model",
|
|
391
|
+
"report_benchmark",
|
|
392
|
+
"report_benchmark_run",
|
|
393
|
+
"run_benchmark",
|
|
394
|
+
"run_task",
|
|
395
|
+
"run_task_file",
|
|
396
|
+
"summarize_benchmark",
|
|
397
|
+
"summarize_benchmark_run",
|
|
398
|
+
"wrap_structured_agent",
|
|
399
|
+
]
|
adaptorch/__main__.py
ADDED
adaptorch/_wilson.py
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""Contract-neutral Wilson score interval core (internal).
|
|
2
|
+
|
|
3
|
+
This private module holds the single source of truth for the Wilson score
|
|
4
|
+
interval lower-bound *formula*. It is deliberately **contract-neutral**: it
|
|
5
|
+
performs no input validation, no clamping, no finiteness checks, and takes no
|
|
6
|
+
position on the domain of ``z``. Those policies differ between consumers and
|
|
7
|
+
belong in each consumer's thin adapter, not here.
|
|
8
|
+
|
|
9
|
+
Two callers re-export the formula under their own public ``wilson_lower_bound``
|
|
10
|
+
name while preserving their historical contracts:
|
|
11
|
+
|
|
12
|
+
* :mod:`adaptorch.online_router` — float inputs, keyword-only ``z > 0``,
|
|
13
|
+
raises on non-finite / negative / ``successes > trials`` / ``z <= 0``,
|
|
14
|
+
and clamps the result with ``min(1, max(0, ·))``.
|
|
15
|
+
* :mod:`adaptorch.circuit_breaker` — int inputs, positional ``z >= 0``,
|
|
16
|
+
clamps ``failures`` into ``[0, observations]``, and clamps the result with
|
|
17
|
+
``max(0, min(1, ·))``.
|
|
18
|
+
|
|
19
|
+
Keeping only the shared formula here removes the drift risk of two copies of
|
|
20
|
+
the same maths while leaving each consumer free to keep its own contract.
|
|
21
|
+
Only :mod:`math` is imported so the module stays free of circular imports.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from __future__ import annotations
|
|
25
|
+
|
|
26
|
+
import math
|
|
27
|
+
|
|
28
|
+
__all__ = ["wilson_score_lower_bound"]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def wilson_score_lower_bound(successes: float, trials: float, *, z: float) -> float:
|
|
32
|
+
"""Return the raw Wilson score interval lower bound.
|
|
33
|
+
|
|
34
|
+
Computes the pure Wilson lower-bound expression for ``successes`` out of
|
|
35
|
+
``trials`` at critical value ``z`` and nothing else — inputs are used
|
|
36
|
+
verbatim and the result is returned unclamped.
|
|
37
|
+
|
|
38
|
+
The caller is responsible for every contract concern:
|
|
39
|
+
|
|
40
|
+
* ``trials`` **must** be ``> 0`` (this function divides by ``trials``;
|
|
41
|
+
the empty-sample case is a caller policy, not a formula property);
|
|
42
|
+
* input validation / clamping of ``successes``, ``trials``, and ``z``;
|
|
43
|
+
* clamping the result into ``[0, 1]`` — for well-formed inputs the value
|
|
44
|
+
lies in ``[0, 1]``, but floating-point cancellation at the
|
|
45
|
+
``successes == 0`` / ``successes == trials`` boundaries can push it a
|
|
46
|
+
hair outside that range.
|
|
47
|
+
|
|
48
|
+
Parameters
|
|
49
|
+
----------
|
|
50
|
+
successes:
|
|
51
|
+
Observed successes (or failures, for the breaker). Used as given.
|
|
52
|
+
trials:
|
|
53
|
+
Sample size. Must be ``> 0``; not checked here.
|
|
54
|
+
z:
|
|
55
|
+
Standard-normal critical value. Used as given (no domain policy).
|
|
56
|
+
"""
|
|
57
|
+
p_hat = successes / trials
|
|
58
|
+
z_squared = z * z
|
|
59
|
+
denominator = 1.0 + z_squared / trials
|
|
60
|
+
centre = p_hat + z_squared / (2.0 * trials)
|
|
61
|
+
margin = z * math.sqrt(
|
|
62
|
+
p_hat * (1.0 - p_hat) / trials + z_squared / (4.0 * trials * trials)
|
|
63
|
+
)
|
|
64
|
+
return (centre - margin) / denominator
|