agentevolve-optimizer 0.5.0__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.
Files changed (414) hide show
  1. agent_evolve/__init__.py +722 -0
  2. agent_evolve/agentic.py +2800 -0
  3. agent_evolve/api.py +767 -0
  4. agent_evolve/application/__init__.py +1580 -0
  5. agent_evolve/application/action_allocation.py +744 -0
  6. agent_evolve/application/action_allocation_frame.py +347 -0
  7. agent_evolve/application/action_allocation_frame_commit.py +185 -0
  8. agent_evolve/application/action_allocation_frame_commit_v3.py +184 -0
  9. agent_evolve/application/action_allocation_frame_v3.py +338 -0
  10. agent_evolve/application/action_archive_value.py +497 -0
  11. agent_evolve/application/action_evidence_consistency.py +455 -0
  12. agent_evolve/application/action_forecast_partitioning.py +1471 -0
  13. agent_evolve/application/action_metric_projection.py +211 -0
  14. agent_evolve/application/action_role_value.py +680 -0
  15. agent_evolve/application/action_score_authorities.py +363 -0
  16. agent_evolve/application/action_structural_signature.py +116 -0
  17. agent_evolve/application/action_target_realization.py +402 -0
  18. agent_evolve/application/agentic_evolution.py +7734 -0
  19. agent_evolve/application/agentic_portfolio_residual_expert.py +835 -0
  20. agent_evolve/application/anchor_residual_identification.py +463 -0
  21. agent_evolve/application/archive_conditioned_action_target.py +208 -0
  22. agent_evolve/application/artifact_journal.py +246 -0
  23. agent_evolve/application/artifact_replay.py +347 -0
  24. agent_evolve/application/budgeted_optimizer.py +1828 -0
  25. agent_evolve/application/calibrated_campaign.py +485 -0
  26. agent_evolve/application/calibrated_current_prefix_forecast_opportunity.py +322 -0
  27. agent_evolve/application/calibrated_positive_gain_opportunity.py +1581 -0
  28. agent_evolve/application/campaign_capacity_recourse.py +254 -0
  29. agent_evolve/application/campaign_contextual_outcomes.py +119 -0
  30. agent_evolve/application/campaign_diagnostic_blocks.py +930 -0
  31. agent_evolve/application/campaign_evidence_registry.py +262 -0
  32. agent_evolve/application/campaign_execution.py +2537 -0
  33. agent_evolve/application/campaign_generation_audit.py +942 -0
  34. agent_evolve/application/campaign_learning.py +1812 -0
  35. agent_evolve/application/campaign_learning_runtime.py +1977 -0
  36. agent_evolve/application/campaign_search_phase.py +227 -0
  37. agent_evolve/application/campaign_selector_context_extension.py +220 -0
  38. agent_evolve/application/campaign_variation_envelope.py +649 -0
  39. agent_evolve/application/campaign_variation_trace.py +451 -0
  40. agent_evolve/application/candidate_archive_consequence.py +128 -0
  41. agent_evolve/application/causal_opportunity_portfolio_gate.py +385 -0
  42. agent_evolve/application/composite_outcome_updater.py +145 -0
  43. agent_evolve/application/composition_portfolio_selection.py +363 -0
  44. agent_evolve/application/concurrent_stage.py +144 -0
  45. agent_evolve/application/contextual_action_allocation.py +181 -0
  46. agent_evolve/application/contextual_campaign_outcomes.py +267 -0
  47. agent_evolve/application/contextual_campaign_planning.py +1366 -0
  48. agent_evolve/application/contextual_delayed_credit.py +651 -0
  49. agent_evolve/application/contextual_search_controller.py +2374 -0
  50. agent_evolve/application/current_prefix_forecast_opportunity.py +714 -0
  51. agent_evolve/application/decision_metric_projection.py +112 -0
  52. agent_evolve/application/derived_action_semantics.py +129 -0
  53. agent_evolve/application/detailed_evaluation.py +449 -0
  54. agent_evolve/application/earned_lineage.py +1011 -0
  55. agent_evolve/application/effective_choice_audit.py +484 -0
  56. agent_evolve/application/empirical_consequence_calibration.py +908 -0
  57. agent_evolve/application/evaluation_accounting.py +325 -0
  58. agent_evolve/application/evaluation_cache.py +199 -0
  59. agent_evolve/application/evaluation_escrow.py +547 -0
  60. agent_evolve/application/evaluation_recourse.py +253 -0
  61. agent_evolve/application/event_recorder.py +151 -0
  62. agent_evolve/application/evolution_campaign.py +1840 -0
  63. agent_evolve/application/executable_hypothesis.py +323 -0
  64. agent_evolve/application/factorial_branch_pilot.py +772 -0
  65. agent_evolve/application/finite_acquisition_capacity_recourse.py +672 -0
  66. agent_evolve/application/finite_acquisition_residual_expert.py +373 -0
  67. agent_evolve/application/finite_acquisition_variation_envelope.py +802 -0
  68. agent_evolve/application/finite_action_hypothesis_semantics.py +446 -0
  69. agent_evolve/application/finite_action_selection.py +188 -0
  70. agent_evolve/application/finite_action_set.py +306 -0
  71. agent_evolve/application/finite_action_transition.py +537 -0
  72. agent_evolve/application/finite_variation_eligibility.py +296 -0
  73. agent_evolve/application/forecast_geometry_portfolio.py +799 -0
  74. agent_evolve/application/forecast_opportunity_shadow_calibration.py +316 -0
  75. agent_evolve/application/front_proximity_admission.py +311 -0
  76. agent_evolve/application/front_proximity_parent_basis.py +458 -0
  77. agent_evolve/application/frozen_hurdle_score.py +659 -0
  78. agent_evolve/application/g3_causal_screen.py +2257 -0
  79. agent_evolve/application/g3_causal_validation.py +1046 -0
  80. agent_evolve/application/g3_postseal_curation.py +818 -0
  81. agent_evolve/application/gated_agentic_generator.py +205 -0
  82. agent_evolve/application/generation_feedback.py +293 -0
  83. agent_evolve/application/generative_proposal_journal.py +185 -0
  84. agent_evolve/application/geometry_conditional_elasticity.py +453 -0
  85. agent_evolve/application/global_wave_action_allocation.py +1151 -0
  86. agent_evolve/application/head_mass_conditional_seat.py +268 -0
  87. agent_evolve/application/identifiable_reflection_evidence.py +1147 -0
  88. agent_evolve/application/identifiable_reflection_learning.py +395 -0
  89. agent_evolve/application/identifiable_reflection_request.py +364 -0
  90. agent_evolve/application/in_memory_residual_archive.py +341 -0
  91. agent_evolve/application/insight_memory.py +1804 -0
  92. agent_evolve/application/live_runtime_manifest.py +758 -0
  93. agent_evolve/application/llm_task_queue.py +769 -0
  94. agent_evolve/application/matched_finite_action_block.py +409 -0
  95. agent_evolve/application/materialized_action_broker.py +2328 -0
  96. agent_evolve/application/materialized_action_constraints.py +83 -0
  97. agent_evolve/application/materialized_variation.py +211 -0
  98. agent_evolve/application/multi_option_evolution.py +1536 -0
  99. agent_evolve/application/outcome_adaptive_action_racing.py +2827 -0
  100. agent_evolve/application/outcome_adaptive_residual_campaign_runtime.py +580 -0
  101. agent_evolve/application/outcome_adaptive_residual_portfolio_evolution.py +3671 -0
  102. agent_evolve/application/outcome_conditioned_portfolio_selection.py +1374 -0
  103. agent_evolve/application/outcome_relation.py +193 -0
  104. agent_evolve/application/paired_allocation_comparison.py +241 -0
  105. agent_evolve/application/paired_block_schedule.py +127 -0
  106. agent_evolve/application/parent_measurement.py +226 -0
  107. agent_evolve/application/pareto_archive.py +811 -0
  108. agent_evolve/application/portfolio_campaign_runtime.py +4739 -0
  109. agent_evolve/application/portfolio_evolution.py +2950 -0
  110. agent_evolve/application/portfolio_hypothesis_observations.py +814 -0
  111. agent_evolve/application/portfolio_memory_attribution.py +581 -0
  112. agent_evolve/application/portfolio_memory_dose.py +788 -0
  113. agent_evolve/application/portfolio_memory_matched_control.py +938 -0
  114. agent_evolve/application/portfolio_memory_transfer.py +297 -0
  115. agent_evolve/application/portfolio_optimization_memory.py +363 -0
  116. agent_evolve/application/portfolio_outcome_feedback.py +1613 -0
  117. agent_evolve/application/portfolio_projection.py +335 -0
  118. agent_evolve/application/portfolio_recombination.py +2032 -0
  119. agent_evolve/application/post_evolution_reflection.py +834 -0
  120. agent_evolve/application/postcommit_rank_authority.py +245 -0
  121. agent_evolve/application/precommitted_portfolio_racing.py +2762 -0
  122. agent_evolve/application/prequential_archive_opportunity_calibration.py +1154 -0
  123. agent_evolve/application/prequential_residual_exploration.py +343 -0
  124. agent_evolve/application/prequential_score_portfolio.py +954 -0
  125. agent_evolve/application/projections.py +292 -0
  126. agent_evolve/application/protected_action_committee.py +1027 -0
  127. agent_evolve/application/protected_branch_pilot.py +376 -0
  128. agent_evolve/application/protected_current_prefix_forecast_opportunity.py +552 -0
  129. agent_evolve/application/provider_replay.py +910 -0
  130. agent_evolve/application/rank_balanced_causal_pilot.py +1372 -0
  131. agent_evolve/application/recombination_residual_expert.py +403 -0
  132. agent_evolve/application/reflection_workflow.py +571 -0
  133. agent_evolve/application/region_conditional_credit.py +911 -0
  134. agent_evolve/application/residual_campaign_runtime.py +531 -0
  135. agent_evolve/application/residual_headroom_campaign_runtime.py +459 -0
  136. agent_evolve/application/residual_headroom_ledger.py +1544 -0
  137. agent_evolve/application/residual_learning_transaction.py +396 -0
  138. agent_evolve/application/residual_portfolio_evolution.py +1228 -0
  139. agent_evolve/application/residual_reachability.py +749 -0
  140. agent_evolve/application/residual_stage_credit.py +499 -0
  141. agent_evolve/application/same_prefix_paired_audit.py +1580 -0
  142. agent_evolve/application/semantic_coverage_score_portfolio.py +838 -0
  143. agent_evolve/application/sequential_lineage_allocation.py +1017 -0
  144. agent_evolve/application/sequential_market_replay.py +1395 -0
  145. agent_evolve/application/sequential_residual_campaign_runtime.py +305 -0
  146. agent_evolve/application/sequential_residual_portfolio_evolution.py +940 -0
  147. agent_evolve/application/single_score_action_allocation.py +299 -0
  148. agent_evolve/application/source_exposure_allocation.py +906 -0
  149. agent_evolve/application/staged_memory.py +210 -0
  150. agent_evolve/application/stratified_cold_start_allocation.py +732 -0
  151. agent_evolve/application/support_guarded_hurdle_score.py +549 -0
  152. agent_evolve/application/target_conditioned_action_forecast.py +595 -0
  153. agent_evolve/application/target_conditioned_campaign.py +566 -0
  154. agent_evolve/application/treatment_assignment.py +201 -0
  155. agent_evolve/application/trusted_objective_evidence.py +217 -0
  156. agent_evolve/application/two_stage_action_evolution.py +1131 -0
  157. agent_evolve/application/v8lite_allocation_policy.py +1083 -0
  158. agent_evolve/application/v9_candidate_policy.py +1303 -0
  159. agent_evolve/bootstrap.py +108 -0
  160. agent_evolve/campaign_presets.py +517 -0
  161. agent_evolve/campaign_profiles.py +452 -0
  162. agent_evolve/campaign_variation_topology.py +288 -0
  163. agent_evolve/campaign_workload.py +950 -0
  164. agent_evolve/cli.py +797 -0
  165. agent_evolve/contract.py +241 -0
  166. agent_evolve/core/__init__.py +91 -0
  167. agent_evolve/core/action_semantics.py +411 -0
  168. agent_evolve/core/authored.py +105 -0
  169. agent_evolve/core/formatting.py +286 -0
  170. agent_evolve/core/optimization_semantics.py +324 -0
  171. agent_evolve/core/problem.py +167 -0
  172. agent_evolve/core/results.py +323 -0
  173. agent_evolve/core/stats.py +70 -0
  174. agent_evolve/core/telemetry.py +100 -0
  175. agent_evolve/domain/__init__.py +89 -0
  176. agent_evolve/domain/artifact.py +162 -0
  177. agent_evolve/domain/durable_text.py +68 -0
  178. agent_evolve/domain/event.py +1454 -0
  179. agent_evolve/domain/finite_action_set.py +426 -0
  180. agent_evolve/domain/finite_variation.py +526 -0
  181. agent_evolve/domain/generative_emission.py +559 -0
  182. agent_evolve/domain/ids.py +163 -0
  183. agent_evolve/domain/inline_text.py +106 -0
  184. agent_evolve/domain/insight.py +27 -0
  185. agent_evolve/domain/lineage.py +737 -0
  186. agent_evolve/domain/llm_task_queue.py +960 -0
  187. agent_evolve/domain/outcome.py +96 -0
  188. agent_evolve/domain/patch.py +854 -0
  189. agent_evolve/domain/typed_json.py +542 -0
  190. agent_evolve/domain/variation_space.py +158 -0
  191. agent_evolve/driver.py +1014 -0
  192. agent_evolve/harness/__init__.py +29 -0
  193. agent_evolve/harness/base.py +242 -0
  194. agent_evolve/harness/directives.py +163 -0
  195. agent_evolve/harness/generative_seal.py +479 -0
  196. agent_evolve/harness/registry.py +41 -0
  197. agent_evolve/infrastructure/__init__.py +39 -0
  198. agent_evolve/infrastructure/artifacts/__init__.py +6 -0
  199. agent_evolve/infrastructure/artifacts/_verification.py +67 -0
  200. agent_evolve/infrastructure/artifacts/filesystem.py +343 -0
  201. agent_evolve/infrastructure/artifacts/in_memory.py +73 -0
  202. agent_evolve/infrastructure/asyncio_runtime.py +109 -0
  203. agent_evolve/infrastructure/authored_runtime.py +188 -0
  204. agent_evolve/infrastructure/authored_worker.py +171 -0
  205. agent_evolve/infrastructure/clock.py +53 -0
  206. agent_evolve/infrastructure/events/__init__.py +6 -0
  207. agent_evolve/infrastructure/events/_validation.py +89 -0
  208. agent_evolve/infrastructure/events/in_memory.py +56 -0
  209. agent_evolve/infrastructure/events/jsonl.py +193 -0
  210. agent_evolve/infrastructure/exception_provenance.py +215 -0
  211. agent_evolve/infrastructure/ids.py +118 -0
  212. agent_evolve/infrastructure/lineage_codec.py +1836 -0
  213. agent_evolve/infrastructure/outcome_adaptive_phase_journal.py +170 -0
  214. agent_evolve/infrastructure/residual_headroom_journal.py +221 -0
  215. agent_evolve/infrastructure/resource_lease.py +370 -0
  216. agent_evolve/infrastructure/sanitization/__init__.py +8 -0
  217. agent_evolve/infrastructure/sanitization/strict_json.py +484 -0
  218. agent_evolve/infrastructure/sequential_phase_journal.py +170 -0
  219. agent_evolve/infrastructure/stream_liveness.py +383 -0
  220. agent_evolve/infrastructure/subprocess_boundary.py +136 -0
  221. agent_evolve/integrations/__init__.py +1 -0
  222. agent_evolve/integrations/botorch/__init__.py +28 -0
  223. agent_evolve/integrations/botorch/finite_qlognehvi.py +190 -0
  224. agent_evolve/integrations/botorch/finite_qlognehvi_batch.py +155 -0
  225. agent_evolve/integrations/botorch/finite_qlognehvi_batch_identity.py +20 -0
  226. agent_evolve/integrations/botorch/finite_qlognehvi_batch_worker.py +55 -0
  227. agent_evolve/integrations/botorch/finite_qlognehvi_identity.py +22 -0
  228. agent_evolve/integrations/botorch/finite_qlognehvi_worker.py +55 -0
  229. agent_evolve/integrations/botorch/subprocess_qlognehvi.py +261 -0
  230. agent_evolve/integrations/botorch/subprocess_qlognehvi_batch.py +273 -0
  231. agent_evolve/integrations/completion.py +242 -0
  232. agent_evolve/integrations/pydantic_ai/__init__.py +441 -0
  233. agent_evolve/integrations/pydantic_ai/action_forecast.py +1068 -0
  234. agent_evolve/integrations/pydantic_ai/agentic_generator.py +2308 -0
  235. agent_evolve/integrations/pydantic_ai/async_generator.py +1604 -0
  236. agent_evolve/integrations/pydantic_ai/boundary_codec.py +1526 -0
  237. agent_evolve/integrations/pydantic_ai/calibrated_portfolio_campaign.py +756 -0
  238. agent_evolve/integrations/pydantic_ai/calibrated_portfolio_selection.py +7537 -0
  239. agent_evolve/integrations/pydantic_ai/campaign_acquisition.py +609 -0
  240. agent_evolve/integrations/pydantic_ai/execution_binding.py +138 -0
  241. agent_evolve/integrations/pydantic_ai/forecast_geometry_action_committee.py +217 -0
  242. agent_evolve/integrations/pydantic_ai/harness.py +159 -0
  243. agent_evolve/integrations/pydantic_ai/heterogeneous_model_execution.py +306 -0
  244. agent_evolve/integrations/pydantic_ai/hierarchical_residual_adaptive_semantic_view.py +179 -0
  245. agent_evolve/integrations/pydantic_ai/json_schema_dialect.py +108 -0
  246. agent_evolve/integrations/pydantic_ai/materialized_hierarchical_residual_expert.py +952 -0
  247. agent_evolve/integrations/pydantic_ai/materialized_portfolio_judge.py +520 -0
  248. agent_evolve/integrations/pydantic_ai/model_execution_profile.py +659 -0
  249. agent_evolve/integrations/pydantic_ai/outbound_request_manifest.py +1170 -0
  250. agent_evolve/integrations/pydantic_ai/portable_residual_consequence_features.py +575 -0
  251. agent_evolve/integrations/pydantic_ai/portfolio_selection.py +422 -0
  252. agent_evolve/integrations/pydantic_ai/progress_aware_openrouter.py +416 -0
  253. agent_evolve/integrations/pydantic_ai/provider_attempt_join.py +1523 -0
  254. agent_evolve/integrations/pydantic_ai/provider_free_calibrated_runner.py +607 -0
  255. agent_evolve/integrations/pydantic_ai/queued_runner.py +2634 -0
  256. agent_evolve/integrations/pydantic_ai/reconciled_residual_reachability.py +1417 -0
  257. agent_evolve/integrations/pydantic_ai/residual_forecast_geometry.py +445 -0
  258. agent_evolve/integrations/pydantic_ai/residual_reachability.py +674 -0
  259. agent_evolve/integrations/pydantic_ai/residual_semantic_cells.py +239 -0
  260. agent_evolve/integrations/pydantic_ai/sealed_output_replay.py +1068 -0
  261. agent_evolve/integrations/pydantic_ai/semantic_coverage_residual_portfolio.py +770 -0
  262. agent_evolve/integrations/pydantic_ai/semantic_decision_replay.py +383 -0
  263. agent_evolve/integrations/pydantic_ai/support_adaptive_residual_portfolio.py +135 -0
  264. agent_evolve/integrations/pydantic_ai/trusted_residual_prompt_context.py +143 -0
  265. agent_evolve/integrations/pydantic_ai/validated_openrouter_model.py +107 -0
  266. agent_evolve/integrations/pymoo_adapter.py +242 -0
  267. agent_evolve/policies/__init__.py +17 -0
  268. agent_evolve/policies/check.py +469 -0
  269. agent_evolve/policies/emit_scaffold.py +451 -0
  270. agent_evolve/policies/feedback/__init__.py +37 -0
  271. agent_evolve/policies/feedback/held_out_asn.py +1325 -0
  272. agent_evolve/policies/genetic.py +607 -0
  273. agent_evolve/policies/llm_backoff.py +183 -0
  274. agent_evolve/policies/llm_chooser.py +226 -0
  275. agent_evolve/policies/llm_generator.py +1760 -0
  276. agent_evolve/policies/llm_init.py +267 -0
  277. agent_evolve/policies/llm_operator.py +109 -0
  278. agent_evolve/policies/llm_prior.py +194 -0
  279. agent_evolve/policies/llm_surrogate.py +334 -0
  280. agent_evolve/policies/measurement_evidence.py +704 -0
  281. agent_evolve/policies/memory/__init__.py +223 -0
  282. agent_evolve/policies/memory/balanced_subset_blocks.py +707 -0
  283. agent_evolve/policies/memory/compatibility_matching.py +593 -0
  284. agent_evolve/policies/memory/global_falsification.py +1841 -0
  285. agent_evolve/policies/memory/prompt_shape.py +503 -0
  286. agent_evolve/policies/memory/randomized_subset.py +714 -0
  287. agent_evolve/policies/memory/staged_causal.py +1270 -0
  288. agent_evolve/policies/memory/treatment_compliance.py +759 -0
  289. agent_evolve/policies/objective_resolution/__init__.py +17 -0
  290. agent_evolve/policies/objective_resolution/fixed_grid.py +364 -0
  291. agent_evolve/policies/operator_portfolio.py +407 -0
  292. agent_evolve/policies/reguidance.py +1133 -0
  293. agent_evolve/policies/reward/__init__.py +83 -0
  294. agent_evolve/policies/reward/affine_candidate_consequence.py +156 -0
  295. agent_evolve/policies/reward/affine_candidate_consequence_3d.py +159 -0
  296. agent_evolve/policies/reward/affine_hypervolume.py +490 -0
  297. agent_evolve/policies/reward/affine_hypervolume_3d.py +567 -0
  298. agent_evolve/policies/reward/contextual_marginal_utility.py +318 -0
  299. agent_evolve/policies/reward/frozen_archive.py +360 -0
  300. agent_evolve/policies/reward/frozen_wave_archive.py +368 -0
  301. agent_evolve/policies/search_state.py +208 -0
  302. agent_evolve/policies/selection/__init__.py +345 -0
  303. agent_evolve/policies/selection/acquisition_certified_slate.py +684 -0
  304. agent_evolve/policies/selection/affine_frontier_context.py +330 -0
  305. agent_evolve/policies/selection/affine_frontier_target.py +473 -0
  306. agent_evolve/policies/selection/archive_elite.py +1346 -0
  307. agent_evolve/policies/selection/calibrated_portfolio_binding.py +640 -0
  308. agent_evolve/policies/selection/calibrated_slate.py +1394 -0
  309. agent_evolve/policies/selection/calibrated_slate_codec.py +579 -0
  310. agent_evolve/policies/selection/common_candidate_pool.py +685 -0
  311. agent_evolve/policies/selection/diagnostic_sampling.py +319 -0
  312. agent_evolve/policies/selection/disjoint_pairs.py +479 -0
  313. agent_evolve/policies/selection/elite_explorer.py +719 -0
  314. agent_evolve/policies/selection/finite_action.py +187 -0
  315. agent_evolve/policies/selection/finite_option_prompt_projection.py +377 -0
  316. agent_evolve/policies/selection/finite_palette_evidence.py +247 -0
  317. agent_evolve/policies/selection/forecast_calibration.py +922 -0
  318. agent_evolve/policies/selection/frontier_probe_slate.py +814 -0
  319. agent_evolve/policies/selection/frozen_archive_pairs.py +762 -0
  320. agent_evolve/policies/selection/full_support_slate.py +91 -0
  321. agent_evolve/policies/selection/meaningful_direction.py +240 -0
  322. agent_evolve/policies/selection/memory_dose_feasibility.py +259 -0
  323. agent_evolve/policies/selection/model_anchored_slate.py +826 -0
  324. agent_evolve/policies/selection/phenotype_recourse.py +979 -0
  325. agent_evolve/policies/selection/proposal_support.py +368 -0
  326. agent_evolve/policies/selection/random_portfolio.py +254 -0
  327. agent_evolve/policies/selection/regret_bounded_slate.py +1084 -0
  328. agent_evolve/policies/selection/residual_frontier.py +463 -0
  329. agent_evolve/policies/selection/residual_frontier_target.py +605 -0
  330. agent_evolve/policies/selection/structural_posterior_slate.py +1571 -0
  331. agent_evolve/policies/selection/target_conditioned_allocator.py +648 -0
  332. agent_evolve/policies/selection/target_conditioned_features.py +812 -0
  333. agent_evolve/policies/selection/target_conditioned_prequential.py +1527 -0
  334. agent_evolve/policies/selection/task_keyed_palette.py +906 -0
  335. agent_evolve/policies/semantics.py +147 -0
  336. agent_evolve/policies/structure.py +362 -0
  337. agent_evolve/policies/structured_output_budget.py +62 -0
  338. agent_evolve/policies/surrogate.py +696 -0
  339. agent_evolve/policies/variation/__init__.py +1 -0
  340. agent_evolve/policies/variation/compositional_finite_catalog.py +426 -0
  341. agent_evolve/policies/variation/crossover_inheritance.py +575 -0
  342. agent_evolve/policies/variation/disjoint_recombination.py +611 -0
  343. agent_evolve/policies/variation/exact_composition_capacity.py +214 -0
  344. agent_evolve/policies/variation/exact_parent_crossover.py +950 -0
  345. agent_evolve/policies/variation/multiscale_restart_catalog.py +372 -0
  346. agent_evolve/policies/variation/source_union_finite_catalog.py +403 -0
  347. agent_evolve/policies/variation/typed_patch.py +1981 -0
  348. agent_evolve/policies/weighted_prior.py +394 -0
  349. agent_evolve/ports/__init__.py +383 -0
  350. agent_evolve/ports/action_allocation.py +733 -0
  351. agent_evolve/ports/action_allocation_frame.py +1153 -0
  352. agent_evolve/ports/action_allocation_frame_commit.py +294 -0
  353. agent_evolve/ports/action_allocation_frame_commit_v3.py +432 -0
  354. agent_evolve/ports/action_allocation_frame_v3.py +995 -0
  355. agent_evolve/ports/action_forecast.py +1568 -0
  356. agent_evolve/ports/action_metric_projection.py +165 -0
  357. agent_evolve/ports/agentic_generator.py +1561 -0
  358. agent_evolve/ports/archive_context.py +136 -0
  359. agent_evolve/ports/artifact_sanitizer.py +44 -0
  360. agent_evolve/ports/artifact_store.py +225 -0
  361. agent_evolve/ports/clock.py +13 -0
  362. agent_evolve/ports/contextual_search_allocation.py +827 -0
  363. agent_evolve/ports/decision_metric_projection.py +258 -0
  364. agent_evolve/ports/event_store.py +55 -0
  365. agent_evolve/ports/executable_hypothesis.py +557 -0
  366. agent_evolve/ports/finite_acquisition.py +377 -0
  367. agent_evolve/ports/finite_acquisition_batch.py +296 -0
  368. agent_evolve/ports/finite_acquisition_batch_json.py +164 -0
  369. agent_evolve/ports/finite_acquisition_json.py +247 -0
  370. agent_evolve/ports/finite_acquisition_space.py +168 -0
  371. agent_evolve/ports/finite_action_selection.py +348 -0
  372. agent_evolve/ports/finite_action_set.py +256 -0
  373. agent_evolve/ports/frontier_target.py +396 -0
  374. agent_evolve/ports/generation_failure.py +43 -0
  375. agent_evolve/ports/hard_feasibility.py +233 -0
  376. agent_evolve/ports/id_factory.py +34 -0
  377. agent_evolve/ports/llm_task_queue.py +93 -0
  378. agent_evolve/ports/objective_resolution.py +419 -0
  379. agent_evolve/ports/paired_allocation_comparison.py +401 -0
  380. agent_evolve/ports/paired_block_schedule.py +475 -0
  381. agent_evolve/ports/parent_measurement.py +336 -0
  382. agent_evolve/ports/portfolio_memory_dose.py +643 -0
  383. agent_evolve/ports/portfolio_selection.py +3169 -0
  384. agent_evolve/ports/postcommit_rank_authority.py +467 -0
  385. agent_evolve/ports/presented_action_evidence.py +794 -0
  386. agent_evolve/ports/resource_lease.py +162 -0
  387. agent_evolve/ports/structured_generator.py +734 -0
  388. agent_evolve/ports/structured_output_budget.py +120 -0
  389. agent_evolve/ports/subprocess_boundary.py +138 -0
  390. agent_evolve/ports/treatment_assignment.py +466 -0
  391. agent_evolve/ports/variation_catalog.py +76 -0
  392. agent_evolve/ports/variation_source.py +226 -0
  393. agent_evolve/proposal_mode.py +157 -0
  394. agent_evolve/proposers/__init__.py +10 -0
  395. agent_evolve/proposers/random_proposer.py +188 -0
  396. agent_evolve/provider_accounting.py +163 -0
  397. agent_evolve/py.typed +0 -0
  398. agent_evolve/reference_method.py +1570 -0
  399. agent_evolve/session/__init__.py +11 -0
  400. agent_evolve/session/authorship.py +864 -0
  401. agent_evolve/session/evaluate.py +236 -0
  402. agent_evolve/session/fidelity.py +237 -0
  403. agent_evolve/session/genetic_loop.py +742 -0
  404. agent_evolve/session/loop.py +803 -0
  405. agent_evolve/session/screening.py +671 -0
  406. agent_evolve/settings.py +376 -0
  407. agent_evolve/workload_kit.py +368 -0
  408. agent_evolve/workload_prompt.py +398 -0
  409. agentevolve_optimizer-0.5.0.dist-info/METADATA +599 -0
  410. agentevolve_optimizer-0.5.0.dist-info/RECORD +414 -0
  411. agentevolve_optimizer-0.5.0.dist-info/WHEEL +5 -0
  412. agentevolve_optimizer-0.5.0.dist-info/entry_points.txt +2 -0
  413. agentevolve_optimizer-0.5.0.dist-info/licenses/LICENSE +21 -0
  414. agentevolve_optimizer-0.5.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2800 @@
1
+ """Stable, benchmark-neutral composition surface for agentic evolution.
2
+
3
+ Benchmark packages should depend on this module, not on the internal
4
+ ``application`` package. A benchmark supplies domain semantics through the
5
+ frozen :class:`AgenticBenchmark` bundle; :func:`compose_agentic_optimizer`
6
+ wires those semantics into the evolution engine and archive exactly once.
7
+
8
+ The façade deliberately keeps provider construction outside its boundary. A
9
+ caller injects any :class:`AgenticGenerator`, planner (or deferred planner
10
+ factory), ID factory, and memory bank. Runtime-bound feedback can likewise be
11
+ constructed through a deferred factory. This keeps benchmark adapters
12
+ independent of Pydantic AI, OpenRouter, or any future model runtime while still
13
+ guaranteeing that stateful policies receive the composition root's exact engine,
14
+ IDs, and memory objects.
15
+ """
16
+
17
+ from __future__ import annotations
18
+
19
+ import math
20
+ import re
21
+ from collections.abc import Callable, Mapping
22
+ from dataclasses import dataclass, field
23
+ from typing import Any, Protocol, runtime_checkable
24
+
25
+ from pydantic import BaseModel
26
+
27
+ from agent_evolve.application.agentic_evolution import (
28
+ AgenticEvolutionEngine,
29
+ CrossoverResponseMode,
30
+ EvolutionCandidate,
31
+ InvocationOutcome,
32
+ InvocationPlan,
33
+ MutationContract,
34
+ MutationResponseMode,
35
+ OperatorKind,
36
+ REWARD_DEFINITION_HASH,
37
+ ReflectionCallExecutionError,
38
+ ReflectionCallReceipt,
39
+ ReflectionCallRequest,
40
+ ReflectionCallStatus,
41
+ ReflectionPublication,
42
+ ReflectionPublicationResult,
43
+ ReflectionRowProjectionBinding,
44
+ RewardPolicyBinding,
45
+ default_evidence_prompt,
46
+ default_parent_relative_reward,
47
+ )
48
+ from agent_evolve.application.budgeted_optimizer import (
49
+ BudgetedAgenticOptimizer,
50
+ FrozenWaveReward,
51
+ GenerationPlan,
52
+ GenerationPlanner,
53
+ OptimizerBudget,
54
+ OptimizerBudgetExceeded,
55
+ OptimizerContractError,
56
+ OptimizerExecutionError,
57
+ OptimizerPlanningError,
58
+ OptimizerResult,
59
+ OptimizerSlot,
60
+ OptimizerState,
61
+ SeedAdmissionPolicy,
62
+ )
63
+ from agent_evolve.application.detailed_evaluation import (
64
+ DetailedEvaluation,
65
+ DetailedEvaluationAdapter,
66
+ DetailedEvaluationPayload,
67
+ EvaluationCheck,
68
+ EvaluationCheckStatus,
69
+ EvaluationTimings,
70
+ EvaluatorIdentity,
71
+ )
72
+ from agent_evolve.application.effective_choice_audit import (
73
+ EFFECTIVE_CHOICE_AUDIT_DEFINITION_SHA256,
74
+ EFFECTIVE_CHOICE_AUDIT_POLICY_ID,
75
+ EFFECTIVE_CHOICE_AUDIT_POLICY_VERSION,
76
+ EffectiveChoiceAuditError,
77
+ EffectiveChoiceAuditReceipt,
78
+ SelectedCardBindingMode,
79
+ audit_effective_choice_plan,
80
+ validate_effective_choice_audit_receipt,
81
+ )
82
+ from agent_evolve.application.generation_feedback import (
83
+ GenerationFeedbackContext,
84
+ GenerationFeedbackInterceptor,
85
+ GenerationFeedbackReceipt,
86
+ GenerationFeedbackReservation,
87
+ GenerationFeedbackResult,
88
+ generation_feedback_receipt_hash,
89
+ seal_generation_feedback,
90
+ validate_generation_feedback_receipt,
91
+ )
92
+ from agent_evolve.application.g3_causal_screen import (
93
+ G1_DIAGNOSTIC_SLOT_IDS,
94
+ G2_SLOT_IDS,
95
+ G3_SLOT_IDS,
96
+ G3BenchmarkBoundary,
97
+ G3CausalScreenPlanner,
98
+ G3ExpectedEndpoint,
99
+ G3ExpectedUnion,
100
+ G3TerminalValidationAuthority,
101
+ G3_SCREEN_BUDGET,
102
+ FrozenDiagnosticPermutation,
103
+ ParentBoundActionChoice,
104
+ PreparedHypothesisMatrix,
105
+ )
106
+ from agent_evolve.application.g3_causal_validation import (
107
+ G3CausalScreenResultValidationReceipt,
108
+ G3MechanismDecision,
109
+ G3TerminalStateValidationReceipt,
110
+ G3TerminalValidationError,
111
+ validate_g3_causal_screen_result,
112
+ validate_g3_terminal_state,
113
+ )
114
+ from agent_evolve.application.g3_postseal_curation import (
115
+ G3CurationSourceScope,
116
+ G3PostsealCurationAuthority,
117
+ G3PostsealCurationFactory,
118
+ G3PostsealCurationInterceptor,
119
+ G3PostsealCurationReceipt,
120
+ G3PostsealCurationSpec,
121
+ G3_POSTSEAL_CURATION_DEFINITION_SHA256,
122
+ build_g3_postseal_curation_reservation,
123
+ )
124
+ from agent_evolve.application.action_allocation import (
125
+ GREEDY_RISK_DIVERSITY_ALLOCATOR_DEFINITION_SHA256,
126
+ GREEDY_RISK_DIVERSITY_ALLOCATOR_ID,
127
+ GREEDY_RISK_DIVERSITY_ALLOCATOR_VERSION,
128
+ GreedyRiskAdjustedDiversityAllocator,
129
+ )
130
+ from agent_evolve.application.action_allocation_frame import (
131
+ AllocationSurfaceGateRejected,
132
+ AuditedGreedyForecastFrameAllocator,
133
+ )
134
+ from agent_evolve.application.action_allocation_frame_commit import (
135
+ FrameActionAllocationCommitRejected,
136
+ build_frame_action_allocation_phase_commit,
137
+ validate_frame_action_allocation_phase_commit,
138
+ )
139
+ from agent_evolve.application.derived_action_semantics import (
140
+ derive_action_space_semantics,
141
+ )
142
+ from agent_evolve.application.action_forecast_partitioning import (
143
+ ActionForecastBlockHealthSubsetBinding,
144
+ ActionForecastHealthFrameKind,
145
+ ActionForecastHealthPolicyBinding,
146
+ ActionForecastHealthSubsetPolicyBinding,
147
+ ActionForecastWaveError,
148
+ ConcurrentActionForecastWave,
149
+ ResolvedActionForecastHealthAssessment,
150
+ assess_resolved_action_forecast_block_health,
151
+ assess_resolved_action_forecast_block_subset_health,
152
+ assess_resolved_action_forecast_health,
153
+ build_action_forecast_block_requests,
154
+ build_action_forecast_partition_layout,
155
+ lenient_action_forecast_health_policy,
156
+ )
157
+ from agent_evolve.application.two_stage_action_evolution import (
158
+ ACTION_EVALUATION_REUSE_POLICY_DEFINITION_SHA256,
159
+ ACTION_EVALUATION_REUSE_POLICY_ID,
160
+ ACTION_EVALUATION_REUSE_POLICY_VERSION,
161
+ DURABLE_PHASE_COMMIT_POLICY_DEFINITION_SHA256,
162
+ DURABLE_PHASE_COMMIT_POLICY_ID,
163
+ DURABLE_PHASE_COMMIT_POLICY_VERSION,
164
+ ActionEvaluationReuseMode,
165
+ ActionEvaluationReusePolicyBinding,
166
+ ActionAllocationArmExecution,
167
+ ActionForecastArmExecution,
168
+ ActionForecastArmPlan,
169
+ DurablePhaseCommitPolicyBinding,
170
+ DurablePhaseCommitRequirement,
171
+ FiniteActionEvaluationRequest,
172
+ FiniteActionEvaluationResult,
173
+ FiniteActionEvaluator,
174
+ FiniteActionEvaluatorBinding,
175
+ PreparedTwoStageActionEvolution,
176
+ PreparedTwoStageActionEvolutionRequest,
177
+ PreparedTwoStageActionEvolutionResult,
178
+ SCIENTIFIC_ARM_ORDER,
179
+ TwoStageActionPhase,
180
+ TwoStageActionPhaseCommit,
181
+ TwoStageActionPhaseCommitError,
182
+ TwoStageActionPhaseCommitSink,
183
+ TwoStageActionPhaseReceipt,
184
+ optional_phase_commit_policy,
185
+ per_arm_evaluation_reuse_policy,
186
+ required_scientific_phase_commit_policy,
187
+ )
188
+ from agent_evolve.application.gated_agentic_generator import (
189
+ AgenticTelemetryPolicy,
190
+ TelemetryGatedAgenticGenerator,
191
+ )
192
+ from agent_evolve.application.insight_memory import (
193
+ InsightLifecycleChangeRequest,
194
+ InsightLifecycleState,
195
+ InsightMemoryEntry,
196
+ InsightEvidenceLineage,
197
+ InsightMemoryBank,
198
+ InsightOrigin,
199
+ InsightRelation,
200
+ InsightRelationKind,
201
+ QuarantineTestAdmissionReceipt,
202
+ )
203
+ from agent_evolve.application.materialized_variation import (
204
+ materialized_disjoint_invocation,
205
+ materialized_finite_action_decision,
206
+ )
207
+ from agent_evolve.application.matched_finite_action_block import (
208
+ MatchedFiniteActionBenchmark,
209
+ MatchedFiniteActionBlockFactory,
210
+ MatchedFiniteActionBlockPlanner,
211
+ finite_action_mutation_boundary,
212
+ )
213
+ from agent_evolve.application.multi_option_evolution import (
214
+ AdaptiveShuffledMateCrossoverPolicy,
215
+ G3CrossoverPlanPolicy,
216
+ MULTI_OPTION_EVOLUTION_BUDGET,
217
+ MULTI_OPTION_G1_SLOT_IDS,
218
+ MULTI_OPTION_G2_SLOT_IDS,
219
+ MULTI_OPTION_G3_CORE_SLOT_IDS,
220
+ MULTI_OPTION_G3_CROSSOVER_SLOT_IDS,
221
+ MULTI_OPTION_G3_SLOT_IDS,
222
+ MULTI_OPTION_G3_UNION_SOURCES,
223
+ MultiOptionEvolutionBenchmark,
224
+ MultiOptionEvolutionPlanner,
225
+ MultiOptionEvolutionPlannerFactory,
226
+ OrderedTwoSeedRolePolicy,
227
+ ParentBoundFiniteChoice,
228
+ SeedRolePolicy,
229
+ SeedRoleSelection,
230
+ )
231
+ from agent_evolve.policies.variation.exact_parent_crossover import (
232
+ DEFAULT_MAX_EXACT_PARENT_CROSSOVER_LOCI,
233
+ MAX_EXACT_PARENT_CROSSOVER_LOCI,
234
+ MIN_EXACT_PARENT_CROSSOVER_LOCI,
235
+ ExactParentCrossoverContract,
236
+ ExactParentCrossoverLocus,
237
+ ExactParentCrossoverMaterialization,
238
+ ExactParentCrossoverReceipt,
239
+ ExactParentImportPlan,
240
+ ExactParentLocusAttribution,
241
+ ExactParentSource,
242
+ build_exact_parent_import_plan,
243
+ canonical_candidate_path_text,
244
+ derive_exact_parent_crossover_contract,
245
+ exact_parent_import_exclusions_sha256,
246
+ materialize_exact_parent_crossover,
247
+ replay_exact_parent_crossover,
248
+ resolve_exact_parent_import_for_target,
249
+ validate_exact_parent_import_exclusions,
250
+ )
251
+ from agent_evolve.policies.variation.compositional_finite_catalog import (
252
+ COMPOSITION_LEFT_OPTION_METADATA_KEY,
253
+ COMPOSITION_REQUIRED_PROPOSALS_METADATA_KEY,
254
+ COMPOSITION_RIGHT_OPTION_METADATA_KEY,
255
+ COMPOSITION_SELECTION_EXPOSURE_METADATA_KEY,
256
+ COMPOSITIONAL_FINITE_CATALOG_POLICY_ID,
257
+ COMPOSITIONAL_FINITE_CATALOG_POLICY_VERSION,
258
+ COMPOSITE_OPTION_FAMILY,
259
+ HIERARCHICAL_COMPOSITIONAL_FINITE_CATALOG_POLICY_ID,
260
+ HIERARCHICAL_COMPOSITIONAL_FINITE_CATALOG_POLICY_VERSION,
261
+ BoundedCompositionalFiniteVariationCatalog,
262
+ CompositionSelectionExposure,
263
+ )
264
+ from agent_evolve.policies.variation.source_union_finite_catalog import (
265
+ EVALUATION_SOURCE_METADATA_KEY,
266
+ EVALUATION_SOURCE_MINIMUM_METADATA_KEY,
267
+ SOURCE_UNION_POLICY_ID,
268
+ SOURCE_UNION_POLICY_VERSION,
269
+ SourceExposureFiniteVariationCatalog,
270
+ SourceUnionFiniteVariationCatalog,
271
+ required_ranked_source_evaluation_option_ids,
272
+ required_source_evaluation_counts,
273
+ required_source_evaluation_option_ids,
274
+ )
275
+ from agent_evolve.policies.variation.multiscale_restart_catalog import (
276
+ DEFAULT_RESTART_RADII,
277
+ DEFAULT_RESTARTS_PER_RADIUS,
278
+ GENERIC_MULTISCALE_RESTART_CATALOG_ID,
279
+ GENERIC_MULTISCALE_RESTART_CATALOG_VERSION,
280
+ GENERIC_MULTISCALE_RESTART_FAMILY,
281
+ GENERIC_MULTISCALE_RESTART_POLICY_ID,
282
+ GENERIC_MULTISCALE_RESTART_POLICY_VERSION,
283
+ GENERIC_MULTISCALE_RESTART_SOURCE_ID,
284
+ GenericMultiscaleRestartFiniteVariationCatalog,
285
+ )
286
+ from agent_evolve.application.executable_hypothesis import (
287
+ CompiledHypothesisTreatment,
288
+ compile_registered_hypothesis_treatment,
289
+ registered_source_evidence_sha256,
290
+ )
291
+ from agent_evolve.application.finite_action_set import (
292
+ compile_and_seal_finite_action_set,
293
+ )
294
+ from agent_evolve.application.finite_action_selection import (
295
+ MODEL_FINITE_ACTION_SELECTOR_DEFINITION_SHA256,
296
+ MODEL_FINITE_ACTION_SELECTOR_POLICY_ID,
297
+ MODEL_FINITE_ACTION_SELECTOR_POLICY_VERSION,
298
+ model_finite_action_telemetry_sha256,
299
+ seal_model_finite_action_decision,
300
+ )
301
+ from agent_evolve.application.outcome_relation import (
302
+ ObjectiveParetoOutcomePolicy,
303
+ OutcomeComparator,
304
+ OutcomeRelation,
305
+ OutcomeRelationPolicyBinding,
306
+ objective_pareto_outcome_binding,
307
+ )
308
+ from agent_evolve.application.finite_variation_eligibility import (
309
+ FINITE_VARIATION_ELIGIBILITY_POLICY_DEFINITION_SHA256,
310
+ FINITE_VARIATION_ELIGIBILITY_POLICY_ID,
311
+ FINITE_VARIATION_ELIGIBILITY_POLICY_VERSION,
312
+ EligibleFiniteVariationView,
313
+ FiniteVariationEligibilityReceipt,
314
+ OptionPhenotypeBinding,
315
+ eligible_finite_variation_view,
316
+ exact_configuration_phenotype_bindings,
317
+ )
318
+ from agent_evolve.application.portfolio_evolution import (
319
+ ProviderTrafficWitness,
320
+ EXACT_MEMORY_CONTEXT_PROJECTION_DEFINITION_SHA256,
321
+ PORTFOLIO_MATERIALIZATION_POLICY_ID,
322
+ PORTFOLIO_MATERIALIZATION_POLICY_VERSION,
323
+ MaterializedPortfolioEngine,
324
+ PortfolioCandidateFailureEvidence,
325
+ PortfolioEvolution,
326
+ PortfolioMemberMaterializationReceipt,
327
+ PortfolioMemberDisposition,
328
+ PortfolioMemoryCreditBatchPreparation,
329
+ PortfolioMemoryCreditBatchReceipt,
330
+ PortfolioMemoryCreditPlan,
331
+ PortfolioMemoryCreditReceipt,
332
+ PortfolioMemoryContextProjectionBinding,
333
+ PortfolioMemoryMatchedControlWavePlan,
334
+ PortfolioPendingMemoryCredit,
335
+ PortfolioRewardAggregationBinding,
336
+ PortfolioVariationMemberReceipt,
337
+ PortfolioVariationWaveReceipt,
338
+ PortfolioVariationWaveRequest,
339
+ PortfolioVariationWaveResult,
340
+ portfolio_selection_telemetry_sha256,
341
+ )
342
+ from agent_evolve.application.portfolio_recombination import (
343
+ ArchiveAwareDisjointPairSelectionDecision,
344
+ ArchiveAwareDisjointParentPairPolicy,
345
+ FrozenArchiveBranchUtility,
346
+ FrozenArchiveSourcePairUtility,
347
+ FrozenArchiveSourceUtilityContext,
348
+ FrozenArchiveSourceUtilityReceipt,
349
+ ObservedSourceBranch,
350
+ PortfolioPairAttemptReceipt,
351
+ PortfolioRecombination,
352
+ PortfolioRecombinationBranchBinding,
353
+ PortfolioRecombinationMemberReceipt,
354
+ PortfolioRecombinationNoPairReason,
355
+ PortfolioRecombinationNoPairReceipt,
356
+ PortfolioRecombinationSourceExclusionReason,
357
+ PortfolioRecombinationSourceExclusionReceipt,
358
+ PortfolioRecombinationWaveReceipt,
359
+ PortfolioRecombinationWaveRequest,
360
+ PortfolioRecombinationWaveResult,
361
+ bind_portfolio_recombination_source_utilities,
362
+ frozen_archive_source_utility_context,
363
+ portfolio_recombination_observed_sources,
364
+ )
365
+ from agent_evolve.application.portfolio_projection import (
366
+ admit_portfolio_card_sources,
367
+ bind_portfolio_experimental_view,
368
+ portfolio_card_from_insight_entry,
369
+ project_action_neutral_insight_prompt_payload,
370
+ )
371
+ from agent_evolve.application.pareto_archive import (
372
+ EvidenceAdmissionPolicy,
373
+ ParetoArchive,
374
+ )
375
+ from agent_evolve.application.post_evolution_reflection import (
376
+ POST_EVOLUTION_REFLECTION_DEFINITION_SHA256,
377
+ PostEvolutionPredecessorResolver,
378
+ PostEvolutionReflectionAuthority,
379
+ PostEvolutionReflectionFactory,
380
+ PostEvolutionReflectionInterceptor,
381
+ PostEvolutionReflectionReceipt,
382
+ PostEvolutionReflectionSource,
383
+ PostEvolutionReflectionSourceScope,
384
+ PostEvolutionReflectionSpec,
385
+ )
386
+ from agent_evolve.application.reflection_workflow import (
387
+ ContrastShardedReflectionWorkflow,
388
+ PlannedReflectionBatchCall,
389
+ ReflectionPromptShard,
390
+ ReflectionWorkflow,
391
+ ReflectionWorkflowExecutionError,
392
+ ReflectionWorkflowRequest,
393
+ ReflectionWorkflowResult,
394
+ StrictBatchedReflectionWorkflow,
395
+ )
396
+ from agent_evolve.application.campaign_selector_context_extension import (
397
+ CAMPAIGN_SELECTOR_CONTEXT_EXTENSION_KEY,
398
+ CAMPAIGN_SELECTOR_CONTEXT_EXTENSION_MAX_BYTES,
399
+ CampaignSelectorContextExtension,
400
+ attach_campaign_selector_context_extension,
401
+ resolve_campaign_selector_context_extension,
402
+ )
403
+ from agent_evolve.application.portfolio_memory_dose import (
404
+ EXACT_PARENT_PORTFOLIO_MEMORY_DOSE_SUPPORT_POLICY_DEFINITION_SHA256,
405
+ EXACT_PARENT_PORTFOLIO_MEMORY_DOSE_SUPPORT_POLICY_ID,
406
+ EXACT_PARENT_PORTFOLIO_MEMORY_DOSE_SUPPORT_POLICY_VERSION,
407
+ PORTFOLIO_MEMORY_CONTEXT_TRANSFER_POLICY_DEFINITION_SHA256,
408
+ PORTFOLIO_MEMORY_CONTEXT_TRANSFER_POLICY_ID,
409
+ PORTFOLIO_MEMORY_CONTEXT_TRANSFER_POLICY_VERSION,
410
+ PORTFOLIO_MEMORY_DOSE_SUPPORT_POLICY_DEFINITION_SHA256,
411
+ PORTFOLIO_MEMORY_DOSE_SUPPORT_POLICY_ID,
412
+ PORTFOLIO_MEMORY_DOSE_SUPPORT_POLICY_VERSION,
413
+ PORTFOLIO_MEMORY_TRANSFER_LADDER_POLICY_DEFINITION_SHA256,
414
+ PORTFOLIO_MEMORY_TRANSFER_LADDER_POLICY_ID,
415
+ PORTFOLIO_MEMORY_TRANSFER_LADDER_POLICY_VERSION,
416
+ PortfolioMemoryContextTransferAssessment,
417
+ PortfolioMemoryDoseCardSemantics,
418
+ PortfolioMemoryDoseSupportScope,
419
+ PortfolioMemoryTransferLadderAssessment,
420
+ PortfolioMemoryTransferTier,
421
+ assess_portfolio_memory_context_transfer,
422
+ assess_portfolio_memory_transfer_ladder,
423
+ derive_portfolio_memory_advisory_card_support,
424
+ derive_portfolio_memory_dose_card_support,
425
+ )
426
+ from agent_evolve.application.portfolio_memory_transfer import (
427
+ PORTFOLIO_MEMORY_TRANSFER_LANE_RESOLVER_DEFINITION_SHA256,
428
+ PORTFOLIO_MEMORY_TRANSFER_LANE_RESOLVER_ID,
429
+ PORTFOLIO_MEMORY_TRANSFER_LANE_RESOLVER_VERSION,
430
+ PortfolioMemoryTransferCard,
431
+ PortfolioMemoryTransferLane,
432
+ PortfolioMemoryTransferLaneResolution,
433
+ PortfolioMemoryTransferLaneResolver,
434
+ )
435
+ from agent_evolve.application.contextual_search_controller import (
436
+ CONTEXTUAL_SEARCH_CONTROLLER_DEFINITION_SHA256,
437
+ CONTEXTUAL_SEARCH_CONTROLLER_ID,
438
+ CONTEXTUAL_SEARCH_CONTROLLER_VERSION,
439
+ ContextualArmAllocation,
440
+ ContextualArmPosterior,
441
+ ContextualPortfolioAllocationSlice,
442
+ ContextualSearchCompletionAudit,
443
+ ContextualSearchDecision,
444
+ ContextualSearchDelayedCredit,
445
+ ContextualSearchLedger,
446
+ ContextualSearchObservation,
447
+ ContextualSearchQuery,
448
+ ContextualSearchSnapshot,
449
+ ContextualSearchStageAllocation,
450
+ PhaseAwareContextualSearchController,
451
+ SearchArmKind,
452
+ SearchPhase,
453
+ audit_completed_contextual_search_ledger,
454
+ slice_contextual_search_decision,
455
+ )
456
+ from agent_evolve.application.contextual_campaign_planning import (
457
+ CampaignContextualJointCapabilityProjector,
458
+ CampaignContextualPlanningContext,
459
+ CampaignContextualSearchPlan,
460
+ CampaignContextualSearchPlanner,
461
+ FiniteContractContextualJointCapabilityProjector,
462
+ )
463
+ from agent_evolve.application.contextual_campaign_outcomes import (
464
+ CONTEXTUAL_PORTFOLIO_OUTCOME_DEFINITION_SHA256,
465
+ CONTEXTUAL_PORTFOLIO_OUTCOME_POLICY_ID,
466
+ CONTEXTUAL_PORTFOLIO_OUTCOME_POLICY_VERSION,
467
+ ContextualPortfolioOutcomeBatch,
468
+ observe_contextual_portfolio_outcomes,
469
+ )
470
+ from agent_evolve.application.contextual_delayed_credit import (
471
+ CONTEXTUAL_DELAYED_CREDIT_DEFINITION_SHA256,
472
+ CONTEXTUAL_DELAYED_CREDIT_POLICY_ID,
473
+ CONTEXTUAL_DELAYED_CREDIT_POLICY_VERSION,
474
+ ContextualPostRecombinationCreditBatch,
475
+ ContextualTerminalPersistenceCreditBatch,
476
+ observe_contextual_post_recombination_credit,
477
+ observe_contextual_terminal_persistence,
478
+ )
479
+ from agent_evolve.application.portfolio_optimization_memory import (
480
+ PORTFOLIO_OPTIMIZATION_MEMORY_POLICY_DEFINITION_SHA256,
481
+ PORTFOLIO_OPTIMIZATION_MEMORY_POLICY_ID,
482
+ PORTFOLIO_OPTIMIZATION_MEMORY_POLICY_VERSION,
483
+ PortfolioOptimizationMemoryAssessment,
484
+ PortfolioOptimizationMemoryDirective,
485
+ PortfolioOptimizationMemoryDisposition,
486
+ PortfolioOptimizationMetricSign,
487
+ assess_portfolio_optimization_memory,
488
+ )
489
+ from agent_evolve.application.identifiable_reflection_evidence import (
490
+ IDENTIFIABLE_REFLECTION_EVIDENCE_POLICY_DEFINITION_SHA256,
491
+ IDENTIFIABLE_REFLECTION_EVIDENCE_POLICY_ID,
492
+ IDENTIFIABLE_REFLECTION_EVIDENCE_POLICY_VERSION,
493
+ MAX_REFLECTION_LOCAL_INTERVENTION_VALUE_BYTES,
494
+ IdentifiableMutationReflectionContrast,
495
+ IdentifiableReflectionEvidenceSnapshot,
496
+ ReflectionEvidenceExclusionReason,
497
+ ReflectionFalsificationFeedback,
498
+ project_identifiable_reflection_evidence,
499
+ )
500
+ from agent_evolve.application.evolution_campaign import (
501
+ SealedCutoffDelayedAdmissionCadence,
502
+ )
503
+ from agent_evolve.core.problem import (
504
+ ObjectiveSpec,
505
+ Problem,
506
+ ProblemContractError,
507
+ ValidationOutcome,
508
+ validate_objective_specs,
509
+ )
510
+ from agent_evolve.core.action_semantics import (
511
+ ActionAxisCoordinateSemantics,
512
+ ActionAxisSemantics,
513
+ ActionSpaceSemantics,
514
+ render_action_space_semantics,
515
+ )
516
+ from agent_evolve.core.optimization_semantics import (
517
+ MetricRole,
518
+ MetricSemantics,
519
+ MetricSense,
520
+ OptimizationSemantics,
521
+ OutcomeOrderingKind,
522
+ OutcomeOrderingSemantics,
523
+ render_optimization_semantics,
524
+ )
525
+ from agent_evolve.domain.artifact import ArtifactRef, artifact_ref_for_bytes
526
+ from agent_evolve.domain.finite_variation import (
527
+ FiniteActionEvidenceBinding,
528
+ FiniteVariationContract,
529
+ FiniteVariationOption,
530
+ bind_finite_action_evidence,
531
+ )
532
+ from agent_evolve.domain.finite_action_set import (
533
+ FiniteActionCardAuthority,
534
+ FiniteActionOptionAuthority,
535
+ FiniteActionPresentationAuthority,
536
+ FiniteActionSetAuthority,
537
+ FiniteActionSourceMode,
538
+ FiniteActionSupportAuthority,
539
+ MAX_MATCHED_FINITE_ACTIONS,
540
+ MIN_MATCHED_FINITE_ACTIONS,
541
+ )
542
+ from agent_evolve.domain.ids import (
543
+ CandidateId,
544
+ InsightId,
545
+ LLMCallId,
546
+ OperatorInvocationId,
547
+ )
548
+ from agent_evolve.domain.insight import InsightRef
549
+ from agent_evolve.domain.outcome import FailureCategory, FailureCode, FailureRecord
550
+ from agent_evolve.domain.patch import ArrayIndex, JsonPath, ObjectKey, require_sha256
551
+ from agent_evolve.domain.typed_json import (
552
+ FrozenJsonObject,
553
+ FrozenJsonValue,
554
+ freeze_json,
555
+ thaw_json,
556
+ typed_json_sha256,
557
+ )
558
+ from agent_evolve.infrastructure.ids import DeterministicIdFactory, UuidIdFactory
559
+ from agent_evolve.infrastructure.resource_lease import (
560
+ FileExclusiveResourceLease,
561
+ ResourceConflictDetected,
562
+ ResourceLeaseUnavailable,
563
+ )
564
+ from agent_evolve.infrastructure.subprocess_boundary import (
565
+ ExplicitEnvironmentSubprocessBoundary,
566
+ )
567
+ from agent_evolve.policies.structured_output_budget import (
568
+ FixedStructuredOutputBudgetPolicy,
569
+ )
570
+ from agent_evolve.policies.memory.prompt_shape import PromptShapeCommitmentPolicy
571
+ from agent_evolve.policies.memory.treatment_compliance import (
572
+ FiniteTreatmentAction,
573
+ InsightTreatmentRequirement,
574
+ StrictTreatmentCompliancePolicy,
575
+ TREATMENT_COMPLIANCE_DEFINITION_SHA256,
576
+ TREATMENT_COMPLIANCE_POLICY_ID,
577
+ TREATMENT_COMPLIANCE_POLICY_VERSION,
578
+ TreatmentAdmissionReceipt,
579
+ TreatmentAdmissionRequest,
580
+ TreatmentActionBinding,
581
+ TreatmentAssignmentRole,
582
+ TreatmentClaimMode,
583
+ TreatmentCompliancePolicy,
584
+ TreatmentComplianceRejected,
585
+ TreatmentComplianceViolation,
586
+ TreatmentInsightEvidence,
587
+ TreatmentInsightBinding,
588
+ TreatmentPreflightReceipt,
589
+ TreatmentPreflightRequest,
590
+ validate_treatment_admission_receipt,
591
+ validate_treatment_preflight_receipt,
592
+ )
593
+ from agent_evolve.policies.feedback.held_out_asn import (
594
+ G1ReflectionFeedbackInterceptor,
595
+ HELD_OUT_SELECTOR_POLICY_ID,
596
+ HELD_OUT_SELECTOR_POLICY_VERSION,
597
+ HeldOutASNAssignmentCommitment,
598
+ HeldOutASNAssignments,
599
+ HeldOutASNPlanSet,
600
+ HeldOutASNPlannerAdapter,
601
+ HeldOutArm,
602
+ HeldOutArmAssignment,
603
+ HeldOutAssignmentUnavailable,
604
+ HeldOutAssignmentUnavailableReason,
605
+ HeldOutScoreMapEntry,
606
+ REFLECTIVE_FEEDBACK_POLICY_ID,
607
+ REFLECTIVE_FEEDBACK_POLICY_VERSION,
608
+ ReflectedCard,
609
+ ReflectedCardBatch,
610
+ ReflectedCardMailbox,
611
+ ReflectiveFeedbackContractError,
612
+ build_reflected_card_batch,
613
+ reflection_contrast_id,
614
+ register_neutral_sham_card,
615
+ )
616
+ from agent_evolve.policies.selection.phenotype_recourse import (
617
+ PhenotypeIdentity,
618
+ PhenotypeIdentityPolicy,
619
+ SemanticProjectionPhenotypeIdentityPolicy,
620
+ TypedConfigurationPhenotypeIdentityPolicy,
621
+ )
622
+ from agent_evolve.policies.selection.finite_action import (
623
+ POLICY_DEFINITION_SHA256 as UNIFORM_FINITE_ACTION_POLICY_DEFINITION_SHA256,
624
+ POLICY_ID as UNIFORM_FINITE_ACTION_POLICY_ID,
625
+ POLICY_VERSION as UNIFORM_FINITE_ACTION_POLICY_VERSION,
626
+ TaskKeyedUniformFiniteActionPolicy,
627
+ )
628
+ from agent_evolve.policies.selection.archive_elite import (
629
+ ArchiveEliteParentSelection,
630
+ ArchiveEliteParentSelectionReceipt,
631
+ ArchiveEliteParentSelector,
632
+ ArchiveReservoirCrowdingKind,
633
+ ArchiveReservoirParentSelection,
634
+ ArchiveReservoirParentSelectionReceipt,
635
+ ArchiveReservoirParentSelector,
636
+ ArchiveReservoirRankedCandidate,
637
+ POLICY_DEFINITION_SHA256 as ARCHIVE_ELITE_PARENT_POLICY_DEFINITION_SHA256,
638
+ POLICY_ID as ARCHIVE_ELITE_PARENT_POLICY_ID,
639
+ POLICY_VERSION as ARCHIVE_ELITE_PARENT_POLICY_VERSION,
640
+ RESERVOIR_POLICY_DEFINITION_SHA256 as ARCHIVE_RESERVOIR_PARENT_POLICY_DEFINITION_SHA256,
641
+ RESERVOIR_POLICY_ID as ARCHIVE_RESERVOIR_PARENT_POLICY_ID,
642
+ RESERVOIR_POLICY_VERSION as ARCHIVE_RESERVOIR_PARENT_POLICY_VERSION,
643
+ TaskKeyedArchiveEliteParentPolicy,
644
+ TaskKeyedArchiveReservoirParentPolicy,
645
+ validate_archive_elite_parent_selection,
646
+ validate_archive_reservoir_parent_selection,
647
+ )
648
+ from agent_evolve.policies.selection.elite_explorer import (
649
+ ArchiveEliteExplorerParentSelection,
650
+ ArchiveEliteExplorerParentSelectionReceipt,
651
+ ArchiveEliteExplorerParentSelector,
652
+ EliteExplorerFallbackReason,
653
+ EliteExplorerLaneId,
654
+ EliteExplorerLaneReceipt,
655
+ EliteExplorerLaneSource,
656
+ POLICY_DEFINITION_SHA256 as ARCHIVE_ELITE_EXPLORER_PARENT_POLICY_DEFINITION_SHA256,
657
+ POLICY_ID as ARCHIVE_ELITE_EXPLORER_PARENT_POLICY_ID,
658
+ POLICY_VERSION as ARCHIVE_ELITE_EXPLORER_PARENT_POLICY_VERSION,
659
+ ROTATION_LAW_ID as ARCHIVE_ELITE_EXPLORER_PARENT_ROTATION_LAW_ID,
660
+ TaskKeyedArchiveEliteExplorerParentPolicy,
661
+ validate_archive_elite_explorer_parent_selection,
662
+ )
663
+ from agent_evolve.ports.agentic_generator import (
664
+ AgenticCallTelemetry,
665
+ AgenticGenerator,
666
+ CandidateDraft,
667
+ FiniteVariationSelectionDraft,
668
+ InsightDraft,
669
+ MetricComparisonAnchor,
670
+ MetricComparisonAnchorKind,
671
+ MetricEffectDirection,
672
+ MetricEffectPrediction,
673
+ ReflectionConsumerScope,
674
+ ReflectionEvidenceCatalog,
675
+ ReflectionEvidenceCatalogEntry,
676
+ ReflectionGenerationRequest,
677
+ ReflectionGenerationResult,
678
+ ReflectionInsightContract,
679
+ ReflectionInsightKind,
680
+ VariationGenerationRequest,
681
+ VariationGenerationResult,
682
+ resolve_finite_variation_selection,
683
+ validate_reflection_evidence_catalog_result,
684
+ validate_reflection_insight_draft,
685
+ )
686
+ from agent_evolve.ports.action_forecast import (
687
+ ActionEvidenceCitation,
688
+ ActionForecastBlockPolicy,
689
+ ActionForecastBlockRequest,
690
+ ActionForecastBlockResult,
691
+ ActionForecastBlockSpec,
692
+ ActionForecastDraft,
693
+ ActionForecastEvidenceMode,
694
+ ActionForecastPartitionLayout,
695
+ ActionForecastPartitionPolicyBinding,
696
+ ActionForecastPolicy,
697
+ ActionForecastRequest,
698
+ ActionForecastResult,
699
+ ActionMetricForecast,
700
+ MetricForecastScale,
701
+ ParentMetricValue,
702
+ ResolvedActionEvidenceCitation,
703
+ ResolvedActionForecast,
704
+ ResolvedActionForecastBatch,
705
+ ResolvedActionForecastBlock,
706
+ ResolvedActionMetricForecast,
707
+ resolve_action_forecast_block,
708
+ resolve_action_forecasts,
709
+ validate_resolved_action_forecasts,
710
+ )
711
+ from agent_evolve.ports.action_metric_projection import (
712
+ ExactActionMetricProjection,
713
+ ExactActionMetricProjectionBatch,
714
+ )
715
+ from agent_evolve.ports.action_allocation import (
716
+ ActionAllocationRequest,
717
+ ActionAllocationResult,
718
+ ActionPortfolioDecision,
719
+ AllocatedActionMember,
720
+ DeterministicActionAllocator,
721
+ ExactActionArmCountConstraint,
722
+ ForecastPortfolioUtility,
723
+ ForecastPortfolioUtilityBinding,
724
+ ForecastPortfolioUtilityInput,
725
+ ForecastQuantile,
726
+ PortfolioAllocationScore,
727
+ validate_action_portfolio_decision,
728
+ )
729
+ from agent_evolve.ports.action_allocation_frame import (
730
+ ActionAllocationFrameSubsetPolicyBinding,
731
+ ActionAllocationSurfaceAudit,
732
+ ActionForecastAllocationFrameKind,
733
+ AllocationCandidateScoreDiagnostic,
734
+ AllocationCandidateScoreDiagnosticInput,
735
+ AllocationScoreDiagnostic,
736
+ AllocationScoreDiagnosticBinding,
737
+ AllocationSurfaceGatePolicyBinding,
738
+ AllocationSurfaceStepAudit,
739
+ AuditedFrameActionAllocationResult,
740
+ FrameActionAllocationRequest,
741
+ FrameActionPortfolioDecision,
742
+ ResolvedActionForecastAllocationFrame,
743
+ allocation_score_multiset_sha256,
744
+ allocation_surface_failure_codes,
745
+ bind_action_forecast_block_allocation_frame,
746
+ bind_action_forecast_block_subset_allocation_frame,
747
+ bind_complete_action_forecast_allocation_frame,
748
+ validate_frame_action_portfolio_decision,
749
+ )
750
+ from agent_evolve.ports.action_allocation_frame_commit import (
751
+ FrameActionAllocationCommitInput,
752
+ FrameActionAllocationTreatmentExecution,
753
+ frame_source_call_and_request_identity,
754
+ validate_treatment_occurrence_frame_request,
755
+ )
756
+ from agent_evolve.ports.portfolio_selection import (
757
+ CANONICAL_NEUTRAL_PORTFOLIO_PROMPT_PAYLOAD,
758
+ CANONICAL_REDACTED_PORTFOLIO_EVIDENCE_SHA256,
759
+ CardScoreComponent,
760
+ CardTransferAdjudicationRequest,
761
+ CardTransferAdjudicator,
762
+ CardTransferScoreReceipt,
763
+ PortfolioCard,
764
+ PortfolioCardPromptPayload,
765
+ PortfolioCardSourceBinding,
766
+ PortfolioCardSourceRegistry,
767
+ PortfolioCardViewReceipt,
768
+ PortfolioCardViewTransform,
769
+ PortfolioExperimentalArm,
770
+ PortfolioExperimentalViewReceipt,
771
+ PortfolioMemberDraft,
772
+ PortfolioSelectionPolicy,
773
+ PortfolioSelectionRequest,
774
+ PortfolioSelectionResult,
775
+ RankedPortfolioDecision,
776
+ RankedPortfolioMember,
777
+ derive_portfolio_card_view,
778
+ portfolio_card_snapshot_sha256,
779
+ portfolio_card_score_state_sha256,
780
+ resolve_ranked_portfolio_decision,
781
+ validate_card_transfer_score_receipt,
782
+ validate_portfolio_experimental_view,
783
+ validate_ranked_portfolio_decision,
784
+ )
785
+ from agent_evolve.ports.portfolio_memory_dose import (
786
+ BOUNDED_PORTFOLIO_MEMORY_DOSE_POLICY_DEFINITION_SHA256,
787
+ BOUNDED_PORTFOLIO_MEMORY_DOSE_POLICY_ID,
788
+ BOUNDED_PORTFOLIO_MEMORY_DOSE_POLICY_VERSION,
789
+ BoundedPortfolioMemoryDoseContract,
790
+ PortfolioMemoryDoseAssessment,
791
+ PortfolioMemoryDoseCardSupport,
792
+ PortfolioMemoryDoseMember,
793
+ PortfolioMemoryDoseRejected,
794
+ PortfolioMemoryDoseStage,
795
+ PortfolioMemoryDoseViolation,
796
+ PortfolioMemoryExposureScope,
797
+ assess_evaluated_portfolio_memory_dose,
798
+ assess_proposed_portfolio_memory_dose,
799
+ require_passing_portfolio_memory_dose,
800
+ )
801
+ from agent_evolve.ports.structured_output_budget import (
802
+ StructuredOutputBudgetPolicy,
803
+ StructuredOutputRequestKind,
804
+ resolve_structured_output_budget,
805
+ )
806
+ from agent_evolve.ports.objective_resolution import (
807
+ EXACT_OBJECTIVE_RESOLUTION_DEFINITION_SHA256,
808
+ EXACT_OBJECTIVE_RESOLUTION_POLICY_ID,
809
+ EXACT_OBJECTIVE_RESOLUTION_POLICY_VERSION,
810
+ ExactObjectiveResolution,
811
+ ObjectiveResolutionPort,
812
+ ObjectiveResolutionReceipt,
813
+ ObjectiveResolutionRequest,
814
+ ObjectiveResolutionResult,
815
+ objective_resolution_policy_metadata,
816
+ resolve_objectives,
817
+ )
818
+ from agent_evolve.ports.id_factory import IdFactory
819
+ from agent_evolve.ports.hard_feasibility import (
820
+ HardFeasibilityPort,
821
+ validate_hard_feasibility_port,
822
+ )
823
+ from agent_evolve.ports.contextual_search_allocation import (
824
+ ContextualArmCountCapability,
825
+ ContextualArmCountCapabilityWitness,
826
+ ContextualJointCountVector,
827
+ ContextualLaneJointCountCapability,
828
+ ContextualPortfolioAllocationContract,
829
+ ContextualPortfolioAllocationRealization,
830
+ )
831
+ from agent_evolve.ports.frontier_target import (
832
+ CampaignPortfolioFrontierTarget,
833
+ CampaignPortfolioFrontierTargetAllocator,
834
+ )
835
+ from agent_evolve.ports.executable_hypothesis import (
836
+ ExecutableHypothesisTestSpec,
837
+ HypothesisApplicabilityPort,
838
+ HypothesisApplicabilityStatus,
839
+ HypothesisCompilationReceipt,
840
+ HypothesisCompilationRequest,
841
+ validate_hypothesis_compilation,
842
+ validate_hypothesis_compiler_identity,
843
+ )
844
+ from agent_evolve.ports.finite_action_set import (
845
+ FiniteActionSetCompilationRequest,
846
+ FiniteActionSetCompiler,
847
+ FiniteActionSetDraft,
848
+ validate_finite_action_set_compiler_identity,
849
+ )
850
+ from agent_evolve.ports.finite_action_selection import (
851
+ EngineFiniteActionPolicy,
852
+ EngineFiniteActionRequest,
853
+ FiniteActionDecision,
854
+ FiniteActionSelectorKind,
855
+ ProspectiveUniformRankToken,
856
+ validate_finite_action_decision,
857
+ )
858
+ from agent_evolve.ports.resource_lease import (
859
+ ExclusiveResourceLease,
860
+ ResourceConflictObservation,
861
+ ResourceConflictProbe,
862
+ ResourceLeaseReceipt,
863
+ )
864
+ from agent_evolve.ports.subprocess_boundary import (
865
+ BoundedSubprocessBoundary,
866
+ ChildProcessPolicy,
867
+ ChildProcessResult,
868
+ EXPLICIT_ENVIRONMENT_BOUNDARY_DEFINITION_SHA256,
869
+ )
870
+ from agent_evolve.ports.variation_catalog import (
871
+ FiniteVariationCatalog,
872
+ bind_finite_variation_catalog,
873
+ )
874
+ from agent_evolve.ports.variation_source import (
875
+ PRIMARY_VARIATION_SOURCE_ID,
876
+ VARIATION_DIVERSITY_SIGNATURE_METADATA_KEY,
877
+ VARIATION_OPERATOR_METADATA_KEY,
878
+ VARIATION_SOURCE_METADATA_KEY,
879
+ VARIATION_SOURCE_MINIMUM_METADATA_KEY,
880
+ VARIATION_SOURCE_RANK_METADATA_KEY,
881
+ finite_variation_diversity_signature,
882
+ finite_variation_operator_id,
883
+ finite_variation_source_by_option,
884
+ finite_variation_source_id,
885
+ finite_variation_source_ids,
886
+ finite_variation_source_minimum_counts,
887
+ )
888
+
889
+
890
+ _TOKEN = re.compile(r"^[a-z][a-z0-9_.-]{0,95}$")
891
+ TraceSink = Callable[[Mapping[str, object]], None]
892
+ PromptBuilder = Callable[[str, Any, tuple[dict[str, object], ...]], str]
893
+
894
+
895
+ def _catalog_identity(catalog: FiniteVariationCatalog) -> tuple[str, int, str]:
896
+ catalog_id = getattr(catalog, "catalog_id", None)
897
+ catalog_version = getattr(catalog, "catalog_version", None)
898
+ definition_sha256 = getattr(catalog, "definition_sha256", None)
899
+ if type(catalog_id) is not str or _TOKEN.fullmatch(catalog_id) is None:
900
+ raise ValueError("finite variation catalog_id has invalid syntax")
901
+ if type(catalog_version) is not int or catalog_version <= 0:
902
+ raise ValueError("finite variation catalog_version must be positive")
903
+ require_sha256(definition_sha256, "finite variation definition_sha256")
904
+ return catalog_id, catalog_version, definition_sha256
905
+
906
+
907
+ def _catalog_option_families(
908
+ catalog: FiniteVariationCatalog,
909
+ ) -> tuple[str, ...]:
910
+ """Read the explicit family vocabulary required by action semantics.
911
+
912
+ Existing finite catalogs remain valid without this optional declaration.
913
+ A benchmark that publishes action semantics must make each catalog's
914
+ executable family vocabulary inspectable without materializing options for
915
+ an arbitrary parent configuration.
916
+ """
917
+
918
+ families = getattr(catalog, "option_families", None)
919
+ if (
920
+ type(families) is not tuple
921
+ or not families
922
+ or any(
923
+ type(family) is not str or _TOKEN.fullmatch(family) is None
924
+ for family in families
925
+ )
926
+ ):
927
+ raise TypeError(
928
+ "action-semantics catalogs must publish a non-empty exact "
929
+ "option_families tuple"
930
+ )
931
+ if families != tuple(sorted(set(families))):
932
+ raise ValueError(
933
+ "catalog option_families must be unique and canonically sorted"
934
+ )
935
+ return families
936
+
937
+
938
+ @dataclass(frozen=True, slots=True)
939
+ class AgenticBenchmark:
940
+ """Frozen inverted-API bundle for one optimization benchmark.
941
+
942
+ Detailed evaluation is intentionally all-or-nothing: an evidence adapter
943
+ requires an explicit outcome relation, while an outcome relation cannot be
944
+ supplied without detailed evidence. The conservative exact-configuration
945
+ phenotype policy remains a safe default; domains may inject a semantic
946
+ projection when they can prove evaluator equivalence. Objective resolution
947
+ is likewise opt-in: ``None`` preserves the historical exact evaluator
948
+ projection, while an injected resolver separates raw measurement evidence
949
+ from the stable decision values consumed by selection and rewards.
950
+ """
951
+
952
+ problem: Problem[dict[str, object]]
953
+ reward: RewardPolicyBinding = field(
954
+ default_factory=lambda: RewardPolicyBinding(
955
+ default_parent_relative_reward,
956
+ REWARD_DEFINITION_HASH,
957
+ )
958
+ )
959
+ detailed_evaluator: DetailedEvaluationAdapter | None = None
960
+ outcome_relation: OutcomeRelationPolicyBinding | None = None
961
+ optimization_semantics: OptimizationSemantics | None = None
962
+ action_semantics: ActionSpaceSemantics | None = None
963
+ phenotype_identity: PhenotypeIdentityPolicy = field(
964
+ default_factory=TypedConfigurationPhenotypeIdentityPolicy
965
+ )
966
+ finite_variation_catalogs: tuple[FiniteVariationCatalog, ...] = ()
967
+ hypothesis_compiler: HypothesisApplicabilityPort | None = None
968
+ finite_action_set_compiler: FiniteActionSetCompiler | None = None
969
+ objective_resolution: ObjectiveResolutionPort | None = None
970
+ hard_feasibility: HardFeasibilityPort | None = None
971
+ _objectives: tuple[ObjectiveSpec, ...] = field(init=False, repr=False)
972
+ _catalog_identities: tuple[tuple[str, int, str], ...] = field(
973
+ init=False,
974
+ repr=False,
975
+ )
976
+ _evaluator_identity: EvaluatorIdentity | None = field(init=False, repr=False)
977
+ _phenotype_policy_identity: tuple[str, int] = field(init=False, repr=False)
978
+ _optimization_semantics_identity: tuple[str, int, str] | None = field(
979
+ init=False,
980
+ repr=False,
981
+ )
982
+ _objective_resolution_identity: tuple[str, int, str] | None = field(
983
+ init=False,
984
+ repr=False,
985
+ )
986
+ _action_semantics_identity: tuple[str, int, str] | None = field(
987
+ init=False,
988
+ repr=False,
989
+ )
990
+ _catalog_option_family_bindings: tuple[tuple[str, ...], ...] = field(
991
+ init=False,
992
+ repr=False,
993
+ )
994
+ _hypothesis_compiler_identity: tuple[str, int, str] | None = field(
995
+ init=False,
996
+ repr=False,
997
+ )
998
+ _finite_action_set_compiler_identity: tuple[str, int, str] | None = field(
999
+ init=False,
1000
+ repr=False,
1001
+ )
1002
+ _hard_feasibility_identity: tuple[str, int, str] | None = field(
1003
+ init=False,
1004
+ repr=False,
1005
+ )
1006
+
1007
+ def __post_init__(self) -> None:
1008
+ if not isinstance(self.problem, Problem):
1009
+ raise TypeError("problem must implement the public Problem protocol")
1010
+ objectives = tuple(self.problem.objectives)
1011
+ validate_objective_specs(objectives)
1012
+ candidate_model = getattr(self.problem, "candidate_model", None)
1013
+ if not isinstance(candidate_model, type) or not issubclass(
1014
+ candidate_model,
1015
+ BaseModel,
1016
+ ):
1017
+ raise TypeError("agentic problems must publish a Pydantic candidate_model")
1018
+ schema = candidate_model.model_json_schema(by_alias=False)
1019
+ if type(schema) is not dict or schema.get("type") != "object":
1020
+ raise TypeError("candidate_model must publish an object JSON schema")
1021
+
1022
+ if type(self.reward) is not RewardPolicyBinding:
1023
+ raise TypeError("reward must be an exact RewardPolicyBinding")
1024
+ RewardPolicyBinding.__post_init__(self.reward)
1025
+
1026
+ identify = getattr(self.phenotype_identity, "identify", None)
1027
+ if not callable(identify):
1028
+ raise TypeError("phenotype_identity must implement identify")
1029
+ phenotype_policy_identity = (
1030
+ getattr(self.phenotype_identity, "policy_id", None),
1031
+ getattr(self.phenotype_identity, "policy_version", None),
1032
+ )
1033
+ PhenotypeIdentity(
1034
+ policy_id=phenotype_policy_identity[0],
1035
+ policy_version=phenotype_policy_identity[1],
1036
+ value_sha256="0" * 64,
1037
+ )
1038
+
1039
+ evaluator = self.detailed_evaluator
1040
+ relation = self.outcome_relation
1041
+ evaluator_identity: EvaluatorIdentity | None = None
1042
+ if evaluator is None:
1043
+ if relation is not None:
1044
+ raise ValueError(
1045
+ "outcome_relation requires a detailed_evaluator; "
1046
+ "objective-only mode derives its Pareto relation"
1047
+ )
1048
+ else:
1049
+ if not isinstance(evaluator, DetailedEvaluationAdapter):
1050
+ raise TypeError(
1051
+ "detailed_evaluator must implement DetailedEvaluationAdapter"
1052
+ )
1053
+ evaluator_identity = getattr(evaluator, "evaluator_identity", None)
1054
+ if type(evaluator_identity) is not EvaluatorIdentity:
1055
+ raise TypeError(
1056
+ "detailed_evaluator must publish an exact evaluator_identity"
1057
+ )
1058
+ EvaluatorIdentity.__post_init__(evaluator_identity)
1059
+ if type(relation) is not OutcomeRelationPolicyBinding:
1060
+ raise ValueError(
1061
+ "detailed evaluation requires an explicit outcome_relation"
1062
+ )
1063
+ OutcomeRelationPolicyBinding.__post_init__(relation)
1064
+
1065
+ active_relation = (
1066
+ objective_pareto_outcome_binding(objectives)
1067
+ if relation is None
1068
+ else relation
1069
+ )
1070
+ semantics = self.optimization_semantics
1071
+ if semantics is None:
1072
+ semantics = getattr(self.problem, "optimization_semantics", None)
1073
+ if semantics is not None:
1074
+ if type(semantics) is not OptimizationSemantics:
1075
+ raise TypeError(
1076
+ "optimization_semantics must be an exact OptimizationSemantics"
1077
+ )
1078
+ OptimizationSemantics.__post_init__(semantics)
1079
+ semantics.validate_binding(objectives, active_relation.identity)
1080
+
1081
+ objective_resolution_identity = (
1082
+ None
1083
+ if self.objective_resolution is None
1084
+ else objective_resolution_policy_metadata(self.objective_resolution)
1085
+ )
1086
+ hard_feasibility_identity = (
1087
+ None
1088
+ if self.hard_feasibility is None
1089
+ else validate_hard_feasibility_port(self.hard_feasibility)
1090
+ )
1091
+
1092
+ catalogs = self.finite_variation_catalogs
1093
+ if type(catalogs) is not tuple:
1094
+ raise TypeError("finite_variation_catalogs must be an exact tuple")
1095
+ catalog_identities: list[tuple[str, int, str]] = []
1096
+ for catalog in catalogs:
1097
+ if not isinstance(catalog, FiniteVariationCatalog):
1098
+ raise TypeError(
1099
+ "finite_variation_catalogs must implement FiniteVariationCatalog"
1100
+ )
1101
+ catalog_identities.append(_catalog_identity(catalog))
1102
+ catalog_ids = tuple(identity[0] for identity in catalog_identities)
1103
+ if len(set(catalog_ids)) != len(catalog_ids):
1104
+ raise ValueError("finite variation catalog IDs must be unique")
1105
+
1106
+ hypothesis_compiler_identity: tuple[str, int, str] | None = None
1107
+ compiler = self.hypothesis_compiler
1108
+ if compiler is not None:
1109
+ if not isinstance(compiler, HypothesisApplicabilityPort):
1110
+ raise TypeError(
1111
+ "hypothesis_compiler must implement HypothesisApplicabilityPort"
1112
+ )
1113
+ compiler_id = getattr(compiler, "policy_id", None)
1114
+ compiler_version = getattr(compiler, "policy_version", None)
1115
+ compiler_sha256 = getattr(compiler, "definition_sha256", None)
1116
+ if type(compiler_id) is not str or _TOKEN.fullmatch(compiler_id) is None:
1117
+ raise ValueError("hypothesis compiler policy_id has invalid syntax")
1118
+ if type(compiler_version) is not int or compiler_version <= 0:
1119
+ raise ValueError("hypothesis compiler policy_version must be positive")
1120
+ require_sha256(
1121
+ compiler_sha256,
1122
+ "hypothesis compiler definition_sha256",
1123
+ )
1124
+ hypothesis_compiler_identity = (
1125
+ compiler_id,
1126
+ compiler_version,
1127
+ compiler_sha256,
1128
+ )
1129
+
1130
+ finite_action_set_compiler_identity: tuple[str, int, str] | None = None
1131
+ action_set_compiler = self.finite_action_set_compiler
1132
+ if action_set_compiler is not None:
1133
+ finite_action_set_compiler_identity = (
1134
+ validate_finite_action_set_compiler_identity(action_set_compiler)
1135
+ )
1136
+
1137
+ action_semantics = self.action_semantics
1138
+ if action_semantics is None:
1139
+ action_semantics = getattr(self.problem, "action_semantics", None)
1140
+ catalog_option_family_bindings: tuple[tuple[str, ...], ...] = ()
1141
+ if action_semantics is not None:
1142
+ if type(action_semantics) is not ActionSpaceSemantics:
1143
+ raise TypeError(
1144
+ "action_semantics must be an exact ActionSpaceSemantics"
1145
+ )
1146
+ ActionSpaceSemantics.__post_init__(action_semantics)
1147
+ catalog_option_family_bindings = tuple(
1148
+ _catalog_option_families(catalog) for catalog in catalogs
1149
+ )
1150
+ action_semantics.validate_catalog_binding(
1151
+ tuple(catalog_identities),
1152
+ tuple(
1153
+ family
1154
+ for families in catalog_option_family_bindings
1155
+ for family in families
1156
+ ),
1157
+ )
1158
+
1159
+ object.__setattr__(self, "_objectives", objectives)
1160
+ object.__setattr__(self, "_catalog_identities", tuple(catalog_identities))
1161
+ object.__setattr__(self, "_evaluator_identity", evaluator_identity)
1162
+ object.__setattr__(self, "optimization_semantics", semantics)
1163
+ object.__setattr__(self, "action_semantics", action_semantics)
1164
+ object.__setattr__(
1165
+ self,
1166
+ "_optimization_semantics_identity",
1167
+ None if semantics is None else semantics.identity,
1168
+ )
1169
+ object.__setattr__(
1170
+ self,
1171
+ "_objective_resolution_identity",
1172
+ objective_resolution_identity,
1173
+ )
1174
+ object.__setattr__(
1175
+ self,
1176
+ "_action_semantics_identity",
1177
+ None if action_semantics is None else action_semantics.identity,
1178
+ )
1179
+ object.__setattr__(
1180
+ self,
1181
+ "_catalog_option_family_bindings",
1182
+ catalog_option_family_bindings,
1183
+ )
1184
+ object.__setattr__(
1185
+ self,
1186
+ "_phenotype_policy_identity",
1187
+ phenotype_policy_identity,
1188
+ )
1189
+ object.__setattr__(
1190
+ self,
1191
+ "_hypothesis_compiler_identity",
1192
+ hypothesis_compiler_identity,
1193
+ )
1194
+ object.__setattr__(
1195
+ self,
1196
+ "_finite_action_set_compiler_identity",
1197
+ finite_action_set_compiler_identity,
1198
+ )
1199
+ object.__setattr__(
1200
+ self,
1201
+ "_hard_feasibility_identity",
1202
+ hard_feasibility_identity,
1203
+ )
1204
+
1205
+ @property
1206
+ def objectives(self) -> tuple[ObjectiveSpec, ...]:
1207
+ """Return the objective declaration frozen at adapter construction."""
1208
+
1209
+ return self._objectives
1210
+
1211
+ @property
1212
+ def finite_variation_catalog_identities(
1213
+ self,
1214
+ ) -> tuple[tuple[str, int, str], ...]:
1215
+ """Return identities in their frozen catalog declaration order."""
1216
+
1217
+ return self._catalog_identities
1218
+
1219
+ def validate_binding(self) -> None:
1220
+ """Fail if mutable adapter objects changed after bundle construction."""
1221
+
1222
+ if tuple(self.problem.objectives) != self._objectives:
1223
+ raise ValueError("problem objectives changed after benchmark binding")
1224
+ current_phenotype_identity = (
1225
+ getattr(self.phenotype_identity, "policy_id", None),
1226
+ getattr(self.phenotype_identity, "policy_version", None),
1227
+ )
1228
+ if current_phenotype_identity != self._phenotype_policy_identity:
1229
+ raise ValueError("phenotype policy identity changed after binding")
1230
+ current_evaluator_identity = (
1231
+ None
1232
+ if self.detailed_evaluator is None
1233
+ else getattr(self.detailed_evaluator, "evaluator_identity", None)
1234
+ )
1235
+ if current_evaluator_identity != self._evaluator_identity:
1236
+ raise ValueError("detailed evaluator identity changed after binding")
1237
+ current_semantics_identity = (
1238
+ None
1239
+ if self.optimization_semantics is None
1240
+ else self.optimization_semantics.identity
1241
+ )
1242
+ if current_semantics_identity != self._optimization_semantics_identity:
1243
+ raise ValueError("optimization semantics identity changed after binding")
1244
+ current_objective_resolution_identity = (
1245
+ None
1246
+ if self.objective_resolution is None
1247
+ else objective_resolution_policy_metadata(self.objective_resolution)
1248
+ )
1249
+ if current_objective_resolution_identity != self._objective_resolution_identity:
1250
+ raise ValueError(
1251
+ "objective-resolution policy identity changed after binding"
1252
+ )
1253
+ current_hard_feasibility_identity = (
1254
+ None
1255
+ if self.hard_feasibility is None
1256
+ else validate_hard_feasibility_port(self.hard_feasibility)
1257
+ )
1258
+ if current_hard_feasibility_identity != self._hard_feasibility_identity:
1259
+ raise ValueError("hard-feasibility policy identity changed after binding")
1260
+ current_action_semantics_identity = (
1261
+ None if self.action_semantics is None else self.action_semantics.identity
1262
+ )
1263
+ if current_action_semantics_identity != self._action_semantics_identity:
1264
+ raise ValueError("action semantics identity changed after binding")
1265
+ identities = tuple(
1266
+ _catalog_identity(catalog) for catalog in self.finite_variation_catalogs
1267
+ )
1268
+ if identities != self._catalog_identities:
1269
+ raise ValueError("finite variation catalog identity changed after binding")
1270
+ current_compiler_identity = (
1271
+ None
1272
+ if self.hypothesis_compiler is None
1273
+ else (
1274
+ getattr(self.hypothesis_compiler, "policy_id", None),
1275
+ getattr(self.hypothesis_compiler, "policy_version", None),
1276
+ getattr(self.hypothesis_compiler, "definition_sha256", None),
1277
+ )
1278
+ )
1279
+ if current_compiler_identity != self._hypothesis_compiler_identity:
1280
+ raise ValueError("hypothesis compiler identity changed after binding")
1281
+ current_action_set_compiler_identity = (
1282
+ None
1283
+ if self.finite_action_set_compiler is None
1284
+ else validate_finite_action_set_compiler_identity(
1285
+ self.finite_action_set_compiler
1286
+ )
1287
+ )
1288
+ if (
1289
+ current_action_set_compiler_identity
1290
+ != self._finite_action_set_compiler_identity
1291
+ ):
1292
+ raise ValueError(
1293
+ "finite action set compiler identity changed after binding"
1294
+ )
1295
+ if self.action_semantics is not None:
1296
+ current_family_bindings = tuple(
1297
+ _catalog_option_families(catalog)
1298
+ for catalog in self.finite_variation_catalogs
1299
+ )
1300
+ if current_family_bindings != self._catalog_option_family_bindings:
1301
+ raise ValueError(
1302
+ "finite variation catalog family vocabulary changed after binding"
1303
+ )
1304
+ self.action_semantics.validate_catalog_binding(
1305
+ identities,
1306
+ tuple(
1307
+ family
1308
+ for families in current_family_bindings
1309
+ for family in families
1310
+ ),
1311
+ )
1312
+
1313
+ def bind_finite_variation(
1314
+ self,
1315
+ catalog_id: str,
1316
+ parent_configuration: object,
1317
+ ) -> FiniteVariationContract:
1318
+ """Seal one named benchmark catalog against an exact parent."""
1319
+
1320
+ self.validate_binding()
1321
+ if type(catalog_id) is not str or _TOKEN.fullmatch(catalog_id) is None:
1322
+ raise ValueError("catalog_id has invalid syntax")
1323
+ matches = tuple(
1324
+ catalog
1325
+ for catalog in self.finite_variation_catalogs
1326
+ if catalog.catalog_id == catalog_id
1327
+ )
1328
+ if len(matches) != 1:
1329
+ raise KeyError(f"unknown finite variation catalog {catalog_id!r}")
1330
+ catalog = matches[0]
1331
+ frozen = freeze_json(parent_configuration)
1332
+ if type(frozen) is not FrozenJsonObject:
1333
+ raise TypeError("finite variation parents must be typed-JSON objects")
1334
+ contract = bind_finite_variation_catalog(catalog, frozen)
1335
+ expected_identity = next(
1336
+ identity
1337
+ for identity in self._catalog_identities
1338
+ if identity[0] == catalog_id
1339
+ )
1340
+ if _catalog_identity(catalog) != expected_identity:
1341
+ raise ValueError("finite variation catalog changed while binding options")
1342
+ return contract
1343
+
1344
+ def compile_registered_hypothesis_treatment(
1345
+ self,
1346
+ *,
1347
+ catalog_id: str,
1348
+ parent_candidate_id: CandidateId,
1349
+ parent_configuration: object,
1350
+ entry: InsightMemoryEntry,
1351
+ requested_operator_kind: str,
1352
+ context_projection_sha256: str,
1353
+ endpoint_definition_sha256: str,
1354
+ ) -> CompiledHypothesisTreatment:
1355
+ """Compile one exact registered card into a strict executable treatment."""
1356
+
1357
+ if type(entry) is not InsightMemoryEntry:
1358
+ raise TypeError("entry must be an exact InsightMemoryEntry")
1359
+ entry.__post_init__()
1360
+ self.validate_binding()
1361
+ compiler = self.hypothesis_compiler
1362
+ if compiler is None:
1363
+ raise RuntimeError("benchmark has no hypothesis compiler")
1364
+ contract = self.bind_finite_variation(catalog_id, parent_configuration)
1365
+ request = HypothesisCompilationRequest(
1366
+ parent_candidate_id=parent_candidate_id,
1367
+ reference=entry.reference,
1368
+ insight=entry.draft,
1369
+ source_evidence_sha256=registered_source_evidence_sha256(entry),
1370
+ requested_operator_kind=requested_operator_kind,
1371
+ source_operator_kinds=entry.applicable_operator_kinds,
1372
+ parent_configuration_sha256=contract.parent_configuration_sha256,
1373
+ finite_contract=contract,
1374
+ context_projection_sha256=context_projection_sha256,
1375
+ endpoint_definition_sha256=endpoint_definition_sha256,
1376
+ )
1377
+ return compile_registered_hypothesis_treatment(
1378
+ entry=entry,
1379
+ request=request,
1380
+ compiler=compiler,
1381
+ )
1382
+
1383
+ def compile_finite_action_set(
1384
+ self,
1385
+ *,
1386
+ compiled_anchor: CompiledHypothesisTreatment,
1387
+ required_cardinality: int,
1388
+ source_mode: FiniteActionSourceMode = (
1389
+ FiniteActionSourceMode.COMPILED_ACTIVE_CARD
1390
+ ),
1391
+ ) -> tuple[FiniteActionSetAuthority, FiniteActionSetDraft]:
1392
+ """Seal a matched K-option neighbourhood around an exact card anchor.
1393
+
1394
+ The benchmark-owned compiler returns only option IDs. This composition
1395
+ root resolves and authenticates the complete children and phenotypes;
1396
+ no outcome or evaluator object crosses the compiler boundary.
1397
+ """
1398
+
1399
+ self.validate_binding()
1400
+ compiler = self.finite_action_set_compiler
1401
+ if compiler is None:
1402
+ raise RuntimeError("benchmark has no finite action set compiler")
1403
+ if type(compiled_anchor) is not CompiledHypothesisTreatment:
1404
+ raise TypeError(
1405
+ "compiled_anchor must be an exact CompiledHypothesisTreatment"
1406
+ )
1407
+ CompiledHypothesisTreatment.__post_init__(compiled_anchor)
1408
+ if len(compiled_anchor.requirement.allowed_actions) != 1:
1409
+ raise ValueError("finite action compilation requires one exact anchor")
1410
+ source_contract = compiled_anchor.request.finite_contract
1411
+ catalog_identity = (
1412
+ source_contract.catalog_id,
1413
+ source_contract.catalog_version,
1414
+ source_contract.catalog_definition_sha256,
1415
+ )
1416
+ if catalog_identity not in self._catalog_identities:
1417
+ raise ValueError("compiled anchor uses a foreign benchmark catalog")
1418
+ anchor = compiled_anchor.requirement.allowed_actions[0]
1419
+ request = FiniteActionSetCompilationRequest(
1420
+ parent_candidate_id=compiled_anchor.request.parent_candidate_id,
1421
+ finite_contract=source_contract,
1422
+ anchor_option_id=anchor.option_id,
1423
+ anchor_option_identity_sha256=anchor.option_identity_sha256,
1424
+ exact_anchor_requirement_sha256=(
1425
+ compiled_anchor.requirement.requirement_sha256
1426
+ ),
1427
+ card_reference=compiled_anchor.request.reference,
1428
+ card_content_sha256=compiled_anchor.request.insight.content_sha256,
1429
+ context_projection_sha256=(
1430
+ compiled_anchor.request.context_projection_sha256
1431
+ ),
1432
+ endpoint_definition_sha256=(
1433
+ compiled_anchor.request.endpoint_definition_sha256
1434
+ ),
1435
+ required_cardinality=required_cardinality,
1436
+ current_outcome_access=False,
1437
+ )
1438
+ return compile_and_seal_finite_action_set(
1439
+ compiled_anchor=compiled_anchor,
1440
+ request=request,
1441
+ compiler=compiler,
1442
+ phenotype_identity=self.phenotype_identity,
1443
+ source_mode=source_mode,
1444
+ )
1445
+
1446
+
1447
+ @dataclass(frozen=True, slots=True)
1448
+ class _BoundGenerationPlanner:
1449
+ """Authenticate planner waves against benchmark-owned policy bindings."""
1450
+
1451
+ benchmark: AgenticBenchmark
1452
+ delegate: GenerationPlanner
1453
+
1454
+ def plan(
1455
+ self,
1456
+ state: OptimizerState,
1457
+ budget: OptimizerBudget,
1458
+ ) -> GenerationPlan:
1459
+ plan = self.delegate.plan(state, budget)
1460
+ if type(plan) is not GenerationPlan:
1461
+ raise TypeError("planner must return an exact GenerationPlan")
1462
+ GenerationPlan.__post_init__(plan)
1463
+ if plan.reward.binding.definition_hash != self.benchmark.reward.definition_hash:
1464
+ raise ValueError(
1465
+ "planner wave reward differs from the benchmark reward binding"
1466
+ )
1467
+ if plan.reward.binding.binding_sha256 != self.benchmark.reward.binding_sha256:
1468
+ raise ValueError(
1469
+ "planner wave total reward binding differs from the benchmark"
1470
+ )
1471
+
1472
+ expected_by_catalog_parent: dict[
1473
+ tuple[str, str],
1474
+ FiniteVariationContract,
1475
+ ] = {}
1476
+ for slot in plan.slots:
1477
+ compiled_bindings = tuple(
1478
+ {
1479
+ value.binding_sha256: value
1480
+ for value in (
1481
+ *slot.plan.compiled_hypothesis_eligibility,
1482
+ *(
1483
+ ()
1484
+ if slot.plan.compiled_hypothesis_treatment is None
1485
+ else (slot.plan.compiled_hypothesis_treatment,)
1486
+ ),
1487
+ )
1488
+ }.values()
1489
+ )
1490
+ for compiled in compiled_bindings:
1491
+ compiled.__post_init__()
1492
+ if (
1493
+ compiled.request.endpoint_definition_sha256
1494
+ != plan.reward.binding.definition_hash
1495
+ ):
1496
+ raise ValueError(
1497
+ "compiled treatment endpoint differs from generation reward/Q"
1498
+ )
1499
+ compiler_identity = self.benchmark._hypothesis_compiler_identity
1500
+ receipt_identity = (
1501
+ compiled.receipt.compiler_policy_id,
1502
+ compiled.receipt.compiler_policy_version,
1503
+ compiled.receipt.compiler_definition_sha256,
1504
+ )
1505
+ if compiler_identity is None or receipt_identity != compiler_identity:
1506
+ raise ValueError(
1507
+ "compiled treatment was not issued by the benchmark compiler"
1508
+ )
1509
+ contract = slot.plan.finite_variation_contract
1510
+ if contract is None:
1511
+ continue
1512
+ parent = slot.plan.parents[0]
1513
+ key = (
1514
+ contract.catalog_id,
1515
+ typed_json_sha256(parent.configuration),
1516
+ )
1517
+ expected = expected_by_catalog_parent.get(key)
1518
+ if expected is None:
1519
+ expected = self.benchmark.bind_finite_variation(
1520
+ contract.catalog_id,
1521
+ parent.configuration,
1522
+ )
1523
+ expected_by_catalog_parent[key] = expected
1524
+ finite_authority = slot.plan.finite_action_set_authority
1525
+ if finite_authority is None:
1526
+ if contract.identity_sha256 != expected.identity_sha256:
1527
+ raise ValueError(
1528
+ "finite variation contract was not produced by the "
1529
+ "benchmark-bound catalog"
1530
+ )
1531
+ else:
1532
+ compiler_identity = self.benchmark._finite_action_set_compiler_identity
1533
+ authority_identity = (
1534
+ finite_authority.support_compiler_policy_id,
1535
+ finite_authority.support_compiler_policy_version,
1536
+ finite_authority.support_compiler_definition_sha256,
1537
+ )
1538
+ if compiler_identity is None or authority_identity != compiler_identity:
1539
+ raise ValueError(
1540
+ "finite action authority was not issued by the "
1541
+ "benchmark-bound support compiler"
1542
+ )
1543
+ if (
1544
+ finite_authority.support.support_contract.identity_sha256
1545
+ != contract.identity_sha256
1546
+ or finite_authority.support.source_contract_sha256
1547
+ != expected.identity_sha256
1548
+ or finite_authority.support.parent_candidate_id
1549
+ != parent.candidate_id
1550
+ ):
1551
+ raise ValueError(
1552
+ "finite action authority differs from its benchmark plan"
1553
+ )
1554
+ return plan
1555
+
1556
+
1557
+ @runtime_checkable
1558
+ class GenerationPlannerFactory(Protocol):
1559
+ """Build a planner against the exact runtime objects owned by composition.
1560
+
1561
+ Stateful planners must never be constructed against look-alike engines, ID
1562
+ factories, or memory banks. This deferred seam preserves the inverted API:
1563
+ benchmark packages provide a factory, while the public composition root owns
1564
+ construction order and passes the authoritative runtime identities exactly
1565
+ once.
1566
+ """
1567
+
1568
+ def build(
1569
+ self,
1570
+ *,
1571
+ benchmark: AgenticBenchmark,
1572
+ engine: AgenticEvolutionEngine,
1573
+ id_factory: IdFactory,
1574
+ memory: InsightMemoryBank,
1575
+ ) -> GenerationPlanner: ...
1576
+
1577
+
1578
+ @runtime_checkable
1579
+ class GenerationFeedbackInterceptorFactory(Protocol):
1580
+ """Build post-wave feedback against the exact composed runtime objects."""
1581
+
1582
+ def build(
1583
+ self,
1584
+ *,
1585
+ benchmark: AgenticBenchmark,
1586
+ engine: AgenticEvolutionEngine,
1587
+ id_factory: IdFactory,
1588
+ memory: InsightMemoryBank,
1589
+ planner: GenerationPlanner,
1590
+ ) -> GenerationFeedbackInterceptor: ...
1591
+
1592
+
1593
+ @dataclass(frozen=True, slots=True)
1594
+ class AgenticOptimizerComposition:
1595
+ """Fully wired agentic engine, archive, and budgeted optimizer."""
1596
+
1597
+ benchmark: AgenticBenchmark
1598
+ id_factory: IdFactory
1599
+ memory: InsightMemoryBank
1600
+ engine: AgenticEvolutionEngine
1601
+ archive: ParetoArchive
1602
+ planner: GenerationPlanner
1603
+ feedback_interceptor: GenerationFeedbackInterceptor | None
1604
+ optimizer: BudgetedAgenticOptimizer
1605
+
1606
+ def __post_init__(self) -> None:
1607
+ if self.engine.problem is not self.benchmark.problem:
1608
+ raise ValueError("composition engine is bound to a different problem")
1609
+ if self.engine.ids is not self.id_factory:
1610
+ raise ValueError("composition engine is bound to a different ID factory")
1611
+ if self.engine.memory is not self.memory:
1612
+ raise ValueError("composition engine is bound to a different memory bank")
1613
+ if self.engine.outcome_relation_binding is not (
1614
+ self.archive.outcome_relation_binding
1615
+ ):
1616
+ raise ValueError("engine and archive must share one relation binding")
1617
+ if self.optimizer.engine is not self.engine:
1618
+ raise ValueError("optimizer is bound to a different engine")
1619
+ if self.optimizer.archive is not self.archive:
1620
+ raise ValueError("optimizer is bound to a different archive")
1621
+ bound_planner = self.optimizer.planner
1622
+ if (
1623
+ type(bound_planner) is not _BoundGenerationPlanner
1624
+ or bound_planner.delegate is not self.planner
1625
+ ):
1626
+ raise ValueError("optimizer is bound to a different runtime planner")
1627
+ if self.optimizer.feedback_interceptor is not self.feedback_interceptor:
1628
+ raise ValueError("optimizer is bound to a different feedback interceptor")
1629
+ if self.engine.reward_binding.binding_sha256 != (
1630
+ self.benchmark.reward.binding_sha256
1631
+ ):
1632
+ raise ValueError(
1633
+ "engine total reward binding differs from the benchmark binding"
1634
+ )
1635
+ if self.engine.optimization_semantics is not (
1636
+ self.benchmark.optimization_semantics
1637
+ ):
1638
+ raise ValueError(
1639
+ "engine and benchmark must share one optimization semantics value"
1640
+ )
1641
+ if self.engine.objective_resolution is not (
1642
+ self.benchmark.objective_resolution
1643
+ ):
1644
+ raise ValueError(
1645
+ "engine and benchmark must share one objective-resolution port"
1646
+ )
1647
+
1648
+ @property
1649
+ def outcome_relation(self) -> OutcomeRelationPolicyBinding:
1650
+ """The exact shared engine/archive relation object."""
1651
+
1652
+ return self.engine.outcome_relation_binding
1653
+
1654
+ def bind_finite_variation(
1655
+ self,
1656
+ catalog_id: str,
1657
+ parent_configuration: object,
1658
+ ) -> FiniteVariationContract:
1659
+ return self.benchmark.bind_finite_variation(
1660
+ catalog_id,
1661
+ parent_configuration,
1662
+ )
1663
+
1664
+
1665
+ @dataclass(frozen=True, slots=True)
1666
+ class PortfolioEvolutionComposition:
1667
+ """Benchmark-bound engine and ranked-portfolio application service.
1668
+
1669
+ Unlike :class:`AgenticOptimizerComposition`, this composition has no
1670
+ generation planner, archive scheduler, budget, or optimizer. Workloads
1671
+ inject only their benchmark semantics plus the two model-facing ports;
1672
+ the composition root owns the exact engine, IDs, and memory identities.
1673
+ """
1674
+
1675
+ benchmark: AgenticBenchmark
1676
+ id_factory: IdFactory
1677
+ memory: InsightMemoryBank
1678
+ engine: AgenticEvolutionEngine
1679
+ portfolio: PortfolioEvolution
1680
+
1681
+ def __post_init__(self) -> None:
1682
+ if type(self.benchmark) is not AgenticBenchmark:
1683
+ raise TypeError("benchmark must be an exact AgenticBenchmark")
1684
+ if not isinstance(self.id_factory, IdFactory):
1685
+ raise TypeError("id_factory must implement IdFactory")
1686
+ if type(self.memory) is not InsightMemoryBank:
1687
+ raise TypeError("memory must be an exact InsightMemoryBank")
1688
+ if type(self.engine) is not AgenticEvolutionEngine:
1689
+ raise TypeError("engine must be an exact AgenticEvolutionEngine")
1690
+ if type(self.portfolio) is not PortfolioEvolution:
1691
+ raise TypeError("portfolio must be an exact PortfolioEvolution")
1692
+ if self.engine.problem is not self.benchmark.problem:
1693
+ raise ValueError("composition engine is bound to a different problem")
1694
+ if self.engine.ids is not self.id_factory:
1695
+ raise ValueError("composition engine is bound to a different ID factory")
1696
+ if self.engine.memory is not self.memory:
1697
+ raise ValueError("composition engine is bound to a different memory bank")
1698
+ if self.portfolio.engine is not self.engine:
1699
+ raise ValueError("portfolio service is bound to a different engine")
1700
+ if self.portfolio.ids is not self.id_factory:
1701
+ raise ValueError("portfolio service is bound to a different ID factory")
1702
+ if self.portfolio.memory is not self.memory:
1703
+ raise ValueError("portfolio service is bound to a different memory bank")
1704
+ if self.engine.reward_binding.binding_sha256 != (
1705
+ self.benchmark.reward.binding_sha256
1706
+ ):
1707
+ raise ValueError(
1708
+ "engine total reward binding differs from the benchmark binding"
1709
+ )
1710
+ if self.engine.optimization_semantics is not (
1711
+ self.benchmark.optimization_semantics
1712
+ ):
1713
+ raise ValueError(
1714
+ "engine and benchmark must share one optimization semantics value"
1715
+ )
1716
+ if self.engine.objective_resolution is not (
1717
+ self.benchmark.objective_resolution
1718
+ ):
1719
+ raise ValueError(
1720
+ "engine and benchmark must share one objective-resolution port"
1721
+ )
1722
+
1723
+ @property
1724
+ def outcome_relation(self) -> OutcomeRelationPolicyBinding:
1725
+ """Return the engine's authoritative benchmark outcome relation."""
1726
+
1727
+ return self.engine.outcome_relation_binding
1728
+
1729
+ def bind_finite_variation(
1730
+ self,
1731
+ catalog_id: str,
1732
+ parent_configuration: object,
1733
+ ) -> FiniteVariationContract:
1734
+ """Seal one benchmark-owned finite catalog against an exact parent."""
1735
+
1736
+ return self.benchmark.bind_finite_variation(
1737
+ catalog_id,
1738
+ parent_configuration,
1739
+ )
1740
+
1741
+
1742
+ def compose_portfolio_evolution(
1743
+ benchmark: AgenticBenchmark,
1744
+ *,
1745
+ generator: AgenticGenerator,
1746
+ selector: PortfolioSelectionPolicy,
1747
+ seed: int,
1748
+ id_factory: IdFactory | None = None,
1749
+ memory: InsightMemoryBank | None = None,
1750
+ initial_proposal_sequence: int = 0,
1751
+ evaluator_concurrency: int = 4,
1752
+ engine_trace_sink: TraceSink | None = None,
1753
+ prompt_builder: PromptBuilder = default_evidence_prompt,
1754
+ prompt_shape_commitment_policy: PromptShapeCommitmentPolicy | None = None,
1755
+ reflection_row_projection: ReflectionRowProjectionBinding | None = None,
1756
+ reflection_workflow: ReflectionWorkflow | None = None,
1757
+ max_output_tokens: int = 2_048,
1758
+ structured_output_budget_policy: StructuredOutputBudgetPolicy | None = None,
1759
+ temperature: float | None = 0.2,
1760
+ treatment_compliance_policy: TreatmentCompliancePolicy | None = None,
1761
+ provider_traffic_witness: "ProviderTrafficWitness | None" = None,
1762
+ ) -> PortfolioEvolutionComposition:
1763
+ """Compose ranked finite-option evolution without an optimizer surrogate.
1764
+
1765
+ The benchmark owns evaluation, reward, outcome ordering, phenotype
1766
+ identity, and semantic declarations. The selector owns only ranked opaque
1767
+ option choice. Exact child materialization and concurrent evaluation stay
1768
+ under the benchmark-bound engine, so the same public composition works for
1769
+ continuous, discrete, and constructive workloads.
1770
+ """
1771
+
1772
+ if type(benchmark) is not AgenticBenchmark:
1773
+ raise TypeError("benchmark must be an exact AgenticBenchmark")
1774
+ benchmark.validate_binding()
1775
+ if not isinstance(generator, AgenticGenerator):
1776
+ raise TypeError("generator must implement AgenticGenerator")
1777
+ if not isinstance(selector, PortfolioSelectionPolicy):
1778
+ raise TypeError("selector must implement PortfolioSelectionPolicy")
1779
+ if type(seed) is not int:
1780
+ raise TypeError("seed must be an exact integer")
1781
+ if type(initial_proposal_sequence) is not int or initial_proposal_sequence < 0:
1782
+ raise ValueError("initial_proposal_sequence must be non-negative")
1783
+ if type(evaluator_concurrency) is not int or evaluator_concurrency <= 0:
1784
+ raise ValueError("evaluator_concurrency must be positive")
1785
+ if type(max_output_tokens) is not int or max_output_tokens <= 0:
1786
+ raise ValueError("max_output_tokens must be positive")
1787
+ if temperature is not None:
1788
+ if (
1789
+ isinstance(temperature, bool)
1790
+ or not isinstance(temperature, (int, float))
1791
+ or not math.isfinite(float(temperature))
1792
+ or float(temperature) < 0
1793
+ ):
1794
+ raise ValueError("temperature must be finite and non-negative or None")
1795
+ temperature = float(temperature)
1796
+ if not callable(prompt_builder):
1797
+ raise TypeError("prompt_builder must be callable")
1798
+ if engine_trace_sink is not None and not callable(engine_trace_sink):
1799
+ raise TypeError("engine_trace_sink must be callable")
1800
+
1801
+ ids = UuidIdFactory() if id_factory is None else id_factory
1802
+ if not isinstance(ids, IdFactory):
1803
+ raise TypeError("id_factory must implement IdFactory")
1804
+ active_memory = InsightMemoryBank(id_factory=ids) if memory is None else memory
1805
+ if type(active_memory) is not InsightMemoryBank:
1806
+ raise TypeError("memory must be an exact InsightMemoryBank")
1807
+
1808
+ engine = AgenticEvolutionEngine(
1809
+ problem=benchmark.problem,
1810
+ generator=generator,
1811
+ id_factory=ids,
1812
+ memory=active_memory,
1813
+ seed=seed,
1814
+ initial_proposal_sequence=initial_proposal_sequence,
1815
+ evaluator_concurrency=evaluator_concurrency,
1816
+ trace_sink=engine_trace_sink,
1817
+ reward_policy=benchmark.reward.score,
1818
+ reward_definition_hash=benchmark.reward.definition_hash,
1819
+ failure_score=benchmark.reward.failure_score,
1820
+ prompt_builder=prompt_builder,
1821
+ prompt_shape_commitment_policy=prompt_shape_commitment_policy,
1822
+ reflection_row_projection=reflection_row_projection,
1823
+ reflection_workflow=reflection_workflow,
1824
+ max_output_tokens=max_output_tokens,
1825
+ structured_output_budget_policy=structured_output_budget_policy,
1826
+ temperature=temperature,
1827
+ phenotype_identity_policy=benchmark.phenotype_identity,
1828
+ detailed_evaluator=benchmark.detailed_evaluator,
1829
+ outcome_relation_binding=benchmark.outcome_relation,
1830
+ optimization_semantics=benchmark.optimization_semantics,
1831
+ objective_resolution=benchmark.objective_resolution,
1832
+ treatment_compliance_policy=treatment_compliance_policy,
1833
+ )
1834
+ # Recheck after constructing provider-facing collaborators. This mirrors
1835
+ # the optimizer composition's frozen benchmark drift protection.
1836
+ benchmark.validate_binding()
1837
+ portfolio = PortfolioEvolution(
1838
+ engine=engine,
1839
+ selector=selector,
1840
+ ids=ids,
1841
+ memory=active_memory,
1842
+ provider_traffic_witness=provider_traffic_witness,
1843
+ )
1844
+ return PortfolioEvolutionComposition(
1845
+ benchmark=benchmark,
1846
+ id_factory=ids,
1847
+ memory=active_memory,
1848
+ engine=engine,
1849
+ portfolio=portfolio,
1850
+ )
1851
+
1852
+
1853
+ def compose_agentic_optimizer(
1854
+ benchmark: AgenticBenchmark,
1855
+ *,
1856
+ generator: AgenticGenerator,
1857
+ planner: GenerationPlanner | None = None,
1858
+ planner_factory: GenerationPlannerFactory | None = None,
1859
+ budget: OptimizerBudget,
1860
+ seed: int,
1861
+ id_factory: IdFactory | None = None,
1862
+ memory: InsightMemoryBank | None = None,
1863
+ initial_proposal_sequence: int = 0,
1864
+ evaluator_concurrency: int = 4,
1865
+ engine_trace_sink: TraceSink | None = None,
1866
+ optimizer_trace_sink: TraceSink | None = None,
1867
+ prompt_builder: PromptBuilder = default_evidence_prompt,
1868
+ prompt_shape_commitment_policy: PromptShapeCommitmentPolicy | None = None,
1869
+ reflection_row_projection: ReflectionRowProjectionBinding | None = None,
1870
+ reflection_workflow: ReflectionWorkflow | None = None,
1871
+ max_output_tokens: int = 2_048,
1872
+ structured_output_budget_policy: StructuredOutputBudgetPolicy | None = None,
1873
+ temperature: float | None = 0.2,
1874
+ evidence_admission_policy: EvidenceAdmissionPolicy = (
1875
+ EvidenceAdmissionPolicy.REQUIRE_COMPLIANT
1876
+ ),
1877
+ seed_admission_policy: SeedAdmissionPolicy | None = None,
1878
+ feedback_interceptor: GenerationFeedbackInterceptor | None = None,
1879
+ feedback_interceptor_factory: GenerationFeedbackInterceptorFactory | None = None,
1880
+ treatment_compliance_policy: TreatmentCompliancePolicy | None = None,
1881
+ ) -> AgenticOptimizerComposition:
1882
+ """Compose one benchmark without leaking domain policy into the core.
1883
+
1884
+ The optimizer receives a narrow planner guard. It verifies that every
1885
+ wave uses the benchmark reward identity and that every finite-selection
1886
+ contract is a deterministic snapshot of the benchmark-owned catalog.
1887
+ """
1888
+
1889
+ if type(benchmark) is not AgenticBenchmark:
1890
+ raise TypeError("benchmark must be an exact AgenticBenchmark")
1891
+ benchmark.validate_binding()
1892
+ if not isinstance(generator, AgenticGenerator):
1893
+ raise TypeError("generator must implement AgenticGenerator")
1894
+ if (planner is None) == (planner_factory is None):
1895
+ raise ValueError("supply exactly one of planner or planner_factory")
1896
+ if planner is not None and not callable(getattr(planner, "plan", None)):
1897
+ raise TypeError("planner must implement plan(state, budget)")
1898
+ if planner_factory is not None and not isinstance(
1899
+ planner_factory,
1900
+ GenerationPlannerFactory,
1901
+ ):
1902
+ raise TypeError("planner_factory must implement build")
1903
+ if feedback_interceptor is not None and feedback_interceptor_factory is not None:
1904
+ raise ValueError(
1905
+ "supply at most one of feedback_interceptor or feedback_interceptor_factory"
1906
+ )
1907
+ if feedback_interceptor is not None and not isinstance(
1908
+ feedback_interceptor,
1909
+ GenerationFeedbackInterceptor,
1910
+ ):
1911
+ raise TypeError(
1912
+ "feedback_interceptor must implement reserve and after_generation"
1913
+ )
1914
+ if feedback_interceptor_factory is not None and not isinstance(
1915
+ feedback_interceptor_factory,
1916
+ GenerationFeedbackInterceptorFactory,
1917
+ ):
1918
+ raise TypeError("feedback_interceptor_factory must implement build")
1919
+ if type(budget) is not OptimizerBudget:
1920
+ raise TypeError("budget must be an exact OptimizerBudget")
1921
+ if type(seed) is not int:
1922
+ raise TypeError("seed must be an exact integer")
1923
+ if type(initial_proposal_sequence) is not int or initial_proposal_sequence < 0:
1924
+ raise ValueError("initial_proposal_sequence must be non-negative")
1925
+ if type(evaluator_concurrency) is not int or evaluator_concurrency <= 0:
1926
+ raise ValueError("evaluator_concurrency must be positive")
1927
+ if type(max_output_tokens) is not int or max_output_tokens <= 0:
1928
+ raise ValueError("max_output_tokens must be positive")
1929
+ if temperature is not None:
1930
+ if (
1931
+ isinstance(temperature, bool)
1932
+ or not isinstance(temperature, (int, float))
1933
+ or not math.isfinite(float(temperature))
1934
+ or float(temperature) < 0
1935
+ ):
1936
+ raise ValueError("temperature must be finite and non-negative or None")
1937
+ temperature = float(temperature)
1938
+ if not callable(prompt_builder):
1939
+ raise TypeError("prompt_builder must be callable")
1940
+ if engine_trace_sink is not None and not callable(engine_trace_sink):
1941
+ raise TypeError("engine_trace_sink must be callable")
1942
+ if optimizer_trace_sink is not None and not callable(optimizer_trace_sink):
1943
+ raise TypeError("optimizer_trace_sink must be callable")
1944
+ if type(evidence_admission_policy) is not EvidenceAdmissionPolicy:
1945
+ raise TypeError("evidence_admission_policy must be an EvidenceAdmissionPolicy")
1946
+
1947
+ ids = UuidIdFactory() if id_factory is None else id_factory
1948
+ if not isinstance(ids, IdFactory):
1949
+ raise TypeError("id_factory must implement IdFactory")
1950
+ active_memory = InsightMemoryBank(id_factory=ids) if memory is None else memory
1951
+ if not isinstance(active_memory, InsightMemoryBank):
1952
+ raise TypeError("memory must be an InsightMemoryBank")
1953
+
1954
+ engine = AgenticEvolutionEngine(
1955
+ problem=benchmark.problem,
1956
+ generator=generator,
1957
+ id_factory=ids,
1958
+ memory=active_memory,
1959
+ seed=seed,
1960
+ initial_proposal_sequence=initial_proposal_sequence,
1961
+ evaluator_concurrency=evaluator_concurrency,
1962
+ trace_sink=engine_trace_sink,
1963
+ reward_policy=benchmark.reward.score,
1964
+ reward_definition_hash=benchmark.reward.definition_hash,
1965
+ failure_score=benchmark.reward.failure_score,
1966
+ prompt_builder=prompt_builder,
1967
+ prompt_shape_commitment_policy=prompt_shape_commitment_policy,
1968
+ reflection_row_projection=reflection_row_projection,
1969
+ reflection_workflow=reflection_workflow,
1970
+ max_output_tokens=max_output_tokens,
1971
+ structured_output_budget_policy=structured_output_budget_policy,
1972
+ temperature=temperature,
1973
+ phenotype_identity_policy=benchmark.phenotype_identity,
1974
+ detailed_evaluator=benchmark.detailed_evaluator,
1975
+ outcome_relation_binding=benchmark.outcome_relation,
1976
+ optimization_semantics=benchmark.optimization_semantics,
1977
+ objective_resolution=benchmark.objective_resolution,
1978
+ treatment_compliance_policy=treatment_compliance_policy,
1979
+ )
1980
+ runtime_planner = planner
1981
+ if planner_factory is not None:
1982
+ runtime_planner = planner_factory.build(
1983
+ benchmark=benchmark,
1984
+ engine=engine,
1985
+ id_factory=ids,
1986
+ memory=active_memory,
1987
+ )
1988
+ if not callable(getattr(runtime_planner, "plan", None)):
1989
+ raise TypeError(
1990
+ "planner_factory must return a planner implementing plan(state, budget)"
1991
+ )
1992
+
1993
+ runtime_feedback_interceptor = feedback_interceptor
1994
+ if feedback_interceptor_factory is not None:
1995
+ runtime_feedback_interceptor = feedback_interceptor_factory.build(
1996
+ benchmark=benchmark,
1997
+ engine=engine,
1998
+ id_factory=ids,
1999
+ memory=active_memory,
2000
+ planner=runtime_planner,
2001
+ )
2002
+ if runtime_feedback_interceptor is not None and not isinstance(
2003
+ runtime_feedback_interceptor,
2004
+ GenerationFeedbackInterceptor,
2005
+ ):
2006
+ raise TypeError(
2007
+ "feedback_interceptor_factory must return an interceptor implementing "
2008
+ "reserve and after_generation"
2009
+ )
2010
+ # Factories receive collaborators that may themselves be mutable. Recheck
2011
+ # every frozen benchmark identity after construction so a defective or
2012
+ # adversarial factory cannot drift domain policy between admission and use.
2013
+ benchmark.validate_binding()
2014
+ # Pass the engine's exact binding object. In objective-only mode the engine
2015
+ # creates the default Pareto binding, so constructing another equivalent
2016
+ # value here would lose the stronger object-identity invariant.
2017
+ archive = ParetoArchive(
2018
+ benchmark.objectives,
2019
+ evidence_admission_policy=evidence_admission_policy,
2020
+ outcome_relation_binding=engine.outcome_relation_binding,
2021
+ )
2022
+ bound_planner = _BoundGenerationPlanner(benchmark, runtime_planner)
2023
+ optimizer = BudgetedAgenticOptimizer(
2024
+ engine=engine,
2025
+ archive=archive,
2026
+ planner=bound_planner,
2027
+ budget=budget,
2028
+ seed_admission_policy=seed_admission_policy,
2029
+ feedback_interceptor=runtime_feedback_interceptor,
2030
+ trace_sink=optimizer_trace_sink,
2031
+ )
2032
+ return AgenticOptimizerComposition(
2033
+ benchmark=benchmark,
2034
+ id_factory=ids,
2035
+ memory=active_memory,
2036
+ engine=engine,
2037
+ archive=archive,
2038
+ planner=runtime_planner,
2039
+ feedback_interceptor=runtime_feedback_interceptor,
2040
+ optimizer=optimizer,
2041
+ )
2042
+
2043
+
2044
+ _LAZY_WORKLOAD_FACADE_EXPORTS = {
2045
+ "AgenticCampaignEvidenceProjections": (
2046
+ "agent_evolve.campaign_workload",
2047
+ "AgenticCampaignEvidenceProjections",
2048
+ ),
2049
+ "AgenticCampaignWorkloadConfig": (
2050
+ "agent_evolve.campaign_workload",
2051
+ "AgenticCampaignWorkloadConfig",
2052
+ ),
2053
+ "WorkloadKit": ("agent_evolve.workload_kit", "WorkloadKit"),
2054
+ "campaign_seed": ("agent_evolve.workload_kit", "campaign_seed"),
2055
+ "generic_schema_evidence_projections": (
2056
+ "agent_evolve.workload_kit",
2057
+ "generic_schema_evidence_projections",
2058
+ ),
2059
+ "WorkloadPromptExtensionView": (
2060
+ "agent_evolve.workload_prompt",
2061
+ "WorkloadPromptExtensionView",
2062
+ ),
2063
+ }
2064
+
2065
+
2066
+ def __getattr__(name: str) -> object:
2067
+ """Lazily expose workload composition types on the public façade.
2068
+
2069
+ ``campaign_workload`` and ``workload_kit`` themselves depend on the core
2070
+ benchmark façade. Lazy resolution keeps that dependency one-way during
2071
+ module initialization while letting benchmark adapters import exclusively
2072
+ from ``agent_evolve.agentic``.
2073
+ """
2074
+
2075
+ target = _LAZY_WORKLOAD_FACADE_EXPORTS.get(name)
2076
+ if target is None:
2077
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
2078
+ module_name, attribute_name = target
2079
+ from importlib import import_module
2080
+
2081
+ value = getattr(import_module(module_name), attribute_name)
2082
+ globals()[name] = value
2083
+ return value
2084
+
2085
+
2086
+ __all__ = [
2087
+ "AgenticCampaignEvidenceProjections",
2088
+ "AgenticCampaignWorkloadConfig",
2089
+ "BoundedSubprocessBoundary",
2090
+ "ChildProcessPolicy",
2091
+ "ChildProcessResult",
2092
+ "EXPLICIT_ENVIRONMENT_BOUNDARY_DEFINITION_SHA256",
2093
+ "ExplicitEnvironmentSubprocessBoundary",
2094
+ "ARCHIVE_ELITE_EXPLORER_PARENT_POLICY_DEFINITION_SHA256",
2095
+ "ARCHIVE_ELITE_EXPLORER_PARENT_POLICY_ID",
2096
+ "ARCHIVE_ELITE_EXPLORER_PARENT_POLICY_VERSION",
2097
+ "ARCHIVE_ELITE_EXPLORER_PARENT_ROTATION_LAW_ID",
2098
+ "ARCHIVE_ELITE_PARENT_POLICY_DEFINITION_SHA256",
2099
+ "ARCHIVE_ELITE_PARENT_POLICY_ID",
2100
+ "ARCHIVE_ELITE_PARENT_POLICY_VERSION",
2101
+ "FINITE_VARIATION_ELIGIBILITY_POLICY_DEFINITION_SHA256",
2102
+ "FINITE_VARIATION_ELIGIBILITY_POLICY_ID",
2103
+ "FINITE_VARIATION_ELIGIBILITY_POLICY_VERSION",
2104
+ "PORTFOLIO_MATERIALIZATION_POLICY_ID",
2105
+ "PORTFOLIO_MATERIALIZATION_POLICY_VERSION",
2106
+ "ARCHIVE_RESERVOIR_PARENT_POLICY_DEFINITION_SHA256",
2107
+ "ARCHIVE_RESERVOIR_PARENT_POLICY_ID",
2108
+ "ARCHIVE_RESERVOIR_PARENT_POLICY_VERSION",
2109
+ "ACTION_EVALUATION_REUSE_POLICY_DEFINITION_SHA256",
2110
+ "ACTION_EVALUATION_REUSE_POLICY_ID",
2111
+ "ACTION_EVALUATION_REUSE_POLICY_VERSION",
2112
+ "DURABLE_PHASE_COMMIT_POLICY_DEFINITION_SHA256",
2113
+ "DURABLE_PHASE_COMMIT_POLICY_ID",
2114
+ "DURABLE_PHASE_COMMIT_POLICY_VERSION",
2115
+ "EFFECTIVE_CHOICE_AUDIT_DEFINITION_SHA256",
2116
+ "EFFECTIVE_CHOICE_AUDIT_POLICY_ID",
2117
+ "EFFECTIVE_CHOICE_AUDIT_POLICY_VERSION",
2118
+ "DEFAULT_MAX_EXACT_PARENT_CROSSOVER_LOCI",
2119
+ "ActionEvaluationReuseMode",
2120
+ "ActionEvaluationReusePolicyBinding",
2121
+ "CANONICAL_NEUTRAL_PORTFOLIO_PROMPT_PAYLOAD",
2122
+ "CANONICAL_REDACTED_PORTFOLIO_EVIDENCE_SHA256",
2123
+ "ActionAllocationFrameSubsetPolicyBinding",
2124
+ "ActionAllocationRequest",
2125
+ "ActionAllocationResult",
2126
+ "ActionAllocationArmExecution",
2127
+ "ActionAllocationSurfaceAudit",
2128
+ "ActionAxisCoordinateSemantics",
2129
+ "ActionAxisSemantics",
2130
+ "ActionEvidenceCitation",
2131
+ "ActionForecastBlockPolicy",
2132
+ "ActionForecastBlockHealthSubsetBinding",
2133
+ "ActionForecastBlockRequest",
2134
+ "ActionForecastBlockResult",
2135
+ "ActionForecastBlockSpec",
2136
+ "ActionForecastAllocationFrameKind",
2137
+ "ActionForecastDraft",
2138
+ "ActionForecastEvidenceMode",
2139
+ "ActionForecastHealthPolicyBinding",
2140
+ "ActionForecastHealthSubsetPolicyBinding",
2141
+ "ActionForecastHealthFrameKind",
2142
+ "ActionForecastPartitionLayout",
2143
+ "ActionForecastPartitionPolicyBinding",
2144
+ "ActionForecastPolicy",
2145
+ "ActionForecastRequest",
2146
+ "ActionForecastResult",
2147
+ "ActionForecastArmExecution",
2148
+ "ActionForecastArmPlan",
2149
+ "ActionForecastWaveError",
2150
+ "ConcurrentActionForecastWave",
2151
+ "DurablePhaseCommitPolicyBinding",
2152
+ "DurablePhaseCommitRequirement",
2153
+ "derive_action_space_semantics",
2154
+ "ActionMetricForecast",
2155
+ "ActionPortfolioDecision",
2156
+ "ActionSpaceSemantics",
2157
+ "AgenticBenchmark",
2158
+ "AgenticCallTelemetry",
2159
+ "AgenticEvolutionEngine",
2160
+ "AgenticGenerator",
2161
+ "AgenticOptimizerComposition",
2162
+ "WorkloadKit",
2163
+ "WorkloadPromptExtensionView",
2164
+ "campaign_seed",
2165
+ "generic_schema_evidence_projections",
2166
+ "ArchiveEliteExplorerParentSelection",
2167
+ "ArchiveEliteExplorerParentSelectionReceipt",
2168
+ "ArchiveEliteExplorerParentSelector",
2169
+ "ArchiveEliteParentSelection",
2170
+ "ArchiveEliteParentSelectionReceipt",
2171
+ "ArchiveEliteParentSelector",
2172
+ "ArchiveReservoirCrowdingKind",
2173
+ "ArchiveReservoirParentSelection",
2174
+ "ArchiveReservoirParentSelectionReceipt",
2175
+ "ArchiveReservoirParentSelector",
2176
+ "ArchiveReservoirRankedCandidate",
2177
+ "AgenticTelemetryPolicy",
2178
+ "AdaptiveShuffledMateCrossoverPolicy",
2179
+ "GenerationPlannerFactory",
2180
+ "GenerationFeedbackInterceptorFactory",
2181
+ "G3CrossoverPlanPolicy",
2182
+ "AllocatedActionMember",
2183
+ "AllocationCandidateScoreDiagnostic",
2184
+ "AllocationCandidateScoreDiagnosticInput",
2185
+ "AllocationScoreDiagnostic",
2186
+ "AllocationScoreDiagnosticBinding",
2187
+ "AllocationSurfaceGatePolicyBinding",
2188
+ "AllocationSurfaceGateRejected",
2189
+ "AllocationSurfaceStepAudit",
2190
+ "ArrayIndex",
2191
+ "ArtifactRef",
2192
+ "AuditedFrameActionAllocationResult",
2193
+ "AuditedGreedyForecastFrameAllocator",
2194
+ "DeterministicIdFactory",
2195
+ "BudgetedAgenticOptimizer",
2196
+ "CandidateId",
2197
+ "CandidateDraft",
2198
+ "EliteExplorerFallbackReason",
2199
+ "EliteExplorerLaneId",
2200
+ "EliteExplorerLaneReceipt",
2201
+ "EliteExplorerLaneSource",
2202
+ "CompiledHypothesisTreatment",
2203
+ "CardScoreComponent",
2204
+ "CardTransferAdjudicationRequest",
2205
+ "CardTransferAdjudicator",
2206
+ "CardTransferScoreReceipt",
2207
+ "ContrastShardedReflectionWorkflow",
2208
+ "DetailedEvaluation",
2209
+ "DetailedEvaluationAdapter",
2210
+ "DetailedEvaluationPayload",
2211
+ "DeterministicActionAllocator",
2212
+ "EngineFiniteActionPolicy",
2213
+ "EngineFiniteActionRequest",
2214
+ "EvaluationCheck",
2215
+ "EvaluationCheckStatus",
2216
+ "EvaluationTimings",
2217
+ "EvaluatorIdentity",
2218
+ "EffectiveChoiceAuditError",
2219
+ "EffectiveChoiceAuditReceipt",
2220
+ "EligibleFiniteVariationView",
2221
+ "ExactParentCrossoverContract",
2222
+ "ExactParentCrossoverLocus",
2223
+ "ExactParentCrossoverMaterialization",
2224
+ "ExactParentCrossoverReceipt",
2225
+ "ExactParentImportPlan",
2226
+ "ExactParentLocusAttribution",
2227
+ "ExactParentSource",
2228
+ "EXACT_OBJECTIVE_RESOLUTION_DEFINITION_SHA256",
2229
+ "EXACT_OBJECTIVE_RESOLUTION_POLICY_ID",
2230
+ "EXACT_OBJECTIVE_RESOLUTION_POLICY_VERSION",
2231
+ "ExactObjectiveResolution",
2232
+ "ExecutableHypothesisTestSpec",
2233
+ "EvidenceAdmissionPolicy",
2234
+ "ExclusiveResourceLease",
2235
+ "EvolutionCandidate",
2236
+ "ExactActionMetricProjection",
2237
+ "ExactActionMetricProjectionBatch",
2238
+ "ExactActionArmCountConstraint",
2239
+ "FailureCategory",
2240
+ "FailureCode",
2241
+ "FailureRecord",
2242
+ "FileExclusiveResourceLease",
2243
+ "FiniteActionEvidenceBinding",
2244
+ "FiniteActionEvaluationRequest",
2245
+ "FiniteActionEvaluationResult",
2246
+ "FiniteActionEvaluator",
2247
+ "FiniteActionEvaluatorBinding",
2248
+ "FiniteActionCardAuthority",
2249
+ "FiniteActionDecision",
2250
+ "FiniteActionOptionAuthority",
2251
+ "FiniteActionPresentationAuthority",
2252
+ "FiniteActionSetAuthority",
2253
+ "FiniteActionSetCompilationRequest",
2254
+ "FiniteActionSetCompiler",
2255
+ "FiniteActionSetDraft",
2256
+ "FiniteActionSelectorKind",
2257
+ "FiniteActionSourceMode",
2258
+ "FiniteActionSupportAuthority",
2259
+ "FiniteVariationCatalog",
2260
+ "FiniteVariationContract",
2261
+ "FiniteVariationEligibilityReceipt",
2262
+ "FiniteVariationOption",
2263
+ "FiniteVariationSelectionDraft",
2264
+ "BoundedCompositionalFiniteVariationCatalog",
2265
+ "CompositionSelectionExposure",
2266
+ "SourceExposureFiniteVariationCatalog",
2267
+ "SourceUnionFiniteVariationCatalog",
2268
+ "GenericMultiscaleRestartFiniteVariationCatalog",
2269
+ "DEFAULT_RESTART_RADII",
2270
+ "DEFAULT_RESTARTS_PER_RADIUS",
2271
+ "GENERIC_MULTISCALE_RESTART_CATALOG_ID",
2272
+ "GENERIC_MULTISCALE_RESTART_CATALOG_VERSION",
2273
+ "GENERIC_MULTISCALE_RESTART_FAMILY",
2274
+ "GENERIC_MULTISCALE_RESTART_POLICY_ID",
2275
+ "GENERIC_MULTISCALE_RESTART_POLICY_VERSION",
2276
+ "GENERIC_MULTISCALE_RESTART_SOURCE_ID",
2277
+ "PRIMARY_VARIATION_SOURCE_ID",
2278
+ "VARIATION_DIVERSITY_SIGNATURE_METADATA_KEY",
2279
+ "VARIATION_OPERATOR_METADATA_KEY",
2280
+ "VARIATION_SOURCE_METADATA_KEY",
2281
+ "VARIATION_SOURCE_MINIMUM_METADATA_KEY",
2282
+ "VARIATION_SOURCE_RANK_METADATA_KEY",
2283
+ "EVALUATION_SOURCE_METADATA_KEY",
2284
+ "EVALUATION_SOURCE_MINIMUM_METADATA_KEY",
2285
+ "SOURCE_UNION_POLICY_ID",
2286
+ "SOURCE_UNION_POLICY_VERSION",
2287
+ "required_ranked_source_evaluation_option_ids",
2288
+ "required_source_evaluation_counts",
2289
+ "required_source_evaluation_option_ids",
2290
+ "finite_variation_source_by_option",
2291
+ "finite_variation_source_id",
2292
+ "finite_variation_source_ids",
2293
+ "finite_variation_source_minimum_counts",
2294
+ "finite_variation_diversity_signature",
2295
+ "finite_variation_operator_id",
2296
+ "COMPOSITION_LEFT_OPTION_METADATA_KEY",
2297
+ "COMPOSITION_REQUIRED_PROPOSALS_METADATA_KEY",
2298
+ "COMPOSITION_RIGHT_OPTION_METADATA_KEY",
2299
+ "COMPOSITION_SELECTION_EXPOSURE_METADATA_KEY",
2300
+ "COMPOSITIONAL_FINITE_CATALOG_POLICY_ID",
2301
+ "COMPOSITIONAL_FINITE_CATALOG_POLICY_VERSION",
2302
+ "COMPOSITE_OPTION_FAMILY",
2303
+ "HIERARCHICAL_COMPOSITIONAL_FINITE_CATALOG_POLICY_ID",
2304
+ "HIERARCHICAL_COMPOSITIONAL_FINITE_CATALOG_POLICY_VERSION",
2305
+ "MAX_MATCHED_FINITE_ACTIONS",
2306
+ "MODEL_FINITE_ACTION_SELECTOR_DEFINITION_SHA256",
2307
+ "MODEL_FINITE_ACTION_SELECTOR_POLICY_ID",
2308
+ "MODEL_FINITE_ACTION_SELECTOR_POLICY_VERSION",
2309
+ "MIN_MATCHED_FINITE_ACTIONS",
2310
+ "ForecastPortfolioUtility",
2311
+ "ForecastPortfolioUtilityBinding",
2312
+ "ForecastPortfolioUtilityInput",
2313
+ "ForecastQuantile",
2314
+ "FrameActionAllocationRequest",
2315
+ "FrameActionAllocationCommitInput",
2316
+ "FrameActionAllocationCommitRejected",
2317
+ "FrameActionAllocationTreatmentExecution",
2318
+ "FrameActionPortfolioDecision",
2319
+ "FixedStructuredOutputBudgetPolicy",
2320
+ "FrozenJsonObject",
2321
+ "FrozenJsonValue",
2322
+ "FrozenWaveReward",
2323
+ "GenerationPlan",
2324
+ "GenerationPlanner",
2325
+ "GenerationFeedbackContext",
2326
+ "GenerationFeedbackInterceptor",
2327
+ "GenerationFeedbackReceipt",
2328
+ "GenerationFeedbackReservation",
2329
+ "GenerationFeedbackResult",
2330
+ "GREEDY_RISK_DIVERSITY_ALLOCATOR_DEFINITION_SHA256",
2331
+ "GREEDY_RISK_DIVERSITY_ALLOCATOR_ID",
2332
+ "GREEDY_RISK_DIVERSITY_ALLOCATOR_VERSION",
2333
+ "GreedyRiskAdjustedDiversityAllocator",
2334
+ "G1ReflectionFeedbackInterceptor",
2335
+ "G1_DIAGNOSTIC_SLOT_IDS",
2336
+ "G2_SLOT_IDS",
2337
+ "G3_SLOT_IDS",
2338
+ "G3BenchmarkBoundary",
2339
+ "G3CausalScreenPlanner",
2340
+ "G3CausalScreenResultValidationReceipt",
2341
+ "G3CurationSourceScope",
2342
+ "G3ExpectedEndpoint",
2343
+ "G3ExpectedUnion",
2344
+ "G3MechanismDecision",
2345
+ "G3PostsealCurationAuthority",
2346
+ "G3PostsealCurationFactory",
2347
+ "G3PostsealCurationInterceptor",
2348
+ "G3PostsealCurationReceipt",
2349
+ "G3PostsealCurationSpec",
2350
+ "G3_POSTSEAL_CURATION_DEFINITION_SHA256",
2351
+ "HypothesisApplicabilityPort",
2352
+ "HypothesisApplicabilityStatus",
2353
+ "HypothesisCompilationReceipt",
2354
+ "HypothesisCompilationRequest",
2355
+ "G3TerminalStateValidationReceipt",
2356
+ "G3TerminalValidationError",
2357
+ "G3TerminalValidationAuthority",
2358
+ "G3_SCREEN_BUDGET",
2359
+ "FrozenDiagnosticPermutation",
2360
+ "HELD_OUT_SELECTOR_POLICY_ID",
2361
+ "HELD_OUT_SELECTOR_POLICY_VERSION",
2362
+ "HeldOutASNAssignmentCommitment",
2363
+ "HeldOutASNAssignments",
2364
+ "HeldOutASNPlanSet",
2365
+ "HeldOutASNPlannerAdapter",
2366
+ "HeldOutArm",
2367
+ "HeldOutArmAssignment",
2368
+ "HeldOutAssignmentUnavailable",
2369
+ "HeldOutAssignmentUnavailableReason",
2370
+ "HeldOutScoreMapEntry",
2371
+ "FiniteTreatmentAction",
2372
+ "IdFactory",
2373
+ "InsightEvidenceLineage",
2374
+ "InsightLifecycleChangeRequest",
2375
+ "InsightLifecycleState",
2376
+ "InsightMemoryBank",
2377
+ "InsightMemoryEntry",
2378
+ "InsightOrigin",
2379
+ "InsightRelation",
2380
+ "InsightRelationKind",
2381
+ "QuarantineTestAdmissionReceipt",
2382
+ "InsightTreatmentRequirement",
2383
+ "InsightDraft",
2384
+ "InsightId",
2385
+ "InsightRef",
2386
+ "InvocationOutcome",
2387
+ "InvocationPlan",
2388
+ "LLMCallId",
2389
+ "JsonPath",
2390
+ "MatchedFiniteActionBenchmark",
2391
+ "MatchedFiniteActionBlockFactory",
2392
+ "MatchedFiniteActionBlockPlanner",
2393
+ "MaterializedPortfolioEngine",
2394
+ "MULTI_OPTION_EVOLUTION_BUDGET",
2395
+ "MULTI_OPTION_G1_SLOT_IDS",
2396
+ "MULTI_OPTION_G2_SLOT_IDS",
2397
+ "MULTI_OPTION_G3_CORE_SLOT_IDS",
2398
+ "MULTI_OPTION_G3_CROSSOVER_SLOT_IDS",
2399
+ "MULTI_OPTION_G3_SLOT_IDS",
2400
+ "MULTI_OPTION_G3_UNION_SOURCES",
2401
+ "MultiOptionEvolutionBenchmark",
2402
+ "MultiOptionEvolutionPlanner",
2403
+ "MultiOptionEvolutionPlannerFactory",
2404
+ "OrderedTwoSeedRolePolicy",
2405
+ "ParentBoundFiniteChoice",
2406
+ "SeedRolePolicy",
2407
+ "SeedRoleSelection",
2408
+ "MutationContract",
2409
+ "MutationResponseMode",
2410
+ "CrossoverResponseMode",
2411
+ "MAX_EXACT_PARENT_CROSSOVER_LOCI",
2412
+ "MIN_EXACT_PARENT_CROSSOVER_LOCI",
2413
+ "MetricRole",
2414
+ "MetricSemantics",
2415
+ "MetricSense",
2416
+ "MetricEffectDirection",
2417
+ "MetricEffectPrediction",
2418
+ "MetricComparisonAnchor",
2419
+ "MetricComparisonAnchorKind",
2420
+ "MetricForecastScale",
2421
+ "ObjectiveParetoOutcomePolicy",
2422
+ "ObjectiveResolutionPort",
2423
+ "ObjectiveResolutionReceipt",
2424
+ "ObjectiveResolutionRequest",
2425
+ "ObjectiveResolutionResult",
2426
+ "ObjectiveSpec",
2427
+ "OptimizationSemantics",
2428
+ "ObjectKey",
2429
+ "OperatorKind",
2430
+ "OperatorInvocationId",
2431
+ "OptionPhenotypeBinding",
2432
+ "OptimizerBudget",
2433
+ "OptimizerBudgetExceeded",
2434
+ "OptimizerContractError",
2435
+ "OptimizerExecutionError",
2436
+ "OptimizerPlanningError",
2437
+ "OptimizerResult",
2438
+ "OptimizerSlot",
2439
+ "OptimizerState",
2440
+ "OutcomeComparator",
2441
+ "OutcomeRelation",
2442
+ "OutcomeRelationPolicyBinding",
2443
+ "OutcomeOrderingKind",
2444
+ "OutcomeOrderingSemantics",
2445
+ "ParetoArchive",
2446
+ "ParentMetricValue",
2447
+ "ParentBoundActionChoice",
2448
+ "POST_EVOLUTION_REFLECTION_DEFINITION_SHA256",
2449
+ "PlannedReflectionBatchCall",
2450
+ "PhenotypeIdentity",
2451
+ "PhenotypeIdentityPolicy",
2452
+ "Problem",
2453
+ "ProblemContractError",
2454
+ "PortfolioCard",
2455
+ "PortfolioCardPromptPayload",
2456
+ "PortfolioCardSourceBinding",
2457
+ "PortfolioCardSourceRegistry",
2458
+ "PortfolioCardViewReceipt",
2459
+ "PortfolioCardViewTransform",
2460
+ "PortfolioCandidateFailureEvidence",
2461
+ "PortfolioExperimentalArm",
2462
+ "PortfolioExperimentalViewReceipt",
2463
+ "PortfolioEvolution",
2464
+ "PortfolioEvolutionComposition",
2465
+ "PortfolioMemberDraft",
2466
+ "PortfolioMemberMaterializationReceipt",
2467
+ "PortfolioMemberDisposition",
2468
+ "PortfolioMemoryCreditBatchPreparation",
2469
+ "PortfolioMemoryCreditBatchReceipt",
2470
+ "PortfolioMemoryCreditPlan",
2471
+ "PortfolioMemoryCreditReceipt",
2472
+ "PortfolioMemoryContextProjectionBinding",
2473
+ "PortfolioMemoryMatchedControlWavePlan",
2474
+ "PortfolioPendingMemoryCredit",
2475
+ "EXACT_MEMORY_CONTEXT_PROJECTION_DEFINITION_SHA256",
2476
+ "PortfolioPairAttemptReceipt",
2477
+ "ArchiveAwareDisjointPairSelectionDecision",
2478
+ "ArchiveAwareDisjointParentPairPolicy",
2479
+ "FrozenArchiveBranchUtility",
2480
+ "FrozenArchiveSourcePairUtility",
2481
+ "FrozenArchiveSourceUtilityContext",
2482
+ "FrozenArchiveSourceUtilityReceipt",
2483
+ "ObservedSourceBranch",
2484
+ "PortfolioRecombination",
2485
+ "PortfolioRecombinationBranchBinding",
2486
+ "PortfolioRecombinationMemberReceipt",
2487
+ "PortfolioRecombinationNoPairReason",
2488
+ "PortfolioRecombinationNoPairReceipt",
2489
+ "PortfolioRecombinationSourceExclusionReason",
2490
+ "PortfolioRecombinationSourceExclusionReceipt",
2491
+ "PortfolioRecombinationWaveReceipt",
2492
+ "PortfolioRecombinationWaveRequest",
2493
+ "PortfolioRecombinationWaveResult",
2494
+ "bind_portfolio_recombination_source_utilities",
2495
+ "frozen_archive_source_utility_context",
2496
+ "portfolio_recombination_observed_sources",
2497
+ "PortfolioRewardAggregationBinding",
2498
+ "PortfolioSelectionPolicy",
2499
+ "PortfolioSelectionRequest",
2500
+ "PortfolioSelectionResult",
2501
+ "PortfolioVariationMemberReceipt",
2502
+ "PortfolioVariationWaveReceipt",
2503
+ "PortfolioVariationWaveRequest",
2504
+ "PortfolioVariationWaveResult",
2505
+ "PortfolioAllocationScore",
2506
+ "PostEvolutionPredecessorResolver",
2507
+ "PostEvolutionReflectionAuthority",
2508
+ "PostEvolutionReflectionFactory",
2509
+ "PostEvolutionReflectionInterceptor",
2510
+ "PostEvolutionReflectionReceipt",
2511
+ "PostEvolutionReflectionSource",
2512
+ "PostEvolutionReflectionSourceScope",
2513
+ "PostEvolutionReflectionSpec",
2514
+ "PreparedTwoStageActionEvolution",
2515
+ "PreparedHypothesisMatrix",
2516
+ "ReflectionCallExecutionError",
2517
+ "ReflectionCallReceipt",
2518
+ "ReflectionCallRequest",
2519
+ "ReflectionCallStatus",
2520
+ "ReflectionEvidenceCatalog",
2521
+ "ReflectionEvidenceCatalogEntry",
2522
+ "ReflectionPublication",
2523
+ "ReflectionPublicationResult",
2524
+ "PreparedTwoStageActionEvolutionRequest",
2525
+ "PreparedTwoStageActionEvolutionResult",
2526
+ "ProspectiveUniformRankToken",
2527
+ "REWARD_DEFINITION_HASH",
2528
+ "ReflectionGenerationRequest",
2529
+ "ReflectionGenerationResult",
2530
+ "ReflectionInsightContract",
2531
+ "ReflectionInsightKind",
2532
+ "ReflectionConsumerScope",
2533
+ "ReflectionRowProjectionBinding",
2534
+ "ReflectionPromptShard",
2535
+ "ReflectionWorkflow",
2536
+ "ReflectionWorkflowExecutionError",
2537
+ "ReflectionWorkflowRequest",
2538
+ "ReflectionWorkflowResult",
2539
+ "RankedPortfolioDecision",
2540
+ "RankedPortfolioMember",
2541
+ "REFLECTIVE_FEEDBACK_POLICY_ID",
2542
+ "REFLECTIVE_FEEDBACK_POLICY_VERSION",
2543
+ "ReflectedCard",
2544
+ "ReflectedCardBatch",
2545
+ "ReflectedCardMailbox",
2546
+ "ReflectiveFeedbackContractError",
2547
+ "ResourceConflictDetected",
2548
+ "ResourceConflictObservation",
2549
+ "ResourceConflictProbe",
2550
+ "ResourceLeaseReceipt",
2551
+ "ResourceLeaseUnavailable",
2552
+ "ResolvedActionEvidenceCitation",
2553
+ "ResolvedActionForecast",
2554
+ "ResolvedActionForecastBatch",
2555
+ "ResolvedActionForecastBlock",
2556
+ "ResolvedActionForecastHealthAssessment",
2557
+ "ResolvedActionForecastAllocationFrame",
2558
+ "ResolvedActionMetricForecast",
2559
+ "RewardPolicyBinding",
2560
+ "SelectedCardBindingMode",
2561
+ "SemanticProjectionPhenotypeIdentityPolicy",
2562
+ "StructuredOutputBudgetPolicy",
2563
+ "StructuredOutputRequestKind",
2564
+ "StrictBatchedReflectionWorkflow",
2565
+ "SCIENTIFIC_ARM_ORDER",
2566
+ "StrictTreatmentCompliancePolicy",
2567
+ "TREATMENT_COMPLIANCE_DEFINITION_SHA256",
2568
+ "TREATMENT_COMPLIANCE_POLICY_ID",
2569
+ "TREATMENT_COMPLIANCE_POLICY_VERSION",
2570
+ "TelemetryGatedAgenticGenerator",
2571
+ "TaskKeyedUniformFiniteActionPolicy",
2572
+ "TaskKeyedArchiveEliteExplorerParentPolicy",
2573
+ "TaskKeyedArchiveEliteParentPolicy",
2574
+ "TaskKeyedArchiveReservoirParentPolicy",
2575
+ "TreatmentAdmissionReceipt",
2576
+ "TreatmentAdmissionRequest",
2577
+ "TreatmentActionBinding",
2578
+ "TreatmentAssignmentRole",
2579
+ "TreatmentClaimMode",
2580
+ "TreatmentCompliancePolicy",
2581
+ "TreatmentComplianceRejected",
2582
+ "TreatmentComplianceViolation",
2583
+ "TreatmentInsightEvidence",
2584
+ "TreatmentInsightBinding",
2585
+ "TreatmentPreflightReceipt",
2586
+ "TreatmentPreflightRequest",
2587
+ "TwoStageActionPhase",
2588
+ "TwoStageActionPhaseCommit",
2589
+ "TwoStageActionPhaseCommitError",
2590
+ "TwoStageActionPhaseCommitSink",
2591
+ "TwoStageActionPhaseReceipt",
2592
+ "validate_treatment_admission_receipt",
2593
+ "validate_treatment_preflight_receipt",
2594
+ "validate_effective_choice_audit_receipt",
2595
+ "TypedConfigurationPhenotypeIdentityPolicy",
2596
+ "UNIFORM_FINITE_ACTION_POLICY_DEFINITION_SHA256",
2597
+ "UNIFORM_FINITE_ACTION_POLICY_ID",
2598
+ "UNIFORM_FINITE_ACTION_POLICY_VERSION",
2599
+ "UuidIdFactory",
2600
+ "ValidationOutcome",
2601
+ "VariationGenerationRequest",
2602
+ "VariationGenerationResult",
2603
+ "artifact_ref_for_bytes",
2604
+ "audit_effective_choice_plan",
2605
+ "allocation_score_multiset_sha256",
2606
+ "allocation_surface_failure_codes",
2607
+ "admit_portfolio_card_sources",
2608
+ "bind_portfolio_experimental_view",
2609
+ "bind_finite_action_evidence",
2610
+ "bind_finite_variation_catalog",
2611
+ "bind_action_forecast_block_allocation_frame",
2612
+ "bind_action_forecast_block_subset_allocation_frame",
2613
+ "bind_complete_action_forecast_allocation_frame",
2614
+ "build_exact_parent_import_plan",
2615
+ "assess_resolved_action_forecast_health",
2616
+ "assess_resolved_action_forecast_block_health",
2617
+ "assess_resolved_action_forecast_block_subset_health",
2618
+ "build_action_forecast_block_requests",
2619
+ "build_action_forecast_partition_layout",
2620
+ "build_frame_action_allocation_phase_commit",
2621
+ "build_reflected_card_batch",
2622
+ "build_g3_postseal_curation_reservation",
2623
+ "compile_and_seal_finite_action_set",
2624
+ "compile_registered_hypothesis_treatment",
2625
+ "compose_agentic_optimizer",
2626
+ "compose_portfolio_evolution",
2627
+ "canonical_candidate_path_text",
2628
+ "default_parent_relative_reward",
2629
+ "default_evidence_prompt",
2630
+ "derive_portfolio_card_view",
2631
+ "derive_exact_parent_crossover_contract",
2632
+ "eligible_finite_variation_view",
2633
+ "exact_configuration_phenotype_bindings",
2634
+ "exact_parent_import_exclusions_sha256",
2635
+ "freeze_json",
2636
+ "frame_source_call_and_request_identity",
2637
+ "generation_feedback_receipt_hash",
2638
+ "objective_pareto_outcome_binding",
2639
+ "objective_resolution_policy_metadata",
2640
+ "portfolio_card_snapshot_sha256",
2641
+ "portfolio_card_score_state_sha256",
2642
+ "portfolio_card_from_insight_entry",
2643
+ "project_action_neutral_insight_prompt_payload",
2644
+ "portfolio_selection_telemetry_sha256",
2645
+ "optional_phase_commit_policy",
2646
+ "per_arm_evaluation_reuse_policy",
2647
+ "required_scientific_phase_commit_policy",
2648
+ "reflection_contrast_id",
2649
+ "register_neutral_sham_card",
2650
+ "render_optimization_semantics",
2651
+ "resolve_structured_output_budget",
2652
+ "resolve_objectives",
2653
+ "render_action_space_semantics",
2654
+ "resolve_action_forecast_block",
2655
+ "resolve_action_forecasts",
2656
+ "resolve_finite_variation_selection",
2657
+ "resolve_ranked_portfolio_decision",
2658
+ "seal_generation_feedback",
2659
+ "thaw_json",
2660
+ "typed_json_sha256",
2661
+ "validate_generation_feedback_receipt",
2662
+ "validate_g3_causal_screen_result",
2663
+ "validate_g3_terminal_state",
2664
+ "validate_action_portfolio_decision",
2665
+ "validate_frame_action_portfolio_decision",
2666
+ "validate_frame_action_allocation_phase_commit",
2667
+ "validate_finite_action_set_compiler_identity",
2668
+ "validate_hypothesis_compilation",
2669
+ "validate_hypothesis_compiler_identity",
2670
+ "validate_treatment_occurrence_frame_request",
2671
+ "validate_card_transfer_score_receipt",
2672
+ "validate_portfolio_experimental_view",
2673
+ "validate_reflection_insight_draft",
2674
+ "validate_reflection_evidence_catalog_result",
2675
+ "validate_archive_elite_explorer_parent_selection",
2676
+ "validate_archive_elite_parent_selection",
2677
+ "validate_archive_reservoir_parent_selection",
2678
+ "validate_ranked_portfolio_decision",
2679
+ "validate_resolved_action_forecasts",
2680
+ "lenient_action_forecast_health_policy",
2681
+ "materialized_disjoint_invocation",
2682
+ "materialize_exact_parent_crossover",
2683
+ "materialized_finite_action_decision",
2684
+ "finite_action_mutation_boundary",
2685
+ "model_finite_action_telemetry_sha256",
2686
+ "seal_model_finite_action_decision",
2687
+ "replay_exact_parent_crossover",
2688
+ "resolve_exact_parent_import_for_target",
2689
+ "validate_finite_action_decision",
2690
+ "validate_exact_parent_import_exclusions",
2691
+ "BOUNDED_PORTFOLIO_MEMORY_DOSE_POLICY_DEFINITION_SHA256",
2692
+ "BOUNDED_PORTFOLIO_MEMORY_DOSE_POLICY_ID",
2693
+ "BOUNDED_PORTFOLIO_MEMORY_DOSE_POLICY_VERSION",
2694
+ "BoundedPortfolioMemoryDoseContract",
2695
+ "IDENTIFIABLE_REFLECTION_EVIDENCE_POLICY_DEFINITION_SHA256",
2696
+ "IDENTIFIABLE_REFLECTION_EVIDENCE_POLICY_ID",
2697
+ "IDENTIFIABLE_REFLECTION_EVIDENCE_POLICY_VERSION",
2698
+ "IdentifiableMutationReflectionContrast",
2699
+ "IdentifiableReflectionEvidenceSnapshot",
2700
+ "MAX_REFLECTION_LOCAL_INTERVENTION_VALUE_BYTES",
2701
+ "EXACT_PARENT_PORTFOLIO_MEMORY_DOSE_SUPPORT_POLICY_DEFINITION_SHA256",
2702
+ "EXACT_PARENT_PORTFOLIO_MEMORY_DOSE_SUPPORT_POLICY_ID",
2703
+ "EXACT_PARENT_PORTFOLIO_MEMORY_DOSE_SUPPORT_POLICY_VERSION",
2704
+ "PORTFOLIO_MEMORY_CONTEXT_TRANSFER_POLICY_DEFINITION_SHA256",
2705
+ "PORTFOLIO_MEMORY_CONTEXT_TRANSFER_POLICY_ID",
2706
+ "PORTFOLIO_MEMORY_CONTEXT_TRANSFER_POLICY_VERSION",
2707
+ "PORTFOLIO_MEMORY_DOSE_SUPPORT_POLICY_DEFINITION_SHA256",
2708
+ "PORTFOLIO_MEMORY_DOSE_SUPPORT_POLICY_ID",
2709
+ "PORTFOLIO_MEMORY_DOSE_SUPPORT_POLICY_VERSION",
2710
+ "PORTFOLIO_MEMORY_TRANSFER_LADDER_POLICY_DEFINITION_SHA256",
2711
+ "PORTFOLIO_MEMORY_TRANSFER_LADDER_POLICY_ID",
2712
+ "PORTFOLIO_MEMORY_TRANSFER_LADDER_POLICY_VERSION",
2713
+ "PORTFOLIO_MEMORY_TRANSFER_LANE_RESOLVER_DEFINITION_SHA256",
2714
+ "PORTFOLIO_MEMORY_TRANSFER_LANE_RESOLVER_ID",
2715
+ "PORTFOLIO_MEMORY_TRANSFER_LANE_RESOLVER_VERSION",
2716
+ "CONTEXTUAL_SEARCH_CONTROLLER_DEFINITION_SHA256",
2717
+ "CONTEXTUAL_SEARCH_CONTROLLER_ID",
2718
+ "CONTEXTUAL_SEARCH_CONTROLLER_VERSION",
2719
+ "PORTFOLIO_OPTIMIZATION_MEMORY_POLICY_DEFINITION_SHA256",
2720
+ "PORTFOLIO_OPTIMIZATION_MEMORY_POLICY_ID",
2721
+ "PORTFOLIO_OPTIMIZATION_MEMORY_POLICY_VERSION",
2722
+ "PortfolioMemoryDoseAssessment",
2723
+ "CAMPAIGN_SELECTOR_CONTEXT_EXTENSION_KEY",
2724
+ "CAMPAIGN_SELECTOR_CONTEXT_EXTENSION_MAX_BYTES",
2725
+ "CampaignSelectorContextExtension",
2726
+ "attach_campaign_selector_context_extension",
2727
+ "resolve_campaign_selector_context_extension",
2728
+ "PortfolioMemoryContextTransferAssessment",
2729
+ "PortfolioMemoryDoseCardSemantics",
2730
+ "PortfolioMemoryDoseSupportScope",
2731
+ "PortfolioMemoryTransferLadderAssessment",
2732
+ "PortfolioMemoryTransferTier",
2733
+ "PortfolioMemoryTransferCard",
2734
+ "PortfolioMemoryTransferLane",
2735
+ "PortfolioMemoryTransferLaneResolution",
2736
+ "PortfolioMemoryTransferLaneResolver",
2737
+ "ContextualArmAllocation",
2738
+ "ContextualArmPosterior",
2739
+ "CampaignContextualJointCapabilityProjector",
2740
+ "CampaignContextualPlanningContext",
2741
+ "CampaignContextualSearchPlan",
2742
+ "CampaignContextualSearchPlanner",
2743
+ "FiniteContractContextualJointCapabilityProjector",
2744
+ "CampaignPortfolioFrontierTarget",
2745
+ "CampaignPortfolioFrontierTargetAllocator",
2746
+ "ContextualPortfolioAllocationSlice",
2747
+ "ContextualSearchCompletionAudit",
2748
+ "ContextualSearchDecision",
2749
+ "ContextualSearchDelayedCredit",
2750
+ "ContextualSearchLedger",
2751
+ "ContextualSearchObservation",
2752
+ "ContextualSearchQuery",
2753
+ "ContextualSearchSnapshot",
2754
+ "ContextualSearchStageAllocation",
2755
+ "PhaseAwareContextualSearchController",
2756
+ "SearchArmKind",
2757
+ "SearchPhase",
2758
+ "audit_completed_contextual_search_ledger",
2759
+ "slice_contextual_search_decision",
2760
+ "CONTEXTUAL_PORTFOLIO_OUTCOME_DEFINITION_SHA256",
2761
+ "CONTEXTUAL_PORTFOLIO_OUTCOME_POLICY_ID",
2762
+ "CONTEXTUAL_PORTFOLIO_OUTCOME_POLICY_VERSION",
2763
+ "ContextualPortfolioOutcomeBatch",
2764
+ "observe_contextual_portfolio_outcomes",
2765
+ "CONTEXTUAL_DELAYED_CREDIT_DEFINITION_SHA256",
2766
+ "CONTEXTUAL_DELAYED_CREDIT_POLICY_ID",
2767
+ "CONTEXTUAL_DELAYED_CREDIT_POLICY_VERSION",
2768
+ "ContextualPostRecombinationCreditBatch",
2769
+ "ContextualTerminalPersistenceCreditBatch",
2770
+ "observe_contextual_post_recombination_credit",
2771
+ "observe_contextual_terminal_persistence",
2772
+ "ContextualPortfolioAllocationContract",
2773
+ "ContextualPortfolioAllocationRealization",
2774
+ "ContextualArmCountCapability",
2775
+ "ContextualArmCountCapabilityWitness",
2776
+ "ContextualJointCountVector",
2777
+ "ContextualLaneJointCountCapability",
2778
+ "PortfolioMemoryDoseCardSupport",
2779
+ "PortfolioMemoryDoseMember",
2780
+ "PortfolioMemoryDoseRejected",
2781
+ "PortfolioMemoryDoseStage",
2782
+ "PortfolioMemoryDoseViolation",
2783
+ "PortfolioOptimizationMemoryAssessment",
2784
+ "PortfolioOptimizationMemoryDirective",
2785
+ "PortfolioOptimizationMemoryDisposition",
2786
+ "PortfolioOptimizationMetricSign",
2787
+ "PortfolioMemoryExposureScope",
2788
+ "ReflectionEvidenceExclusionReason",
2789
+ "ReflectionFalsificationFeedback",
2790
+ "SealedCutoffDelayedAdmissionCadence",
2791
+ "assess_evaluated_portfolio_memory_dose",
2792
+ "assess_portfolio_memory_context_transfer",
2793
+ "assess_portfolio_memory_transfer_ladder",
2794
+ "assess_portfolio_optimization_memory",
2795
+ "assess_proposed_portfolio_memory_dose",
2796
+ "derive_portfolio_memory_dose_card_support",
2797
+ "derive_portfolio_memory_advisory_card_support",
2798
+ "project_identifiable_reflection_evidence",
2799
+ "require_passing_portfolio_memory_dose",
2800
+ ]