cmpnd 0.111.0__tar.gz → 0.111.1__tar.gz

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 (521) hide show
  1. {cmpnd-0.111.0 → cmpnd-0.111.1}/PKG-INFO +6 -3
  2. {cmpnd-0.111.0 → cmpnd-0.111.1}/README.md +5 -2
  3. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/optimizers/tracker.py +19 -8
  4. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/exporter_http.py +65 -48
  5. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/sender.py +23 -6
  6. {cmpnd-0.111.0 → cmpnd-0.111.1}/docs/ingest-transport.md +7 -3
  7. {cmpnd-0.111.0 → cmpnd-0.111.1}/docs/sdk-instrumentation.md +1 -1
  8. {cmpnd-0.111.0 → cmpnd-0.111.1}/pyproject.toml +1 -1
  9. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_exporter_queue.py +53 -2
  10. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_ingest_second_producer.py +4 -4
  11. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_optimize_terminal_failure.py +17 -0
  12. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_queue_budget.py +59 -1
  13. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_reversible_failures.py +1 -1
  14. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_sender_scenarios.py +35 -2
  15. {cmpnd-0.111.0 → cmpnd-0.111.1}/uv.lock +1 -1
  16. {cmpnd-0.111.0 → cmpnd-0.111.1}/.gitignore +0 -0
  17. {cmpnd-0.111.0 → cmpnd-0.111.1}/AGENTS.md +0 -0
  18. {cmpnd-0.111.0 → cmpnd-0.111.1}/CLAUDE.md +0 -0
  19. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/LINEAGE.md +0 -0
  20. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/__init__.py +0 -0
  21. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_account.py +0 -0
  22. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_assessments.py +0 -0
  23. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_authored_import.py +0 -0
  24. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_deployments.py +0 -0
  25. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_exporter_pool.py +0 -0
  26. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_gepa_patch.py +0 -0
  27. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_http.py +0 -0
  28. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_label_vocabulary.py +0 -0
  29. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_program_patch.py +0 -0
  30. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_provider_types.py +0 -0
  31. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_provider_writes.py +0 -0
  32. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_reanchor_evidence.py +0 -0
  33. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_reanchor_patch.py +0 -0
  34. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_runtime_tools.py +0 -0
  35. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_timespec.py +0 -0
  36. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_traces.py +0 -0
  37. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/_valsets.py +0 -0
  38. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/authored.py +0 -0
  39. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/callback.py +0 -0
  40. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/__init__.py +0 -0
  41. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/api_client.py +0 -0
  42. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/__init__.py +0 -0
  43. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/admin.py +0 -0
  44. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/assessments.py +0 -0
  45. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/auth.py +0 -0
  46. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/datasets.py +0 -0
  47. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/deployments.py +0 -0
  48. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/evals.py +0 -0
  49. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/feedback.py +0 -0
  50. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/kernel_lines.py +0 -0
  51. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/labels.py +0 -0
  52. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/login.py +0 -0
  53. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/optimizations.py +0 -0
  54. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/org.py +0 -0
  55. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/programs.py +0 -0
  56. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/provider_credentials.py +0 -0
  57. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/providers.py +0 -0
  58. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/skill.py +0 -0
  59. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/tool_servers.py +0 -0
  60. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/top.py +0 -0
  61. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/traces.py +0 -0
  62. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/commands/valsets.py +0 -0
  63. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/credentials.py +0 -0
  64. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/deprecation.py +0 -0
  65. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/label_args.py +0 -0
  66. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/pagination.py +0 -0
  67. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/shell.py +0 -0
  68. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/skill/__init__.py +0 -0
  69. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/skill/_vendor/drskill/LICENSE +0 -0
  70. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/skill/_vendor/drskill/VENDOR.md +0 -0
  71. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/skill/_vendor/drskill/harnesses.toml +0 -0
  72. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/skill/agents.py +0 -0
  73. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/skill/bundle.py +0 -0
  74. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/skill/install.py +0 -0
  75. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/skill/offer.py +0 -0
  76. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/trace_render.py +0 -0
  77. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/tree_help.py +0 -0
  78. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/verbs.py +0 -0
  79. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/cli/views.py +0 -0
  80. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/client.py +0 -0
  81. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/configuration.py +0 -0
  82. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/context.py +0 -0
  83. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/credentials.py +0 -0
  84. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/dataset_sync.py +0 -0
  85. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/datasets.py +0 -0
  86. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/decorators.py +0 -0
  87. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/deployment.py +0 -0
  88. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/deployment_metadata.py +0 -0
  89. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/deployment_runs.py +0 -0
  90. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/eval_handler.py +0 -0
  91. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/execution.py +0 -0
  92. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/exporter.py +0 -0
  93. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/exporter_http.py +0 -0
  94. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/field_types.py +0 -0
  95. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/helpers.py +0 -0
  96. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/identity.py +0 -0
  97. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/imaging.py +0 -0
  98. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/ir/__init__.py +0 -0
  99. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/ir/decode.py +0 -0
  100. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/ir/encode.py +0 -0
  101. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/ir/hash.py +0 -0
  102. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/ir/program.py +0 -0
  103. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/ir/reflection.py +0 -0
  104. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/ir/types.py +0 -0
  105. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/ir/xxh64.py +0 -0
  106. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/kernel_lines.py +0 -0
  107. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/labels.py +0 -0
  108. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/lm_configuration.py +0 -0
  109. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/mcp_servers.py +0 -0
  110. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/models.py +0 -0
  111. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/named_programs.py +0 -0
  112. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/optimization.py +0 -0
  113. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/optimizers/__init__.py +0 -0
  114. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/optimizers/gepa.py +0 -0
  115. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/optimizers/gepa_callback.py +0 -0
  116. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/optimizers/resume.py +0 -0
  117. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/packaging.py +0 -0
  118. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/program_naming.py +0 -0
  119. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/programs.py +0 -0
  120. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/references.py +0 -0
  121. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/retry.py +0 -0
  122. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/SKILL.md +0 -0
  123. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/examples/support_triage/data/train.jsonl +0 -0
  124. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/examples/support_triage/data/val.jsonl +0 -0
  125. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/examples/support_triage/optimize.py +0 -0
  126. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/examples/support_triage/program.py +0 -0
  127. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/examples/support_triage/task.py +0 -0
  128. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/examples/support_triage/task_gpt5mini.py +0 -0
  129. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/examples/support_triage/task_haiku.py +0 -0
  130. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/references/deploy.md +0 -0
  131. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/references/dspy.md +0 -0
  132. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/references/feedback.md +0 -0
  133. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/references/gaps.md +0 -0
  134. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/references/observe.md +0 -0
  135. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/references/optimize.md +0 -0
  136. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/references/setup.md +0 -0
  137. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/references/tools.md +0 -0
  138. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/skill_bundle/scripts/tools_block.py +0 -0
  139. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/traces.py +0 -0
  140. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd/versions.py +0 -0
  141. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/LINEAGE.md +0 -0
  142. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/__init__.py +0 -0
  143. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/bodies.py +0 -0
  144. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/client_floor.py +0 -0
  145. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/network.py +0 -0
  146. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/process_local.py +0 -0
  147. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/program_names.py +0 -0
  148. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/protocols.py +0 -0
  149. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/py.typed +0 -0
  150. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/queue_budget.py +0 -0
  151. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/rejections.py +0 -0
  152. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/request_log.py +0 -0
  153. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/retry.py +0 -0
  154. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/span_context.py +0 -0
  155. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/storable.py +0 -0
  156. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/trace_facts.py +0 -0
  157. {cmpnd-0.111.0 → cmpnd-0.111.1}/cmpnd_ingest/user_agent.py +0 -0
  158. {cmpnd-0.111.0 → cmpnd-0.111.1}/docs/2026-04-02-code-review.md +0 -0
  159. {cmpnd-0.111.0 → cmpnd-0.111.1}/docs/cli.md +0 -0
  160. {cmpnd-0.111.0 → cmpnd-0.111.1}/docs/client.md +0 -0
  161. {cmpnd-0.111.0 → cmpnd-0.111.1}/docs/custom-proposer.md +0 -0
  162. {cmpnd-0.111.0 → cmpnd-0.111.1}/docs/plans/2026-04-05-train-val-dataset-capture-design.md +0 -0
  163. {cmpnd-0.111.0 → cmpnd-0.111.1}/docs/plans/2026-04-05-train-val-dataset-capture.md +0 -0
  164. {cmpnd-0.111.0 → cmpnd-0.111.1}/docs/reading-traces.md +0 -0
  165. {cmpnd-0.111.0 → cmpnd-0.111.1}/docs/versions.md +0 -0
  166. {cmpnd-0.111.0 → cmpnd-0.111.1}/examples/generalizing_proposer.py +0 -0
  167. {cmpnd-0.111.0 → cmpnd-0.111.1}/examples/local_ollama.py +0 -0
  168. {cmpnd-0.111.0 → cmpnd-0.111.1}/scripts/audit-sdist.sh +0 -0
  169. {cmpnd-0.111.0 → cmpnd-0.111.1}/scripts/capture_review_run.py +0 -0
  170. {cmpnd-0.111.0 → cmpnd-0.111.1}/scripts/check-pip-install.sh +0 -0
  171. {cmpnd-0.111.0 → cmpnd-0.111.1}/scripts/check_release_artifacts.py +0 -0
  172. {cmpnd-0.111.0 → cmpnd-0.111.1}/scripts/export-bedrock-token.sh +0 -0
  173. {cmpnd-0.111.0 → cmpnd-0.111.1}/scripts/fixtures/review_run.json.gz +0 -0
  174. {cmpnd-0.111.0 → cmpnd-0.111.1}/scripts/fork-matrix.sh +0 -0
  175. {cmpnd-0.111.0 → cmpnd-0.111.1}/scripts/gepa_resume_bug.py +0 -0
  176. {cmpnd-0.111.0 → cmpnd-0.111.1}/scripts/install-test-env.sh +0 -0
  177. {cmpnd-0.111.0 → cmpnd-0.111.1}/scripts/release-gate.sh +0 -0
  178. {cmpnd-0.111.0 → cmpnd-0.111.1}/scripts/release-real-models.sh +0 -0
  179. {cmpnd-0.111.0 → cmpnd-0.111.1}/scripts/require_version_bump.py +0 -0
  180. {cmpnd-0.111.0 → cmpnd-0.111.1}/scripts/seed_review_run.py +0 -0
  181. {cmpnd-0.111.0 → cmpnd-0.111.1}/scripts/selfhost_compat.py +0 -0
  182. {cmpnd-0.111.0 → cmpnd-0.111.1}/scripts/test-in-linux.sh +0 -0
  183. {cmpnd-0.111.0 → cmpnd-0.111.1}/stubs/dspy/__init__.pyi +0 -0
  184. {cmpnd-0.111.0 → cmpnd-0.111.1}/stubs/dspy/primitives/__init__.pyi +0 -0
  185. {cmpnd-0.111.0 → cmpnd-0.111.1}/stubs/dspy/primitives/prediction.pyi +0 -0
  186. {cmpnd-0.111.0 → cmpnd-0.111.1}/stubs/dspy/utils/__init__.pyi +0 -0
  187. {cmpnd-0.111.0 → cmpnd-0.111.1}/stubs/dspy/utils/callback.pyi +0 -0
  188. {cmpnd-0.111.0 → cmpnd-0.111.1}/stubs/dspy/utils/dummies.pyi +0 -0
  189. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/__init__.py +0 -0
  190. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/_credential_route.py +0 -0
  191. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/_deployment_signature_helpers.py +0 -0
  192. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/_exporter_helpers.py +0 -0
  193. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/_fake_clock.py +0 -0
  194. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/_fresh_interpreter.py +0 -0
  195. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/_identity_helpers.py +0 -0
  196. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/_resolve_refs.py +0 -0
  197. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/_traced_run.py +0 -0
  198. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/conftest.py +0 -0
  199. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/dspy_features.py +0 -0
  200. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/__init__.py +0 -0
  201. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/committee_task.py +0 -0
  202. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/conftest.py +0 -0
  203. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/continuation_task.py +0 -0
  204. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/data/committee_train.ndjson.gz +0 -0
  205. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/data/committee_val.ndjson.gz +0 -0
  206. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/fake_lm.py +0 -0
  207. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/helpers.py +0 -0
  208. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/target_capabilities.py +0 -0
  209. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_assessments_cli.py +0 -0
  210. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_capture_prompts.py +0 -0
  211. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_composite_module.py +0 -0
  212. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_dataset_auto_creation.py +0 -0
  213. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_deploy_execute.py +0 -0
  214. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_deploy_pandas.py +0 -0
  215. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_deploy_programs.py +0 -0
  216. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_edge_cases.py +0 -0
  217. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_example_hash.py +0 -0
  218. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_gepa_optimization.py +0 -0
  219. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_interpreter_spans.py +0 -0
  220. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_lm_accuracy.py +0 -0
  221. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_module_tracing.py +0 -0
  222. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_optimization_lineage.py +0 -0
  223. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_optimization_metric_identity.py +0 -0
  224. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_optimize_authored_metric.py +0 -0
  225. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_optimize_continuation.py +0 -0
  226. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_optimize_custom_proposer.py +0 -0
  227. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_optimize_failures.py +0 -0
  228. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_optimize_loop.py +0 -0
  229. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_optimize_review_committee.py +0 -0
  230. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_optimize_server_owned_completion.py +0 -0
  231. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_parallel_export.py +0 -0
  232. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_program_versions.py +0 -0
  233. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_project_attribution.py +0 -0
  234. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_react_tool_spans.py +0 -0
  235. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_reanchor_optimization.py +0 -0
  236. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_save_load.py +0 -0
  237. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_trace_structure.py +0 -0
  238. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_traces_read.py +0 -0
  239. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_user_attribution.py +0 -0
  240. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/e2e/test_valsets_cli.py +0 -0
  241. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/identity_vectors/01_predict_qa.json +0 -0
  242. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/identity_vectors/02_predict_renamed_field.json +0 -0
  243. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/identity_vectors/03_chain_of_thought_qa.json +0 -0
  244. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/identity_vectors/04_predict_richer_types.json +0 -0
  245. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/identity_vectors/05_composite_two_predicts.json +0 -0
  246. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/identity_vectors/06_multichaincomparison.json +0 -0
  247. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/identity_vectors/07_program_of_thought.json +0 -0
  248. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/identity_vectors/08_opaque_module.json +0 -0
  249. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/identity_vectors/09_predict_pydantic_field.json +0 -0
  250. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/identity_vectors/10_react.json +0 -0
  251. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/identity_vectors/11_refine.json +0 -0
  252. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/identity_vectors/12_retrieve.json +0 -0
  253. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/identity_vectors/13_knn.json +0 -0
  254. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/identity_vectors/14_parallel.json +0 -0
  255. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/identity_vectors/README.md +0 -0
  256. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/ingest_conformance.py +0 -0
  257. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/integration/__init__.py +0 -0
  258. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/integration/authored_optimize/judge.py +0 -0
  259. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/integration/authored_optimize/optimize_hosted.py +0 -0
  260. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/integration/conftest.py +0 -0
  261. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/integration/hosted_mcp_tool_optimize_probe.py +0 -0
  262. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/integration/hosted_optimize_probe.py +0 -0
  263. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/integration/optimization_run_probe.py +0 -0
  264. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/integration/system_one_deployment.py +0 -0
  265. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/integration/test_cli_deploy_smoketest.py +0 -0
  266. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/integration/test_logs_renders_traces.py +0 -0
  267. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/integration/test_optimization_run.py +0 -0
  268. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/integration/test_optimizing_progress.py +0 -0
  269. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/integration/test_unhappy_path.py +0 -0
  270. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/lm15_prompt_fixture.py +0 -0
  271. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/lm15_prompts/four_turn_predict.json +0 -0
  272. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/lm15_prompts/rlm_six_turns.json +0 -0
  273. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/__init__.py +0 -0
  274. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/__main__.py +0 -0
  275. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/drain.py +0 -0
  276. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/ingest.py +0 -0
  277. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/latency_transport.py +0 -0
  278. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/rlm_shape.py +0 -0
  279. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/rlm_size_report.py +0 -0
  280. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/sender/README.md +0 -0
  281. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/sender/__init__.py +0 -0
  282. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/sender/asgi_app.py +0 -0
  283. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/sender/baseline.py +0 -0
  284. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/sender/drive_server.py +0 -0
  285. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/sender/exits.py +0 -0
  286. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/sender/outage.py +0 -0
  287. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/sender/outage_proxy.py +0 -0
  288. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/sender/pools.py +0 -0
  289. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/sender/program.py +0 -0
  290. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/sender/verify.py +0 -0
  291. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/sweep.py +0 -0
  292. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/test_rlm_shape.py +0 -0
  293. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/load/test_rlm_size_report.py +0 -0
  294. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/parity/__init__.py +0 -0
  295. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/parity/conftest.py +0 -0
  296. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/parity/seed_parity.py +0 -0
  297. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/parity/test_auth.py +0 -0
  298. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/parity/test_datasets.py +0 -0
  299. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/parity/test_deployments.py +0 -0
  300. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/parity/test_evals.py +0 -0
  301. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/parity/test_health.py +0 -0
  302. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/parity/test_modules.py +0 -0
  303. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/parity/test_optimizations.py +0 -0
  304. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/parity/test_programs.py +0 -0
  305. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/parity/test_signatures.py +0 -0
  306. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/parity/test_trace_streaming.py +0 -0
  307. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/parity/test_traces.py +0 -0
  308. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/__init__.py +0 -0
  309. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/_provider.py +0 -0
  310. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/_readiness.py +0 -0
  311. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/_reliability.py +0 -0
  312. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/_result.py +0 -0
  313. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/mint_bedrock_token.py +0 -0
  314. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_bedrock_converse.py +0 -0
  315. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_deploy_programs.py +0 -0
  316. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_multi_client_stress.py +0 -0
  317. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_optimize_client_committee.py +0 -0
  318. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_optimize_continuation.py +0 -0
  319. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_optimize_loop.py +0 -0
  320. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_optimize_loop_wasm.py +0 -0
  321. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_optimize_stress.py +0 -0
  322. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_provider_roles.py +0 -0
  323. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_readiness.py +0 -0
  324. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_real_provider_twins.py +0 -0
  325. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_reliability.py +0 -0
  326. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_reliability_classify.py +0 -0
  327. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_rlm_wasm.py +0 -0
  328. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_skill_agent.py +0 -0
  329. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/real_models/test_trace_search.py +0 -0
  330. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/span_reference_fixture.py +0 -0
  331. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_adapter_reentrancy.py +0 -0
  332. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_assessments_api.py +0 -0
  333. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_authored.py +0 -0
  334. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_authored_binding_credentials.py +0 -0
  335. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_authored_bundle_collisions.py +0 -0
  336. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_authored_metric_contract.py +0 -0
  337. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_authored_named_models.py +0 -0
  338. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_authored_optimize.py +0 -0
  339. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_callback.py +0 -0
  340. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_candidate_lineage.py +0 -0
  341. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_check_release_artifacts.py +0 -0
  342. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/__init__.py +0 -0
  343. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/conftest.py +0 -0
  344. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_admin.py +0 -0
  345. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_api_client.py +0 -0
  346. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_assessments.py +0 -0
  347. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_auth.py +0 -0
  348. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_credentials.py +0 -0
  349. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_datasets.py +0 -0
  350. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_deployment_runs.py +0 -0
  351. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_deployments.py +0 -0
  352. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_evals.py +0 -0
  353. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_feedback.py +0 -0
  354. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_json_flag.py +0 -0
  355. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_login.py +0 -0
  356. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_main.py +0 -0
  357. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_optimizations.py +0 -0
  358. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_org.py +0 -0
  359. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_pagination.py +0 -0
  360. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_parity.py +0 -0
  361. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_programs.py +0 -0
  362. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_provider_credentials.py +0 -0
  363. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_provider_flags.py +0 -0
  364. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_providers.py +0 -0
  365. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_schema_sample.py +0 -0
  366. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_shell.py +0 -0
  367. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_skill.py +0 -0
  368. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_skill_offer.py +0 -0
  369. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_tool_servers.py +0 -0
  370. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_top.py +0 -0
  371. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_traces.py +0 -0
  372. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_traces_program_and_module.py +0 -0
  373. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_traces_search_wire.py +0 -0
  374. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_tree_help.py +0 -0
  375. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cli/test_valsets.py +0 -0
  376. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_client.py +0 -0
  377. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_client_floor.py +0 -0
  378. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_client_program_names.py +0 -0
  379. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_clustering/__init__.py +0 -0
  380. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_clustering/conftest.py +0 -0
  381. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_clustering/test_edge_cases.py +0 -0
  382. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_clustering/test_hash_consistency.py +0 -0
  383. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_cmp551_grouping_identity.py +0 -0
  384. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_configuration.py +0 -0
  385. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_context.py +0 -0
  386. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_context_propagation.py +0 -0
  387. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_credential_kwargs.py +0 -0
  388. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_credential_selection.py +0 -0
  389. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_dataset_polling.py +0 -0
  390. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_dataset_sync.py +0 -0
  391. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_datasets.py +0 -0
  392. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_decision_client_spans.py +0 -0
  393. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_decorators.py +0 -0
  394. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_deploy.py +0 -0
  395. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_deploy_mcp_tool_references.py +0 -0
  396. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_deploy_program_id.py +0 -0
  397. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_deployment_metadata.py +0 -0
  398. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_deployment_runs.py +0 -0
  399. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_deployment_targets.py +0 -0
  400. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_deployments_read.py +0 -0
  401. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_dspy_version_label.py +0 -0
  402. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_eval.py +0 -0
  403. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_eval_example_attribution.py +0 -0
  404. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_eval_example_failures.py +0 -0
  405. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_eval_program_id.py +0 -0
  406. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_eval_start.py +0 -0
  407. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_eval_trace_grouping.py +0 -0
  408. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_exception_paths.py +0 -0
  409. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_execute.py +0 -0
  410. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_execute_run_identity.py +0 -0
  411. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_exporter.py +0 -0
  412. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_exporter_fork_exec.py +0 -0
  413. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_exporter_program_names.py +0 -0
  414. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_exporter_real.py +0 -0
  415. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_exporter_rejections.py +0 -0
  416. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_fake_lm.py +0 -0
  417. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_field_types.py +0 -0
  418. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_forward_access_warning.py +0 -0
  419. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_gepa_callback.py +0 -0
  420. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_gepa_integration.py +0 -0
  421. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_gepa_output_normalization.py +0 -0
  422. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_gepa_resume.py +0 -0
  423. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_identity.py +0 -0
  424. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_imaging.py +0 -0
  425. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_import_weight.py +0 -0
  426. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_ingest_conformance.py +0 -0
  427. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_integration.py +0 -0
  428. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_interpreter_callback.py +0 -0
  429. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_ir_encoder_properties.py +0 -0
  430. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_ir_golden_vectors.py +0 -0
  431. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_ir_roundtrip.py +0 -0
  432. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_kernel_lines.py +0 -0
  433. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_label_vocabulary.py +0 -0
  434. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_lm15_native_calls.py +0 -0
  435. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_lm15_prompt_fixtures.py +0 -0
  436. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_lm15_prompt_references.py +0 -0
  437. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_lm_configuration.py +0 -0
  438. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_lm_usage_shapes.py +0 -0
  439. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_mcp_tools.py +0 -0
  440. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_model_list_protocol.py +0 -0
  441. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_models.py +0 -0
  442. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_multi_client_stress_readiness.py +0 -0
  443. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_no_signature_hash_on_the_wire.py +0 -0
  444. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_optimization_phase_callback.py +0 -0
  445. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_optimization_program_names.py +0 -0
  446. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_optimization_progress.py +0 -0
  447. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_optimization_start.py +0 -0
  448. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_optimize.py +0 -0
  449. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_optimize_budget.py +0 -0
  450. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_optimize_gepa_settings.py +0 -0
  451. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_optimize_labels.py +0 -0
  452. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_optimize_lift.py +0 -0
  453. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_optimize_lm_model_type.py +0 -0
  454. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_optimize_lms.py +0 -0
  455. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_optimize_proposer.py +0 -0
  456. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_optimize_reflection_lm.py +0 -0
  457. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_optimize_split.py +0 -0
  458. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_owned_trace_streaming.py +0 -0
  459. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_packaging.py +0 -0
  460. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_packaging_callable_source.py +0 -0
  461. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_packaging_mcp_tools.py +0 -0
  462. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_packaging_program_source.py +0 -0
  463. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_poll_until.py +0 -0
  464. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_process_local.py +0 -0
  465. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_program_id_deprecation.py +0 -0
  466. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_program_identity.py +0 -0
  467. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_program_lineage_persist.py +0 -0
  468. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_program_lm_binding.py +0 -0
  469. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_program_names_in_deploy.py +0 -0
  470. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_program_naming.py +0 -0
  471. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_programs_create.py +0 -0
  472. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_project_payload.py +0 -0
  473. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_provider_keyword.py +0 -0
  474. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_provider_models.py +0 -0
  475. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_provider_types.py +0 -0
  476. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_provider_values.py +0 -0
  477. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_provider_writes.py +0 -0
  478. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_real_provider_twins_readiness.py +0 -0
  479. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_reanchor_evidence.py +0 -0
  480. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_reanchor_patch.py +0 -0
  481. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_reflector_properties.py +0 -0
  482. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_reflector_smoke.py +0 -0
  483. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_release_gate_script.py +0 -0
  484. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_release_real_models_script.py +0 -0
  485. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_replaced_names.py +0 -0
  486. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_repro_reactv2_bugs.py +0 -0
  487. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_require_version_bump.py +0 -0
  488. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_retry.py +0 -0
  489. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_rlm_tool_spans.py +0 -0
  490. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_run_attribution_paths.py +0 -0
  491. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_runtime_tools.py +0 -0
  492. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_schemas.py +0 -0
  493. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_seal_lm_credential.py +0 -0
  494. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_seed_review_run.py +0 -0
  495. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_sending_settings.py +0 -0
  496. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_signature_inputs.py +0 -0
  497. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_skill_bundle.py +0 -0
  498. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_skill_tools_block.py +0 -0
  499. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_span_references.py +0 -0
  500. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_span_sent_once.py +0 -0
  501. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_span_submission.py +0 -0
  502. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_span_submission_wire_contract.py +0 -0
  503. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_stored_login.py +0 -0
  504. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_system_one.py +0 -0
  505. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_token_attribution.py +0 -0
  506. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_trace_context_concurrency.py +0 -0
  507. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_trace_fact_wire_contract.py +0 -0
  508. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_trace_facts.py +0 -0
  509. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_trace_labels.py +0 -0
  510. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_trace_render.py +0 -0
  511. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_traces_label_search_busy.py +0 -0
  512. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_traces_read.py +0 -0
  513. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_tracked_gepa.py +0 -0
  514. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_tracker_enrich.py +0 -0
  515. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_truncation.py +0 -0
  516. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_upload_auth_headers.py +0 -0
  517. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_usage_dialect.py +0 -0
  518. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_user_agent.py +0 -0
  519. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_valsets_api.py +0 -0
  520. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_versions.py +0 -0
  521. {cmpnd-0.111.0 → cmpnd-0.111.1}/tests/test_xxh64.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: cmpnd
3
- Version: 0.111.0
3
+ Version: 0.111.1
4
4
  Summary: DSPy observability and deployment SDK for cmpnd
5
5
  Project-URL: Homepage, https://cmpnd.ai
6
6
  Author-email: cmpnd <hello@cmpnd.ai>
@@ -826,8 +826,11 @@ configures before it forks does that work once.
826
826
  finishes, or as soon as the request before it returns, so an exit that skips
827
827
  the SDK's exit flush loses only the traces of about the last round trip.
828
828
  - **At exit**, the SDK spends up to five seconds sending what is still queued.
829
- It does so in a `multiprocessing` child too, which leaves without running
830
- `atexit` handlers before Python 3.13. Two kinds of exit skip it:
829
+ When that time runs out, it logs how many records it never sent and how many
830
+ were still sending. Call `cmpnd.flush(timeout)` before the program ends to
831
+ give a large backlog more time. The SDK flushes at exit in a
832
+ `multiprocessing` child too, which leaves without running `atexit` handlers
833
+ before Python 3.13. Two kinds of exit skip it:
831
834
  - `Pool.terminate()` kills the workers, and leaving a `with Pool()` block
832
835
  calls it. Call `pool.close()` and `pool.join()` first, or `cmpnd.flush()` at
833
836
  the end of the task.
@@ -772,8 +772,11 @@ configures before it forks does that work once.
772
772
  finishes, or as soon as the request before it returns, so an exit that skips
773
773
  the SDK's exit flush loses only the traces of about the last round trip.
774
774
  - **At exit**, the SDK spends up to five seconds sending what is still queued.
775
- It does so in a `multiprocessing` child too, which leaves without running
776
- `atexit` handlers before Python 3.13. Two kinds of exit skip it:
775
+ When that time runs out, it logs how many records it never sent and how many
776
+ were still sending. Call `cmpnd.flush(timeout)` before the program ends to
777
+ give a large backlog more time. The SDK flushes at exit in a
778
+ `multiprocessing` child too, which leaves without running `atexit` handlers
779
+ before Python 3.13. Two kinds of exit skip it:
777
780
  - `Pool.terminate()` kills the workers, and leaving a `with Pool()` block
778
781
  calls it. Call `pool.close()` and `pool.join()` first, or `cmpnd.flush()` at
779
782
  the end of the task.
@@ -913,9 +913,8 @@ class OptimizationTracker:
913
913
  # Export via cmpnd exporter: create, update, or skip — see _flush_terminal.
914
914
  # Best-effort for the same reason finalize_error's flush is: the caller is
915
915
  # holding a compiled program that cost real money to produce, and an
916
- # unreachable backend must not be what takes it away from them. This path
917
- # writes over the network now (reserve-then-PUT), so it can raise where
918
- # the old fire-and-forget enqueue could not.
916
+ # unreachable backend must not be what takes it away from them. Every arm
917
+ # writes over the network before returning, so any of them can raise.
919
918
  try:
920
919
  self._flush_terminal()
921
920
  except Exception:
@@ -964,13 +963,25 @@ class OptimizationTracker:
964
963
  context.set_optimization_program_id(self.optimization_run_id, self.program_id)
965
964
 
966
965
  def _export_update(self) -> None:
967
- """Update existing optimization run record."""
966
+ """Write the closing record of a run serve already holds. Blocking, never raises.
967
+
968
+ A run whose closing record does not land reads ``running`` on serve, so a
969
+ failure names the run.
970
+ """
968
971
  exp = self._active_exporter()
969
- if exp:
970
- exp.export_optimization_complete(self)
971
- logger.debug(f"Updated optimization run {self.optimization_run_id}")
972
- else:
972
+ if not exp:
973
973
  logger.warning("No exporter available, optimization run not updated")
974
+ return
975
+ try:
976
+ exp.export_optimization_complete(self)
977
+ except Exception as e:
978
+ logger.error(
979
+ "cmpnd: optimization run %s was not closed on cmpnd; it will show running (%s)",
980
+ self.optimization_run_id,
981
+ e,
982
+ )
983
+ return
984
+ logger.debug(f"Updated optimization run {self.optimization_run_id}")
974
985
 
975
986
  def _export(self) -> None:
976
987
  """Write a run that was never start()ed, in one go at the end.
@@ -449,8 +449,8 @@ def _may_resend_a_minting_post(exc: BaseException) -> bool:
449
449
  class ExportItem:
450
450
  """Item in the export queue."""
451
451
 
452
- # item_type: "trace", "span", "eval_run", "optimization_complete",
453
- # "optimization_progress", "trace_start", or "trace_finalize"
452
+ # item_type: "trace", "span", "eval_run", "optimization_progress",
453
+ # "trace_start", or "trace_finalize"
454
454
  item_type: str
455
455
  # Tag-driven dispatch (item_type → method on data). pyright can't
456
456
  # narrow the union across the if/elif chain in _flush_batch, so each
@@ -563,12 +563,15 @@ def _producer_context(record: TraceRecord) -> ExportContext | None:
563
563
  _SHEDDABLE_ITEM_TYPES = frozenset({"span"})
564
564
 
565
565
  # The records that settle something a producer recorded: a finished trace, a trace's
566
- # finalize, a finished eval or optimization run. Each wakes an idle lane at once, so a
566
+ # finalize, a finished eval run. Each wakes an idle lane at once, so a
567
567
  # process that exits without running an exit hook, as a SIGTERM, ``os._exit`` or
568
568
  # ``Pool.terminate()`` makes it, loses only what it recorded in the last round trip,
569
569
  # not in the last flush interval. A start is not one of them: it waits for its trace,
570
570
  # so a trace that finishes within the interval still leaves in one request.
571
- _SETTLING_ITEM_TYPES = frozenset({"trace", "encoded_trace", "trace_finalize", "eval_run", "optimization_complete"})
571
+ _SETTLING_ITEM_TYPES = frozenset({"trace", "encoded_trace", "trace_finalize", "eval_run"})
572
+
573
+ # How many closed optimization runs a lane remembers, to skip progress still queued for them.
574
+ _CLOSED_RUNS_KEPT = 1024
572
575
 
573
576
  # How long a lane holds a trace's start back, waiting for the trace to finish. A
574
577
  # start sent on its own costs a request of its own, and a start queued with its
@@ -870,6 +873,12 @@ class BatchExporter:
870
873
  self._wake_sent = False
871
874
  # Set by an enqueue that queued a settling record, cleared when a batch takes.
872
875
  self._settling_queued = False
876
+ # The optimization runs this lane closed most recently, oldest first. Their queued
877
+ # progress is never sent. Progress is queued before its run closes, so a run's
878
+ # progress has long left the queue by the time _CLOSED_RUNS_KEPT more runs close.
879
+ self._closed_runs: collections.OrderedDict[str, None] = collections.OrderedDict()
880
+ # Whether the lane reported at exit what it could not send, so no hook repeats it.
881
+ self._reported_at_exit = False
873
882
  # The traces whose start the lane took and whose finished body or finalize it
874
883
  # has not. A trace in here always settles: its terminal record is never shed
875
884
  # without one that settles it. Bounded by the traces running at once.
@@ -1553,7 +1562,7 @@ class BatchExporter:
1553
1562
  try:
1554
1563
  self._send_json_retrying(self._sync_http_client(), "PUT", path, payload)
1555
1564
  except Exception as e:
1556
- raise RuntimeError(f"failed to create the run via {path}: {e}") from e
1565
+ raise RuntimeError(f"failed to write the run via {path}: {e}") from e
1557
1566
 
1558
1567
  def _sync_http_client(self) -> httpx.Client:
1559
1568
  self._own_process()
@@ -1626,11 +1635,24 @@ class BatchExporter:
1626
1635
  self._enqueue(ExportItem("optimization_progress", optimization_run, time.time()))
1627
1636
 
1628
1637
  def export_optimization_complete(self, optimization_run: OptimizationRunRecord) -> None:
1629
- """Queue an optimization completion update for export (non-blocking).
1638
+ """Write a run's closing record to serve before returning. Blocking.
1630
1639
 
1631
- This updates an existing record with final results instead of creating a new one.
1640
+ The closing record never waits in the send queue, where a full byte budget would
1641
+ drop it and leave the run open on serve. Progress still queued for the run is not
1642
+ sent after it, because serve refuses progress on a closed run. Raises when the
1643
+ write fails, so the caller can say the run stays open.
1632
1644
  """
1633
- self._enqueue(ExportItem("optimization_complete", optimization_run, time.time()))
1645
+ run_id = str(optimization_run.optimization_run_id or "")
1646
+ if run_id:
1647
+ self._closed_runs[run_id] = None
1648
+ while len(self._closed_runs) > _CLOSED_RUNS_KEPT:
1649
+ self._closed_runs.popitem(last=False)
1650
+ try:
1651
+ self.export_optimization_run(optimization_run)
1652
+ except BaseException:
1653
+ # The run stays open on serve, so a run resumed from its checkpoint sends progress again.
1654
+ self._closed_runs.pop(run_id, None)
1655
+ raise
1634
1656
 
1635
1657
  def _enqueue(self, item: ExportItem, *, settles_a_start: bool = False, hold_start: str | None = None) -> bool:
1636
1658
  """Queue a record in its lane, shedding only what is safe to shed. True if queued.
@@ -1904,6 +1926,39 @@ class BatchExporter:
1904
1926
  self._release_bytes(item.size, in_flight=False)
1905
1927
  self._record_drop(item.item_type, "shutdown")
1906
1928
 
1929
+ def report_unsent_at_exit(self, flush_seconds: float) -> None:
1930
+ """Say what the lane still held when the exit flush ran out of time. Once per process.
1931
+
1932
+ The process exits next. A queued record is never sent, so it counts as an
1933
+ ``unsent_at_exit`` drop and its bytes are released. A batch still sending may
1934
+ have delivered some of its records, so batches are reported and not counted.
1935
+ """
1936
+ if self._reported_at_exit:
1937
+ return
1938
+ self._reported_at_exit = True
1939
+ queued = self._drain_pending()
1940
+ for item in queued:
1941
+ self._release_bytes(item.size, in_flight=False)
1942
+ self._record_drop(item.item_type, "unsent_at_exit", log=False)
1943
+ state = self._loop_state
1944
+ try:
1945
+ batches = list(state.in_flight.values()) if state is not None else []
1946
+ except RuntimeError: # the sender changed the batches while they were read
1947
+ batches = []
1948
+ if not queued and not batches:
1949
+ return
1950
+ logger.warning(
1951
+ "cmpnd: the exit flush ran out of time after %.0fs. %d records (%.1f MB) were still queued and were"
1952
+ " not sent. %d batches of %d records (%.1f MB) were still sending, and some of those records may"
1953
+ " have landed. Call cmpnd.flush(timeout) before the program ends to give them time.",
1954
+ flush_seconds,
1955
+ len(queued),
1956
+ sum(item.size for item in queued) / 1_000_000,
1957
+ len(batches),
1958
+ sum(batch[2] for batch in batches),
1959
+ sum(batch[3] for batch in batches) / 1_000_000,
1960
+ )
1961
+
1907
1962
  def _drain_pending(self, limit: int | None = None) -> list[ExportItem]:
1908
1963
  """Take what is queued, in dispatch order: everything, or the first ``limit`` records."""
1909
1964
  self._release_starts()
@@ -2458,15 +2513,6 @@ class BatchExporter:
2458
2513
  functools.partial(self._send_eval_runs, route, [eval_dict]),
2459
2514
  )
2460
2515
  )
2461
- elif item.item_type == "optimization_complete":
2462
- complete_dict = cast("OptimizationRunRecord", item.data).to_api_dict()
2463
- run_updates.append(
2464
- (
2465
- f"optimization:{complete_dict.get('optimization_run_id')}",
2466
- False,
2467
- functools.partial(self._send_optimization_complete, route, [complete_dict]),
2468
- )
2469
- )
2470
2516
  elif item.item_type == "optimization_progress":
2471
2517
  trk = cast("OptimizationRunRecord", item.data)
2472
2518
  run_id = str(trk.optimization_run_id)
@@ -3194,6 +3240,8 @@ class BatchExporter:
3194
3240
  repeat what that update was still delivering, such as a proposal's texts.
3195
3241
  """
3196
3242
  for opt_run_id, trk in optimization_progress_to_send:
3243
+ if opt_run_id in self._closed_runs:
3244
+ continue
3197
3245
  try:
3198
3246
  progress_dict = trk.to_progress_dict()
3199
3247
  response = await self._send_json_retrying_async(
@@ -3212,34 +3260,3 @@ class BatchExporter:
3212
3260
  except Exception as e:
3213
3261
  self._log_send_failure("Failed to update optimization progress %s: %s", opt_run_id, e)
3214
3262
  self._add_errors(1)
3215
-
3216
- async def _send_optimization_complete(
3217
- self, route: _Route, optimization_complete_to_send: list[dict[str, Any]]
3218
- ) -> None:
3219
- for opt_run_dict in optimization_complete_to_send:
3220
- opt_run_id = str(opt_run_dict.get("optimization_run_id"))
3221
- num_iterations = len(opt_run_dict.get("iterations", []))
3222
- num_candidates = len(opt_run_dict.get("candidates", []))
3223
- try:
3224
- response = await self._send_json_retrying_async(
3225
- route, "PUT", f"/api/v1/optimizations/{opt_run_id}", opt_run_dict
3226
- )
3227
- response.raise_for_status()
3228
- self._add_exported(1)
3229
- logger.debug(
3230
- f"Completed optimization run {opt_run_id} with "
3231
- f"{num_iterations} iterations, {num_candidates} candidates"
3232
- )
3233
- except httpx.HTTPStatusError as e:
3234
- error_detail = ""
3235
- try:
3236
- error_detail = e.response.text
3237
- except Exception:
3238
- pass
3239
- self._log_send_failure(
3240
- "Failed to complete optimization run %s: %s\nResponse body: %s", opt_run_id, e, error_detail
3241
- )
3242
- self._add_errors(1)
3243
- except Exception as e:
3244
- self._log_send_failure("Failed to complete optimization run %s: %s", opt_run_id, e)
3245
- self._add_errors(1)
@@ -766,17 +766,17 @@ def _register_exit_flush(pid: int) -> None:
766
766
  threading hook and the ``atexit`` one finds nothing left to send.
767
767
  """
768
768
  try:
769
- threading._register_atexit(_flush_at_exit, pid) # pyright: ignore[reportAttributeAccessIssue]
769
+ threading._register_atexit(_flush_at_exit, pid, False) # pyright: ignore[reportAttributeAccessIssue]
770
770
  except Exception: # noqa: BLE001 — threading is already shutting down, or has no such hook
771
771
  pass
772
- atexit.register(_flush_at_exit, pid)
772
+ atexit.register(_flush_at_exit, pid, True)
773
773
 
774
774
 
775
775
  # The seconds the exit flushes have spent so far, and the process that spent them.
776
776
  _exit_spent: tuple[int, float] | None = None
777
777
 
778
778
 
779
- def _flush_at_exit(pid: int) -> None:
779
+ def _flush_at_exit(pid: int, atexit_hook: bool = True) -> None:
780
780
  """The exit flush. A forked child inherits the parent's registration, which is not its own.
781
781
 
782
782
  Both exit hooks call it, and they share ``EXIT_FLUSH_SECONDS`` of flushing: each
@@ -786,9 +786,14 @@ def _flush_at_exit(pid: int) -> None:
786
786
  the first flush still gets the rest of the budget. The second finds every lane
787
787
  empty and returns at once otherwise.
788
788
 
789
- Each lane then logs its drop summary, which logs at most once per window while
790
- the process runs, so the drops since its last line are reported. A lane with
791
- nothing new to report logs nothing, so the second hook repeats no line.
789
+ Once the deadline is spent, the last hook to run has each lane say what it still
790
+ holds: queued records, which are never sent, and batches still sending. The
791
+ sender keeps sending while the interpreter joins non-daemon threads, so the
792
+ threading hook leaves that report to the ``atexit`` one, unless no ``atexit``
793
+ hook will run (``_atexit_hooks_skipped``). Each lane then logs its drop summary,
794
+ which logs at most once per window while the process runs, so the drops since
795
+ its last line are reported. A lane with nothing new to report logs nothing, so
796
+ the second hook repeats no line.
792
797
  """
793
798
  if pid != os.getpid():
794
799
  return
@@ -797,14 +802,26 @@ def _flush_at_exit(pid: int) -> None:
797
802
  return
798
803
  if any(lane._has_pending() for lane in sender.lanes()):
799
804
  _spend_exit_flush(pid)
805
+ out_of_time = _exit_spent is not None and _exit_spent[0] == pid and _exit_spent[1] >= EXIT_FLUSH_SECONDS
806
+ last_hook = atexit_hook or _atexit_hooks_skipped()
800
807
  for lane in sender.lanes():
801
808
  try:
809
+ if out_of_time and last_hook:
810
+ lane.report_unsent_at_exit(EXIT_FLUSH_SECONDS)
802
811
  lane.log_drop_summary()
803
812
  lane._log_recoveries()
804
813
  except Exception: # noqa: BLE001 — best effort at exit
805
814
  pass
806
815
 
807
816
 
817
+ def _atexit_hooks_skipped() -> bool:
818
+ """Whether this process exits without running ``atexit`` hooks, as a
819
+ ``multiprocessing`` child before Python 3.13 does (``_register_exit_flush``)."""
820
+ multiprocessing = sys.modules.get("multiprocessing")
821
+ in_child = multiprocessing is not None and multiprocessing.parent_process() is not None
822
+ return in_child and sys.version_info < (3, 13)
823
+
824
+
808
825
  def _spend_exit_flush(pid: int) -> None:
809
826
  """Flush for what is left of ``EXIT_FLUSH_SECONDS``, and count the time spent."""
810
827
  global _exit_spent
@@ -90,8 +90,8 @@ The caller handles two refusals:
90
90
  The method blocks and coalesces nothing. The producer decides which state is
91
91
  current when the network falls behind.
92
92
 
93
- `export_trace`, `export_span`, `export_optimization_progress` and
94
- `export_optimization_complete` queue their records and return. The exporter
93
+ `export_trace`, `export_span` and `export_optimization_progress` queue their
94
+ records and return. The exporter
95
95
  has two queues, each `max_queue_size` deep. Spans go to one queue, which sheds
96
96
  first. Every other record goes to the other queue, which sheds only when it
97
97
  fills too. Every lane of the process also shares one byte budget,
@@ -100,7 +100,11 @@ default of 128 MiB. A record holds its bytes until the server takes it or it is
100
100
  dropped. Spans shed at seven eighths of the budget, everything else at the whole.
101
101
  `export_optimization_start`, `export_optimization_run` and
102
102
  `export_optimization_checkpoint` block, because a run must exist before any
103
- record that refers to it.
103
+ record that refers to it. `export_optimization_complete` blocks too, so a full
104
+ queue can never drop the record that closes a run. It raises when serve does not
105
+ take the record, and the tracker then logs that the run stays open. Progress
106
+ still queued for a closed run is never sent, because serve refuses progress on
107
+ a closed run.
104
108
 
105
109
  ## HTTP request timeouts
106
110
 
@@ -432,7 +432,7 @@ the variable names and their scope.
432
432
  One sender per process (`cmpnd_ingest/sender.py`) runs one OS thread with a private asyncio event loop and one `httpx.AsyncClient` per lane. Each `BatchExporter` is a lane, and the sender runs one task per lane. The idea of a lane per key with a process-wide cap on posts comes from the wasm worker's `IngestLanes`.
433
433
 
434
434
  - **The caller's side.** `export_*` checks the pid, puts the record on the lane's bounded queue without blocking, and wakes the lane's task once the queue holds `batch_size` records, or at once for a record that settles a trace or a run: a full trace, a finalize, a finished eval or optimization run. It never raises. A full queue drops the record and counts it as `queue_full`. A record past the process's byte budget is dropped as `queue_bytes_full`; its sealed body was measured when it was copied (`bodies._seal`), and it holds its bytes until its batch finishes or it is dropped. A sender that cannot run counts it as `sender_unavailable`.
435
- - **Starting.** `start()` only marks the lane ready. The sender's thread starts on the process's first queued record. `cmpnd.configure()` and `cmpnd.Client()` prepare it first: they import every module the sender would import and build the TLS context its clients share (`configuration.prepare_sending`), 13 to 38 ms measured on a laptop, so the first record does not pay for it. A process that records without configuring prepares on its first record instead. It resolves host names on an OS thread of its own rather than asyncio's default thread pool, which the interpreter shuts down before the exit flush runs. Under gevent or eventlet it also starts through the original `_thread.start_new_thread` and selects over the original `select`, so it never waits on the hub. A TLS context whose class `ssl` no longer exports, as when a gevent worker patched `ssl` after its master built the context, is rebuilt (`network.ssl_context`) by the caller each time a lane attaches, before the sender builds the lane's client, so the sender's thread never loads certificates. anyio hands the TLS work of any other class to a worker thread, which under gevent never runs. The caller never waits for the thread. It starts the thread, queues its record and returns, and the thread reports its own start: it publishes its loop and spawns a task per lane, or records the exception that stopped it. The next caller that finds a failure raises a `SenderUnavailableWarning` once, naming that exception and pointing at the caller's own line, and the next start waits out a backoff of one second to a minute, counted from the moment the thread failed. A record queued during the backoff neither starts a thread nor retries the imports that prepare one. A lane whose HTTP client cannot be built, as when no file descriptor is free, logs one error naming the cause, keeps its records queued and tries again every flush interval; the next client that builds resets the report. A sender loop whose constructor fails at its self-pipe for the same reason is collected without asyncio's destructor traceback (`_SenderLoop.__del__`). `sender_health()` holds the cause. The exit flush is registered when the first thread starts, so a process that records once and exits before the loop runs still flushes, and the flush waits for the loop under its own deadline. It is registered with both `threading._register_atexit` and `atexit`. Before Python 3.13 a `multiprocessing` child leaves through `os._exit` right after `threading._shutdown`, which runs only the threading hooks. At a normal exit the threading hook runs first and the `atexit` one finds every lane idle and returns. The two share five seconds of flushing: each waits at most for what the flushes before it did not spend, and the time between them does not count. threading's hook runs before the interpreter joins non-daemon threads, so a thread that outlives the main thread and records after the first flush still gets the rest of the five seconds from the `atexit` one. Each lane then logs its drop summary, which logs at most once a window while the process runs, so drops since its last line are reported once at exit. Two exits run neither hook: `Pool.terminate()`, which leaving a `with Pool()` block calls, kills the workers, and billiard's prefork children, which Celery runs, leave through `os._exit` from `billiard.pool.Worker._do_exit` and from `billiard.popen_fork.Popen._launch` without calling `threading._shutdown`. Their records go out only if the task, or a `worker_process_shutdown` handler, calls `cmpnd.flush()`. uvicorn re-raises the SIGTERM it stopped on after its shutdown, so a worker dies by the signal and runs neither hook; the app flushes in its lifespan shutdown, and the SDK installs no signal handler of its own.
435
+ - **Starting.** `start()` only marks the lane ready. The sender's thread starts on the process's first queued record. `cmpnd.configure()` and `cmpnd.Client()` prepare it first: they import every module the sender would import and build the TLS context its clients share (`configuration.prepare_sending`), 13 to 38 ms measured on a laptop, so the first record does not pay for it. A process that records without configuring prepares on its first record instead. It resolves host names on an OS thread of its own rather than asyncio's default thread pool, which the interpreter shuts down before the exit flush runs. Under gevent or eventlet it also starts through the original `_thread.start_new_thread` and selects over the original `select`, so it never waits on the hub. A TLS context whose class `ssl` no longer exports, as when a gevent worker patched `ssl` after its master built the context, is rebuilt (`network.ssl_context`) by the caller each time a lane attaches, before the sender builds the lane's client, so the sender's thread never loads certificates. anyio hands the TLS work of any other class to a worker thread, which under gevent never runs. The caller never waits for the thread. It starts the thread, queues its record and returns, and the thread reports its own start: it publishes its loop and spawns a task per lane, or records the exception that stopped it. The next caller that finds a failure raises a `SenderUnavailableWarning` once, naming that exception and pointing at the caller's own line, and the next start waits out a backoff of one second to a minute, counted from the moment the thread failed. A record queued during the backoff neither starts a thread nor retries the imports that prepare one. A lane whose HTTP client cannot be built, as when no file descriptor is free, logs one error naming the cause, keeps its records queued and tries again every flush interval; the next client that builds resets the report. A sender loop whose constructor fails at its self-pipe for the same reason is collected without asyncio's destructor traceback (`_SenderLoop.__del__`). `sender_health()` holds the cause. The exit flush is registered when the first thread starts, so a process that records once and exits before the loop runs still flushes, and the flush waits for the loop under its own deadline. It is registered with both `threading._register_atexit` and `atexit`. Before Python 3.13 a `multiprocessing` child leaves through `os._exit` right after `threading._shutdown`, which runs only the threading hooks. At a normal exit the threading hook runs first and the `atexit` one finds every lane idle and returns. The two share five seconds of flushing: each waits at most for what the flushes before it did not spend, and the time between them does not count. threading's hook runs before the interpreter joins non-daemon threads, so a thread that outlives the main thread and records after the first flush still gets the rest of the five seconds from the `atexit` one. When the five seconds run out, the last hook to run has each lane log one line (`BatchExporter.report_unsent_at_exit`). It names the records the lane still queued, which it never sends and counts as `unsent_at_exit` drops, and the batches still sending, which may have delivered some of their records and are not counted. The threading hook leaves the line to the `atexit` one, because the sender keeps sending while the interpreter joins non-daemon threads. In a `multiprocessing` child before Python 3.13, which runs no `atexit` hook, the threading hook logs it. Each lane then logs its drop summary, which logs at most once a window while the process runs, so drops since its last line are reported once at exit. Two exits run neither hook: `Pool.terminate()`, which leaving a `with Pool()` block calls, kills the workers, and billiard's prefork children, which Celery runs, leave through `os._exit` from `billiard.pool.Worker._do_exit` and from `billiard.popen_fork.Popen._launch` without calling `threading._shutdown`. Their records go out only if the task, or a `worker_process_shutdown` handler, calls `cmpnd.flush()`. uvicorn re-raises the SIGTERM it stopped on after its shutdown, so a worker dies by the signal and runs neither hook; the app flushes in its lifespan shutdown, and the SDK installs no signal handler of its own.
436
436
  - **A lane's task** waits for a wake or `flush_interval_seconds`, then runs a turn. A start does not wake it, so a trace that finishes within the interval goes out with its start in one request, as soon as it finishes. A turn takes everything queued as one batch, lifecycle records first, and starts sending it without waiting for it. It takes again once `batch_size` records or a flush wait, or once a settling record waits and no batch of the lane is sending, so traces that finish during a request follow it together when it returns. `_flush_batch_async` sorts the batch's items by type (`trace`, `span`, `trace_start`, `trace_finalize`, `eval_run`, `optimization_run`, various optimization progress records), folds loose spans into their trace's body when it is in the same batch, and makes one job per unit of sending: one trace's spans, the full traces, each start, each finalize and each update to an eval or optimization run. Jobs run side by side, except for two lines. A trace's finalize waits until its start has been answered, because serve keeps no completion for a trace it has no row for, and spans need no order. An update to a run waits until that run's previous update has finished, retries included, so a run's progress never lands out of order and moves backward. A waiting update holds no slot and does not count against the lane's jobs, so it never stops the lane taking other records. A newer progress update takes the place of one still waiting for the same run, which then sends nothing: every progress body carries all the iteration points not yet acknowledged, so a run has at most one progress update waiting. A flush that covers the replaced update waits for its replacement to land.
437
437
  - **Holding a lane.** The sender holds a lane weakly while it is idle and strongly while it holds records, queued or in flight (`Sender.hold`, `Sender.release_if_idle`). An enqueue holds the lane after its put, and the lane's task lets go after a turn that leaves nothing pending, checked under the sender's lock, so a lane the program drops with records queued still sends them.
438
438
  - **Pipelining without small requests.** A job holds one of the lane's `2 × max_export_workers` slots from its encoding to its last answer, so one set of bodies is on the wire while the next is ready behind it. The turn takes its next batch while earlier ones are still sending, but only once a slot is free and either `batch_size` records or a flush are waiting. Until then records stay in the queue, where a backlog gathers into a few large requests: 3,200 spans of eight traces leave as about eight requests, not 256. Records taken and not yet sent stay within `max_queue_size` and count against `max_queue_bytes` until their batch finishes, so memory stays bounded. A request in its backoff holds its job's slot but no permit, and the records behind it keep moving.
@@ -5,7 +5,7 @@ name = "cmpnd"
5
5
  # it's new) — no git tags. Bump with `uv version --bump {minor,patch}` or by
6
6
  # hand. Runtime `cmpnd.__version__` reads installed metadata, so it tracks
7
7
  # this automatically. See docs/plans/2026-07-02-sdk-pypi-tag-free-publish.md.
8
- version = "0.111.0"
8
+ version = "0.111.1"
9
9
  description = "DSPy observability and deployment SDK for cmpnd"
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.11"
@@ -641,7 +641,6 @@ def test_updates_to_one_optimization_run_land_in_the_order_they_were_recorded():
641
641
  run = request.url.path.split("/")[4]
642
642
  if (run, calls) == ("run-a", 1):
643
643
  exporter.export_optimization_progress(_OptimizationRun("run-a", 2))
644
- exporter.export_optimization_complete(_OptimizationRun("run-a", 3))
645
644
  exporter.export_optimization_progress(_OptimizationRun("run-b", 1))
646
645
  await asyncio.sleep(0.3)
647
646
  landed.append((run, request.method, calls))
@@ -655,11 +654,63 @@ def test_updates_to_one_optimization_run_land_in_the_order_they_were_recorded():
655
654
  assert [entry for entry in landed if entry[0] == "run-a"] == [
656
655
  ("run-a", "PATCH", 1),
657
656
  ("run-a", "PATCH", 2),
658
- ("run-a", "PUT", 3),
659
657
  ]
660
658
  assert landed[0] == ("run-b", "PATCH", 1)
661
659
 
662
660
 
661
+ def test_progress_queued_before_a_run_closes_is_not_sent_after_it():
662
+ """The closing record skips the queue. Serve refuses progress on a settled run, so
663
+ the progress still queued for it stays unsent, and another run's progress still goes."""
664
+ landed: list[tuple[str, str]] = []
665
+
666
+ def handler(request: httpx.Request) -> httpx.Response:
667
+ landed.append((request.method, request.url.path))
668
+ return httpx.Response(200, json={"status": "ok"})
669
+
670
+ exporter = _make_exporter(handler, batch_size=1)
671
+ exporter.export_optimization_progress(_OptimizationRun("run-a", 1))
672
+ exporter.export_optimization_progress(_OptimizationRun("run-b", 1))
673
+ exporter.export_optimization_complete(_OptimizationRun("run-a", 2))
674
+
675
+ asyncio.run(exporter._turn(asyncio.Semaphore(10)))
676
+
677
+ assert sorted(landed) == [
678
+ ("PATCH", "/api/v1/optimizations/run-b/progress"),
679
+ ("PUT", "/api/v1/optimizations/run-a"),
680
+ ]
681
+ assert exporter.health().errored == 0
682
+
683
+
684
+ def test_a_close_serve_refused_leaves_the_runs_progress_to_send():
685
+ """A refused close leaves the run open on serve, where a run resumed from its
686
+ checkpoint still reports progress."""
687
+ landed: list[tuple[str, str]] = []
688
+
689
+ def handler(request: httpx.Request) -> httpx.Response:
690
+ landed.append((request.method, request.url.path))
691
+ if request.method == "PUT":
692
+ return httpx.Response(422, json={"error": "refused"})
693
+ return httpx.Response(200, json={"status": "ok"})
694
+
695
+ exporter = _make_exporter(handler, batch_size=1)
696
+ with pytest.raises(RuntimeError):
697
+ exporter.export_optimization_complete(_OptimizationRun("run-a", 2))
698
+ exporter.export_optimization_progress(_OptimizationRun("run-a", 3))
699
+
700
+ asyncio.run(exporter._turn(asyncio.Semaphore(10)))
701
+
702
+ assert landed == [("PUT", "/api/v1/optimizations/run-a"), ("PATCH", "/api/v1/optimizations/run-a/progress")]
703
+
704
+
705
+ def test_a_lane_remembers_only_its_most_recently_closed_runs(monkeypatch):
706
+ monkeypatch.setattr(exporter_http, "_CLOSED_RUNS_KEPT", 2)
707
+ exporter = _make_exporter()
708
+ for run in ("run-a", "run-b", "run-c"):
709
+ exporter.export_optimization_complete(_OptimizationRun(run, 1))
710
+
711
+ assert list(exporter._closed_runs) == ["run-b", "run-c"]
712
+
713
+
663
714
  @pytest.mark.parametrize("same_batch", [True, False])
664
715
  def test_a_traces_finalize_reaches_serve_after_its_start(same_batch: bool):
665
716
  """serve keeps no completion for a trace it has no row for, so a finalize that
@@ -272,10 +272,10 @@ def test_the_held_id_is_stamped_over_whatever_the_body_claimed() -> None:
272
272
  assert body["optimization_run_id"] == HELD_RUN_ID
273
273
 
274
274
 
275
- def test_a_dict_run_body_carries_its_id_on_the_queued_terminal_write() -> None:
276
- """The terminal write has a queued form as well, and there the id has to be *in* the
277
- body: that sender reads the run it addresses out of the record it is given. A producer
278
- whose record never carried one still reaches its own run."""
275
+ def test_a_dict_run_body_carries_its_id_on_the_closing_write() -> None:
276
+ """The closing write reads the run it addresses out of the record it is given, so the
277
+ id has to be *in* the body. A producer whose record never carried one still reaches
278
+ its own run."""
279
279
  payload = _run_payload()
280
280
  del payload["optimization_run_id"]
281
281
  transport = CapturingTransport()
@@ -5,6 +5,7 @@ lingers forever and the program page shows a perpetual in-progress pip."""
5
5
  from unittest import mock
6
6
 
7
7
  from cmpnd.optimizers import tracker
8
+ from cmpnd_ingest.exporter_http import BatchExporter
8
9
 
9
10
 
10
11
  class _RecordingExporter:
@@ -230,3 +231,19 @@ def test_a_never_started_run_keeps_its_id_when_the_exporter_returns_none():
230
231
  with mock.patch("cmpnd.exporter.get_exporter", return_value=_NoIDExporter()):
231
232
  trk.finalize()
232
233
  assert trk.optimization_run_id == "op_alreadyknown"
234
+
235
+
236
+ def test_a_closing_record_that_fails_says_the_run_stays_open(caplog):
237
+ """The run still reads `running` on serve, so the owner hears which run and why."""
238
+ exp = mock.create_autospec(BatchExporter, instance=True)
239
+ exp.export_optimization_start.return_value = "op_recorded"
240
+ exp.export_optimization_complete.side_effect = RuntimeError("network down")
241
+ trk = _tracker()
242
+ with mock.patch("cmpnd.exporter.get_exporter", autospec=True, return_value=exp):
243
+ trk.start()
244
+ with caplog.at_level("ERROR", logger="cmpnd"):
245
+ trk.finalize()
246
+
247
+ assert trk.status == "completed"
248
+ assert "cmpnd: optimization run op_recorded was not closed on cmpnd; it will show running" in caplog.text
249
+ assert "network down" in caplog.text
@@ -27,7 +27,7 @@ from cmpnd.exporter import BatchExporter
27
27
  from cmpnd_ingest import exporter_http, queue_budget
28
28
  from cmpnd_ingest import sender as process_sender
29
29
  from cmpnd_ingest.bodies import EncodedTraceBody
30
- from tests.test_exporter_queue import _make_exporter, _make_span, _make_trace
30
+ from tests.test_exporter_queue import _make_exporter, _make_span, _make_trace, _OptimizationRun
31
31
 
32
32
  LIMIT = 1_000_000
33
33
  # Spans may use all of the budget but the share kept for the records that start and end traces.
@@ -466,3 +466,61 @@ def test_a_shutdown_does_not_count_a_start_its_full_trace_carried():
466
466
  assert answering.is_set()
467
467
  assert exporter.health().dropped_by_reason == {"shutdown_timeout": 1}
468
468
  assert _held() == 0
469
+
470
+
471
+ class TestARunsClosingRecordBypassesTheQueue:
472
+ """A run's closing record that waited in the queue was dropped once the budget
473
+ filled, and the run read ``running`` on serve for good. It is now written before
474
+ ``export_optimization_complete`` returns, whatever the queue holds."""
475
+
476
+ def test_it_reaches_serve_while_the_budget_is_full(self):
477
+ sent: list[tuple[str, str]] = []
478
+
479
+ def handler(request: httpx.Request) -> httpx.Response:
480
+ sent.append((request.method, request.url.path))
481
+ return httpx.Response(200, json={"status": "ok"})
482
+
483
+ exporter = _make_exporter(handler, max_queue_bytes=LIMIT)
484
+ assert queue_budget.current().hold(LIMIT, LIMIT)
485
+
486
+ exporter.export_optimization_complete(_OptimizationRun("op_closing", 3))
487
+
488
+ assert sent == [("PUT", "/api/v1/optimizations/op_closing")]
489
+ assert exporter.health().dropped == 0
490
+
491
+ def test_a_refused_write_raises(self):
492
+ exporter = _make_exporter(lambda request: httpx.Response(422, json={"error": "no"}))
493
+
494
+ with pytest.raises(RuntimeError, match="op_closing"):
495
+ exporter.export_optimization_complete(_OptimizationRun("op_closing", 3))
496
+
497
+
498
+ def test_records_still_queued_when_the_exit_flush_runs_out_are_counted_and_reported(caplog):
499
+ exporter = _make_exporter(max_queue_bytes=LIMIT)
500
+ trace_id = str(uuid4())
501
+ for _ in range(3):
502
+ exporter.export_span(_Span(trace_id, 100_000))
503
+
504
+ with caplog.at_level(logging.WARNING, logger="cmpnd"):
505
+ exporter.report_unsent_at_exit(5.0)
506
+
507
+ health = exporter.health()
508
+ assert health.dropped_by_reason == {"unsent_at_exit": 3}
509
+ assert health.queue_depth == 0 and _held() == 0
510
+ assert "the exit flush ran out of time after 5s. 3 records (0.3 MB) were still queued and were not sent" in (
511
+ caplog.text
512
+ )
513
+
514
+ caplog.clear()
515
+ exporter.export_span(_Span(trace_id, 100_000))
516
+ with caplog.at_level(logging.WARNING, logger="cmpnd"):
517
+ exporter.report_unsent_at_exit(5.0)
518
+ assert caplog.text == "", "a second exit hook repeated the report"
519
+
520
+
521
+ def test_an_empty_lane_reports_nothing_at_exit(caplog):
522
+ exporter = _make_exporter(max_queue_bytes=LIMIT)
523
+ with caplog.at_level(logging.WARNING, logger="cmpnd"):
524
+ exporter.report_unsent_at_exit(5.0)
525
+ assert caplog.text == ""
526
+ assert exporter.health().dropped == 0
@@ -50,7 +50,7 @@ class _RecordingExporter:
50
50
  def export_optimization_run(self, trk: Any, run_id: str | None = None) -> None:
51
51
  self._record(trk)
52
52
 
53
- # The queued full-record write the terminal flush uses.
53
+ # The full-record write that closes a run.
54
54
  def export_optimization_complete(self, trk: Any) -> None:
55
55
  self._record(trk)
56
56