loopmath 0.3.5__tar.gz → 0.4.0__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 (519) hide show
  1. {loopmath-0.3.5 → loopmath-0.4.0}/PKG-INFO +25 -6
  2. {loopmath-0.3.5 → loopmath-0.4.0}/README.md +24 -5
  3. {loopmath-0.3.5 → loopmath-0.4.0}/pyproject.toml +9 -1
  4. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/__init__.py +1 -1
  5. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/design.py +108 -27
  6. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/fit.py +149 -42
  7. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/forest.py +9 -3
  8. loopmath-0.4.0/src/loopmath/belief/level.py +132 -0
  9. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/outcome.py +108 -10
  10. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/priors.py +52 -0
  11. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/rules.py +10 -7
  12. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/cli.py +24 -0
  13. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/cli_registry.py +360 -5
  14. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/compare/__init__.py +259 -33
  15. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/compare/commands.py +5 -3
  16. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/compare/units.py +9 -5
  17. loopmath-0.4.0/src/loopmath/flows/__init__.py +10 -0
  18. loopmath-0.4.0/src/loopmath/flows/check.py +717 -0
  19. loopmath-0.4.0/src/loopmath/flows/commands.py +1306 -0
  20. loopmath-0.4.0/src/loopmath/flows/edits.py +725 -0
  21. loopmath-0.4.0/src/loopmath/flows/folder.py +133 -0
  22. loopmath-0.4.0/src/loopmath/flows/judges.py +843 -0
  23. loopmath-0.4.0/src/loopmath/flows/next.py +120 -0
  24. loopmath-0.4.0/src/loopmath/flows/plan.py +822 -0
  25. loopmath-0.4.0/src/loopmath/flows/prefill.py +335 -0
  26. loopmath-0.4.0/src/loopmath/flows/record.py +474 -0
  27. loopmath-0.4.0/src/loopmath/flows/records.py +384 -0
  28. loopmath-0.4.0/src/loopmath/flows/simulate.py +816 -0
  29. loopmath-0.4.0/src/loopmath/flows/status.py +374 -0
  30. loopmath-0.4.0/src/loopmath/flows/tomlview.py +666 -0
  31. loopmath-0.4.0/src/loopmath/flows/walk.py +869 -0
  32. loopmath-0.4.0/src/loopmath/harness/herdr/loopmath-harness/herdr-plugin.toml +38 -0
  33. loopmath-0.4.0/src/loopmath/harness/mod/loopmath-harness/.claude-plugin/marketplace.json +6 -0
  34. loopmath-0.4.0/src/loopmath/harness/mod/loopmath-harness/.claude-plugin/plugin.json +21 -0
  35. loopmath-0.4.0/src/loopmath/harness/mod/loopmath-harness/.gitignore +3 -0
  36. loopmath-0.4.0/src/loopmath/harness/mod/loopmath-harness/README.md +40 -0
  37. loopmath-0.4.0/src/loopmath/harness/mod/loopmath-harness/hooks/events.ts +338 -0
  38. loopmath-0.4.0/src/loopmath/harness/mod/loopmath-harness/hooks/hooks.json +1 -0
  39. loopmath-0.4.0/src/loopmath/harness/mod/loopmath-harness/hooks/register.test.ts +469 -0
  40. loopmath-0.4.0/src/loopmath/harness/mod/loopmath-harness/hooks/register.tsx +417 -0
  41. loopmath-0.4.0/src/loopmath/harness/mod/loopmath-harness/types/index.d.ts +79 -0
  42. loopmath-0.4.0/src/loopmath/harness/tune/__init__.py +13 -0
  43. loopmath-0.4.0/src/loopmath/harness/tune/commands.py +1518 -0
  44. loopmath-0.4.0/src/loopmath/harness/tune/config.py +391 -0
  45. loopmath-0.4.0/src/loopmath/harness/tune/contracts.py +778 -0
  46. loopmath-0.4.0/src/loopmath/harness/tune/delivery.py +217 -0
  47. loopmath-0.4.0/src/loopmath/harness/tune/design.py +231 -0
  48. loopmath-0.4.0/src/loopmath/harness/tune/editors.py +203 -0
  49. loopmath-0.4.0/src/loopmath/harness/tune/edits.py +928 -0
  50. loopmath-0.4.0/src/loopmath/harness/tune/effects.py +193 -0
  51. loopmath-0.4.0/src/loopmath/harness/tune/engine.py +1243 -0
  52. loopmath-0.4.0/src/loopmath/harness/tune/events.py +322 -0
  53. loopmath-0.4.0/src/loopmath/harness/tune/executor.py +270 -0
  54. loopmath-0.4.0/src/loopmath/harness/tune/herdr.py +611 -0
  55. loopmath-0.4.0/src/loopmath/harness/tune/isolation.py +677 -0
  56. loopmath-0.4.0/src/loopmath/harness/tune/ledger.py +165 -0
  57. loopmath-0.4.0/src/loopmath/harness/tune/library.py +126 -0
  58. loopmath-0.4.0/src/loopmath/harness/tune/modinstall.py +180 -0
  59. loopmath-0.4.0/src/loopmath/harness/tune/plan.py +378 -0
  60. loopmath-0.4.0/src/loopmath/harness/tune/prompts.py +192 -0
  61. loopmath-0.4.0/src/loopmath/harness/tune/reflect.py +131 -0
  62. loopmath-0.4.0/src/loopmath/harness/tune/schema.py +406 -0
  63. loopmath-0.4.0/src/loopmath/harness/tune/score.py +445 -0
  64. loopmath-0.4.0/src/loopmath/harness/tune/sessions.py +158 -0
  65. loopmath-0.4.0/src/loopmath/harness/tune/skilldoc.py +180 -0
  66. loopmath-0.4.0/src/loopmath/harness/tune/state.py +200 -0
  67. loopmath-0.4.0/src/loopmath/harness/tune/stream.py +320 -0
  68. loopmath-0.4.0/src/loopmath/harness_runs/__init__.py +19 -0
  69. loopmath-0.4.0/src/loopmath/harness_runs/ocp.py +741 -0
  70. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/harness_runs/rows.py +224 -12
  71. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ocp/__init__.py +6 -3
  72. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ocp/canonical.py +69 -8
  73. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ocp/commands.py +3 -2
  74. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ocp/conformance.py +632 -34
  75. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ocp/emit.py +100 -15
  76. loopmath-0.4.0/src/loopmath/ocp/finite.py +93 -0
  77. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ocp/migrate.py +17 -9
  78. loopmath-0.4.0/src/loopmath/ocp/schema/ocp-v0.4.schema.json +2778 -0
  79. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/reduce.py +6 -2
  80. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/show.py +9 -4
  81. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/validate.py +4 -1
  82. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/recommend/commands.py +4 -1
  83. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/skill/commands.py +2 -2
  84. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/skill/guide.py +2 -1
  85. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/skill/guides/fit.md +2 -2
  86. loopmath-0.4.0/src/loopmath/skill/guides/flow.md +409 -0
  87. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/skill/install.py +3 -1
  88. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/skill/skills/loopmath/SKILL.md +2 -1
  89. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/commands.py +148 -27
  90. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/config.py +20 -5
  91. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/finish.py +87 -13
  92. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/home.py +78 -8
  93. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/ids.py +29 -0
  94. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/report.py +6 -3
  95. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/runs.py +70 -0
  96. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/types.py +79 -0
  97. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/posterior.py +12 -6
  98. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/candidates.py +3 -2
  99. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/format.py +75 -6
  100. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/ocp.py +17 -3
  101. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath.egg-info/PKG-INFO +25 -6
  102. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath.egg-info/SOURCES.txt +73 -0
  103. loopmath-0.4.0/tests/test_cli_help_lists.py +72 -0
  104. loopmath-0.4.0/tests/test_harness_tune_cli.py +464 -0
  105. loopmath-0.4.0/tests/test_harness_tune_config.py +386 -0
  106. loopmath-0.4.0/tests/test_harness_tune_delivery.py +139 -0
  107. loopmath-0.4.0/tests/test_harness_tune_design.py +119 -0
  108. loopmath-0.4.0/tests/test_harness_tune_editors.py +479 -0
  109. loopmath-0.4.0/tests/test_harness_tune_edits.py +911 -0
  110. loopmath-0.4.0/tests/test_harness_tune_effects.py +145 -0
  111. loopmath-0.4.0/tests/test_harness_tune_engine.py +944 -0
  112. loopmath-0.4.0/tests/test_harness_tune_executor.py +773 -0
  113. loopmath-0.4.0/tests/test_harness_tune_herdr.py +487 -0
  114. loopmath-0.4.0/tests/test_harness_tune_isolation.py +594 -0
  115. loopmath-0.4.0/tests/test_harness_tune_ledger.py +175 -0
  116. loopmath-0.4.0/tests/test_harness_tune_library.py +257 -0
  117. loopmath-0.4.0/tests/test_harness_tune_modinstall.py +225 -0
  118. loopmath-0.4.0/tests/test_harness_tune_plan.py +287 -0
  119. loopmath-0.4.0/tests/test_harness_tune_score.py +352 -0
  120. loopmath-0.4.0/tests/test_harness_tune_sessions.py +269 -0
  121. loopmath-0.4.0/tests/test_harness_tune_skilldoc.py +72 -0
  122. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_packaging_smoke.py +1 -0
  123. loopmath-0.3.5/src/loopmath/harness_runs/__init__.py +0 -16
  124. loopmath-0.3.5/src/loopmath/harness_runs/ocp.py +0 -425
  125. loopmath-0.3.5/tests/test_cli_help_lists.py +0 -40
  126. {loopmath-0.3.5 → loopmath-0.4.0}/LICENSE +0 -0
  127. {loopmath-0.3.5 → loopmath-0.4.0}/setup.cfg +0 -0
  128. {loopmath-0.3.5 → loopmath-0.4.0}/spec/ocp-v0.2.schema.json +0 -0
  129. {loopmath-0.3.5 → loopmath-0.4.0}/spec/ocp-v0.schema.json +0 -0
  130. {loopmath-0.3.5 → loopmath-0.4.0}/spec/ocp_conformance.py +0 -0
  131. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/__main__.py +0 -0
  132. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapter_host.py +0 -0
  133. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/__init__.py +0 -0
  134. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/atrium.py +0 -0
  135. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/base.py +0 -0
  136. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/bb.py +0 -0
  137. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/bb_support.py +0 -0
  138. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/evolve.py +0 -0
  139. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/harness2.py +0 -0
  140. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/omp.py +0 -0
  141. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/omp_facts.py +0 -0
  142. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/omp_links.py +0 -0
  143. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/omp_parse.py +0 -0
  144. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/omp_types.py +0 -0
  145. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/opencode.py +0 -0
  146. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/opencode_store.py +0 -0
  147. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/openevolve.py +0 -0
  148. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/orca.py +0 -0
  149. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/otel_genai.py +0 -0
  150. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/otel_genai_graph.py +0 -0
  151. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/otel_genai_parse.py +0 -0
  152. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/otel_genai_types.py +0 -0
  153. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/otel_genai_usage.py +0 -0
  154. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/paseo.py +0 -0
  155. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/pi.py +0 -0
  156. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/pi_support.py +0 -0
  157. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/plugin_eval.py +0 -0
  158. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/registry.py +0 -0
  159. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/adapters/shinkaevolve.py +0 -0
  160. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/__init__.py +0 -0
  161. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/block.py +0 -0
  162. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/check_pymc.py +0 -0
  163. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/commands.py +0 -0
  164. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/compose.py +0 -0
  165. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/features.py +0 -0
  166. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/gaussian.py +0 -0
  167. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/integrated.py +0 -0
  168. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/lookahead.py +0 -0
  169. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/pricing.py +0 -0
  170. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/sampled.py +0 -0
  171. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/belief/state.py +0 -0
  172. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/builder/__init__.py +0 -0
  173. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/builder/cli.py +0 -0
  174. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/builder/context.py +0 -0
  175. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/builder/predict.py +0 -0
  176. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/builder/server.py +0 -0
  177. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/cli_errors.py +0 -0
  178. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/cli_graph.py +0 -0
  179. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/cli_support.py +0 -0
  180. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/compare/_thresholds.py +0 -0
  181. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/compare/_thresholds_sw.py +0 -0
  182. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/compare/calibrate.py +0 -0
  183. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/compare/calibration.py +0 -0
  184. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/compare/checks.py +0 -0
  185. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/compare/model.py +0 -0
  186. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/compare/value.py +0 -0
  187. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/e0/__init__.py +0 -0
  188. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/e0/arms.py +0 -0
  189. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/e0/cli_e0.py +0 -0
  190. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/e0/estimate.py +0 -0
  191. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/e0/estimate_rework.py +0 -0
  192. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/e0/figures.py +0 -0
  193. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/e0/io.py +0 -0
  194. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/e0/verb.py +0 -0
  195. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/explain.py +0 -0
  196. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/fit.py +0 -0
  197. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/fit_assembly.py +0 -0
  198. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/fit_bayes.py +0 -0
  199. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/fit_masks.py +0 -0
  200. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/fit_predict.py +0 -0
  201. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/fit_pricing.py +0 -0
  202. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/fit_transfer.py +0 -0
  203. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/gaps.py +0 -0
  204. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/gate/__init__.py +0 -0
  205. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/gate/commands.py +0 -0
  206. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/gate/core.py +0 -0
  207. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/gate/inputs.py +0 -0
  208. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/gate/winner.py +0 -0
  209. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/gate/winner_cli.py +0 -0
  210. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/gate/winner_model.py +0 -0
  211. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/gitwalk.py +0 -0
  212. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/grade.py +0 -0
  213. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/grade_support.py +0 -0
  214. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/__init__.py +0 -0
  215. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/artifact_git.py +0 -0
  216. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/artifact_join.py +0 -0
  217. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/artifact_kinds.py +0 -0
  218. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/artifacts.py +0 -0
  219. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/bashparse.py +0 -0
  220. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/bashread_ops.py +0 -0
  221. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/bashwrite_ops.py +0 -0
  222. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/bashwrites.py +0 -0
  223. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/cache.py +0 -0
  224. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/codexio.py +0 -0
  225. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/codexio_parse.py +0 -0
  226. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/codexio_scan.py +0 -0
  227. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/dataset.py +0 -0
  228. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/dataset_build.py +0 -0
  229. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/dataset_core.py +0 -0
  230. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/dataset_edges.py +0 -0
  231. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/dataset_nodes.py +0 -0
  232. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/extract.py +0 -0
  233. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/html_common.py +0 -0
  234. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/html_costcurve.py +0 -0
  235. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/html_css.py +0 -0
  236. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/html_data.py +0 -0
  237. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/html_force.py +0 -0
  238. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/html_render.py +0 -0
  239. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/html_swimlanes.py +0 -0
  240. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler.py +0 -0
  241. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_cli.py +0 -0
  242. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_common.py +0 -0
  243. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_parse.py +0 -0
  244. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_pricing.py +0 -0
  245. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_prompt.py +0 -0
  246. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_prompt_build.py +0 -0
  247. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_prompt_dispatch.py +0 -0
  248. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_prompt_evidence.py +0 -0
  249. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_prompt_node.py +0 -0
  250. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_prompt_records.py +0 -0
  251. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_prompt_result.py +0 -0
  252. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_prompt_session.py +0 -0
  253. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_prompt_tools.py +0 -0
  254. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_prompt_validation.py +0 -0
  255. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_prompt_workflow.py +0 -0
  256. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_report.py +0 -0
  257. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labeler_score.py +0 -0
  258. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/labels.py +0 -0
  259. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/launch.py +0 -0
  260. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/launch_origin.py +0 -0
  261. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/ocp.py +0 -0
  262. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/ocp_emit.py +0 -0
  263. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/ocp_support.py +0 -0
  264. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/render.py +0 -0
  265. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/runfile.py +0 -0
  266. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/runfile_export.py +0 -0
  267. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/runfile_finish.py +0 -0
  268. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/scan.py +0 -0
  269. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/schema.py +0 -0
  270. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/graph/token_completeness.py +0 -0
  271. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/harness/__init__.py +0 -0
  272. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/harness/layouts.py +0 -0
  273. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/harness_runs/commands.py +0 -0
  274. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/harness_runs/costs.py +0 -0
  275. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/harness_runs/streams.py +0 -0
  276. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ingest/__init__.py +0 -0
  277. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ingest/base.py +0 -0
  278. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ingest/claude_code.py +0 -0
  279. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ingest/claude_code_support.py +0 -0
  280. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ingest/codex.py +0 -0
  281. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ingest/codex_support.py +0 -0
  282. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ingest/ocp.py +0 -0
  283. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ingest/ocp_analysis.py +0 -0
  284. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ingest/ocp_artifact.py +0 -0
  285. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ingest/ocp_common.py +0 -0
  286. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ingest/ocp_convert.py +0 -0
  287. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ingest/ocp_projection.py +0 -0
  288. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/integrations/__init__.py +0 -0
  289. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/integrations/dspy.py +0 -0
  290. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/logmatch/__init__.py +0 -0
  291. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/logmatch/artifacts.py +0 -0
  292. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/logmatch/clip.py +0 -0
  293. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/logmatch/codex_window.py +0 -0
  294. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/logmatch/costs.py +0 -0
  295. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/logmatch/match.py +0 -0
  296. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/logmatch/settle.py +0 -0
  297. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/logmatch/tariff.py +0 -0
  298. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ocp/contractv3.py +0 -0
  299. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ocp/graph_contract.py +0 -0
  300. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ocp/membership.py +0 -0
  301. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ocp/schema/ocp-v0.2.schema.json +0 -0
  302. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ocp/schema/ocp-v0.3.schema.json +0 -0
  303. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ocp/schema/ocp-v0.schema.json +0 -0
  304. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/ocp/version.py +0 -0
  305. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/onboard/__init__.py +0 -0
  306. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/onboard/commands.py +0 -0
  307. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/onboard/history.py +0 -0
  308. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/onboard/label.py +0 -0
  309. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/onboard/usual.py +0 -0
  310. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/output.py +0 -0
  311. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/pool.py +0 -0
  312. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/price.py +0 -0
  313. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/price_validation.py +0 -0
  314. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/prices.toml +0 -0
  315. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/__init__.py +0 -0
  316. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/benchmarks.py +0 -0
  317. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/benchmarks.toml +0 -0
  318. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/build.py +0 -0
  319. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/bundle/README.md +0 -0
  320. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/bundle/e0.jsonl.gz +0 -0
  321. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/bundle/lanes.jsonl.gz +0 -0
  322. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/bundle/manifest.json +0 -0
  323. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/bundle/rq1.jsonl.gz +0 -0
  324. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/bundle/sweep.jsonl.gz +0 -0
  325. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/commands.py +0 -0
  326. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/e0.py +0 -0
  327. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/history.py +0 -0
  328. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/lanes.py +0 -0
  329. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/ocpdoc.py +0 -0
  330. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/registry.py +0 -0
  331. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/rq1.py +0 -0
  332. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/priors/sweep.py +0 -0
  333. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/receipts.py +0 -0
  334. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/recommend/__init__.py +0 -0
  335. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/recommend/backlog.py +0 -0
  336. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/recommend/curve.py +0 -0
  337. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/recommend/engine.py +0 -0
  338. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/recommend/gain.py +0 -0
  339. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/recommend/message.py +0 -0
  340. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/recommend/receipts.py +0 -0
  341. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/recommend/search.py +0 -0
  342. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/recommend/stats.py +0 -0
  343. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/recommend/storeread.py +0 -0
  344. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/recommend/variants.py +0 -0
  345. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/recommend_role.py +0 -0
  346. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/report/__init__.py +0 -0
  347. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/report/eligibility.py +0 -0
  348. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/report/html.py +0 -0
  349. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/report/terminal.py +0 -0
  350. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/report/terminal_exclusions.py +0 -0
  351. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/report/terminal_format.py +0 -0
  352. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/report/terminal_read.py +0 -0
  353. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/research_defaults.py +0 -0
  354. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/research_paths.py +0 -0
  355. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/scoring.py +0 -0
  356. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/scoring_comparisons.py +0 -0
  357. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/scoring_predictive.py +0 -0
  358. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/screen/__init__.py +0 -0
  359. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/screen/commands.py +0 -0
  360. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/screen/design.py +0 -0
  361. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/screen/edits.py +0 -0
  362. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/screen/model.py +0 -0
  363. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/screen/record.py +0 -0
  364. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/share/__init__.py +0 -0
  365. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/share/commands.py +0 -0
  366. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/share/export.py +0 -0
  367. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/share/import_.py +0 -0
  368. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/skill/__init__.py +0 -0
  369. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/skill/doctor.py +0 -0
  370. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/skill/guides/import.md +0 -0
  371. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/skill/guides/onboard.md +0 -0
  372. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/skill/guides/plan.md +0 -0
  373. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/skill/guides/record.md +0 -0
  374. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/skill/guides/reference.md +0 -0
  375. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/__init__.py +0 -0
  376. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/budget.py +0 -0
  377. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/fitjob.py +0 -0
  378. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/lock.py +0 -0
  379. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/record.py +0 -0
  380. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/rule_change.py +0 -0
  381. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/run_names.py +0 -0
  382. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/status.py +0 -0
  383. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/store/verify.py +0 -0
  384. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/surface.py +0 -0
  385. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/surface_bootstrap.py +0 -0
  386. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/surface_estimation.py +0 -0
  387. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/surface_frame.py +0 -0
  388. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/surface_presentation.py +0 -0
  389. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/surface_support.py +0 -0
  390. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/taskmodel.py +0 -0
  391. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/tasks/__init__.py +0 -0
  392. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/tasks/commands.py +0 -0
  393. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/tasks/data.py +0 -0
  394. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/tasks/fit.py +0 -0
  395. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/tasks/posterior.py +0 -0
  396. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/tasks/select.py +0 -0
  397. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/tasks/sim.py +0 -0
  398. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/update.py +0 -0
  399. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/__init__.py +0 -0
  400. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/README.md +0 -0
  401. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/base.css +0 -0
  402. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/builder.css +0 -0
  403. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/builder.html +0 -0
  404. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/builder.js +0 -0
  405. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/common.js +0 -0
  406. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/estimates.css +0 -0
  407. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/estimates.js +0 -0
  408. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/graph.css +0 -0
  409. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/graph.js +0 -0
  410. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/plans.css +0 -0
  411. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/plans.js +0 -0
  412. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/results.css +0 -0
  413. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/results.js +0 -0
  414. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/runs.js +0 -0
  415. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/viz.css +0 -0
  416. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/assets/viz.js +0 -0
  417. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/common.py +0 -0
  418. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/plans.py +0 -0
  419. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/views/runs.py +0 -0
  420. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/__init__.py +0 -0
  421. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/catalog/best_of_n.toml +0 -0
  422. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/catalog/implement_review.toml +0 -0
  423. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/catalog/plan_implement.toml +0 -0
  424. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/catalog/plan_implement_review.toml +0 -0
  425. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/catalog/solo.toml +0 -0
  426. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/catalog/swarm.toml +0 -0
  427. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/commands.py +0 -0
  428. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/diff.py +0 -0
  429. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/graphview.py +0 -0
  430. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/ids.py +0 -0
  431. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/infer.py +0 -0
  432. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/models.py +0 -0
  433. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath/workflows/shapes.py +0 -0
  434. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath.egg-info/dependency_links.txt +0 -0
  435. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath.egg-info/entry_points.txt +0 -0
  436. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath.egg-info/requires.txt +0 -0
  437. {loopmath-0.3.5 → loopmath-0.4.0}/src/loopmath.egg-info/top_level.txt +0 -0
  438. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_adapter_atrium.py +0 -0
  439. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_adapter_bb.py +0 -0
  440. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_adapter_harness2.py +0 -0
  441. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_adapter_omp.py +0 -0
  442. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_adapter_opencode.py +0 -0
  443. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_adapter_opencode_output_tokens.py +0 -0
  444. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_adapter_orca.py +0 -0
  445. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_adapter_otel_genai.py +0 -0
  446. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_adapter_paseo.py +0 -0
  447. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_adapter_services.py +0 -0
  448. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_adapters.py +0 -0
  449. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_adapters_pi.py +0 -0
  450. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_analyze_cli.py +0 -0
  451. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_arms.py +0 -0
  452. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_cli_graph.py +0 -0
  453. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_cli_labeler.py +0 -0
  454. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_cli_main_module.py +0 -0
  455. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_cli_plan_hidden.py +0 -0
  456. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_cli_prices.py +0 -0
  457. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_cli_startup.py +0 -0
  458. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_color_proof.py +0 -0
  459. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_duplicate_guards.py +0 -0
  460. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_estimate.py +0 -0
  461. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_explain.py +0 -0
  462. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_fit.py +0 -0
  463. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_gaps.py +0 -0
  464. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_gitwalk.py +0 -0
  465. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_grade.py +0 -0
  466. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_artifact_recording.py +0 -0
  467. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_artifacts.py +0 -0
  468. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_bashwrites.py +0 -0
  469. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_cache.py +0 -0
  470. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_codexio.py +0 -0
  471. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_dataset.py +0 -0
  472. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_extract.py +0 -0
  473. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_glue.py +0 -0
  474. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_html.py +0 -0
  475. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_labeler.py +0 -0
  476. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_labeler_evidence_matrix.py +0 -0
  477. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_launch.py +0 -0
  478. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_ocp.py +0 -0
  479. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_render.py +0 -0
  480. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_runfile.py +0 -0
  481. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_graph_schema.py +0 -0
  482. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_home_guard.py +0 -0
  483. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_html.py +0 -0
  484. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_ingest.py +0 -0
  485. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_ingest_claude_code.py +0 -0
  486. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_ingest_codex.py +0 -0
  487. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_ingest_ocp.py +0 -0
  488. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_io.py +0 -0
  489. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_not_run_summary.py +0 -0
  490. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_ocp_conformance.py +0 -0
  491. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_ocp_golden.py +0 -0
  492. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_ocp_open_enums.py +0 -0
  493. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_ocp_versioning.py +0 -0
  494. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_output_html_path.py +0 -0
  495. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_packaging_metadata.py +0 -0
  496. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_pool.py +0 -0
  497. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_preview_script.py +0 -0
  498. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_price.py +0 -0
  499. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_receipts.py +0 -0
  500. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_release_paths.py +0 -0
  501. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_report_eligibility.py +0 -0
  502. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_research_cli.py +0 -0
  503. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_runfile_privacy_n1b.py +0 -0
  504. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_scoring.py +0 -0
  505. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_split_rebindings.py +0 -0
  506. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_starting_prior.py +0 -0
  507. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_surface.py +0 -0
  508. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_taskmodel_features.py +0 -0
  509. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_terminal.py +0 -0
  510. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_types_control.py +0 -0
  511. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_types_piece_prediction.py +0 -0
  512. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_update_check.py +0 -0
  513. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_v01_scaffold.py +0 -0
  514. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_v027_p3.py +0 -0
  515. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_v027_small_fixes.py +0 -0
  516. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_v028_sol_6_1.py +0 -0
  517. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_v031_help_labels.py +0 -0
  518. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_v031_json_errors_and_costs.py +0 -0
  519. {loopmath-0.3.5 → loopmath-0.4.0}/tests/test_v031_new_findings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: loopmath
3
- Version: 0.3.5
3
+ Version: 0.4.0
4
4
  Summary: Plan agent workflows, record how they went, and learn from your own Claude Code and Codex logs
5
5
  Author: loopmath
6
6
  License-Expression: MIT
@@ -42,7 +42,7 @@ loopmath helps an orchestrator agent choose how to run a coding task, and learns
42
42
 
43
43
  Before a task, it predicts how the user's usual agent workflow will do: the chance of an accepted result, and the cost in tokens and dollars. It shows the other workflows on a success-cost curve and offers two exploration picks. Each pick comes with its gain on every future similar run, its one-time price, and the number of runs it takes to pay back. After the task, the orchestrator records what ran and what came of it. loopmath fills in the token costs from the Claude Code and Codex logs, writes a receipt of predicted against actual, and refits.
44
44
 
45
- loopmath never starts or coordinates agents. Claude Code, Codex, herdr or your own tool does that; loopmath is a CLI they call. Everything runs locally. loopmath connects to no other machine but pypi.org: `loopmath builder` serves its page on 127.0.0.1 only, and no other command opens a network connection, except the daily update check. Once a day loopmath asks pypi.org whether a newer loopmath exists; it sends only its version and uploads nothing. `LOOPMATH_NO_UPDATE_CHECK=1` turns the check off, and it is off when `CI` is set. The logs are opened read only, and loopmath writes only to its store (`~/.loopmath`, which holds its caches too), to the skill folders `skill install` names, and to paths you name.
45
+ loopmath never starts or coordinates agents, except `loopmath harness` (experimental), which runs Claude Code sessions to tune a repo's harness once you agree to its cost. Otherwise Claude Code, Codex, herdr or your own tool does that; loopmath is a CLI they call. Everything runs locally. loopmath connects to no other machine but pypi.org: `loopmath builder` serves its page on 127.0.0.1 only, and no other command opens a network connection, except the daily update check. Once a day loopmath asks pypi.org whether a newer loopmath exists; it sends only its version and uploads nothing. `LOOPMATH_NO_UPDATE_CHECK=1` turns the check off, and it is off when `CI` is set. A harness tune's sessions are Claude Code sessions, and they call their model as Claude Code does. The logs are opened read only, and loopmath writes only to its store (`~/.loopmath`, which holds its caches too), to the skill folders `skill install` names, and to paths you name.
46
46
 
47
47
  The package installs two commands: `loopmath` and its short alias `loop`. If another `loop` is already on your PATH, use `loopmath`.
48
48
 
@@ -84,6 +84,7 @@ Then ask your agent to onboard, for example "onboard loopmath". The agent runs a
84
84
  | `loopmath guide plan` | "plan a task with loopmath"; which workflow, model or effort to use |
85
85
  | `loopmath guide record` | a task planned with loopmath is done; "record", "log" or "save" a run; both runs of a pair need a blind judge |
86
86
  | `loopmath guide fit` | "update", "refresh" or "rerun" the fit; what loopmath learned; runs imported or recorded without a refit |
87
+ | `loopmath guide flow` | an experiment on a fixed multi-step workflow (a flow): set it up, run its arms, record them, read the verdicts |
87
88
 
88
89
  `loopmath guide` alone lists them, and `loopmath guide reference` prints the command reference they share, with every command, flag and JSON field they use. A guide is read only: it needs no store and writes nothing.
89
90
 
@@ -109,7 +110,7 @@ The dry run makes no labelling call and writes no runs or fit; like `doctor`, it
109
110
 
110
111
  Reading the history uses up to 8 worker processes (one per CPU, at most 8). Set `LOOPMATH_WORKERS=1` to keep everything in one process, or another number to change the count.
111
112
 
112
- loopmath ships with a prior built from our own sweeps and experiments, so `recommend` gives an answer before you have any history. Your own runs then move it.
113
+ loopmath ships with a prior built from our own sweeps and experiments, so `recommend` gives an answer before you have any history. Your own runs then move it. Your store's overall pass rate is its own, with a wide prior that only your runs move: the shipped runs give their costs and gate rows but no success rows, and the public benchmarks say which models are stronger (`belief.level`, `store` by default; `loopmath config set belief.level shared`, then `loopmath fit`, gives 0.3.5's fit).
113
114
 
114
115
  The prior ships inside the package: our runs, in the shared form (no titles, paths, commands or free text), and the published benchmark results. They are the same files we fit with, and each release updates them. `onboard` and the results page say in one line which prior they start from, and `loopmath prior show` lists it source by source.
115
116
 
@@ -158,7 +159,7 @@ A pair runs the goal workflow and an exploration pick from the same base commit,
158
159
 
159
160
  A run counts as a success when it is accepted under your rule. By default that means the task's tests pass. A run that `onboard` brought in from your logs, or that `run import` stored, with no tests verdict but a review or accepted verdict, is judged by the review rule instead: a success when its latest review or accepted verdict is accept, approve or pass. `loopmath runs` lists other finished runs such a verdict could settle, with the command that moves them to the review rule, `loopmath outcome --rule review RUN...`. `loopmath outcome --undo-rule RUN...` undoes that, restoring each run's rule as it was; naming that rule (`tests` when it had none) does too, unless the run's own rule was also named review. A review verdict on a reviewer's last attempt then counts twice: as the review gate's pass, and as the run's success. A rule can also be a score target: `loopmath recommend ... --target 'heldout_perf>=2400'` or `--target 'runtime_s<=200'` gives the expected score and the chance of reaching the target. Set standing rules and other options with `loopmath config set KEY VALUE` (`loopmath config get` lists every key, set or not, `config set` refuses a key loopmath does not read, and `loopmath config unset KEY` returns a key to its default), and the spending cap with `loopmath budget --usd X --period month`. Spend counts your runs and onboard's labelling calls; runs onboard brought in from your logs are shown apart and not counted. A run you record with `--source habit` counts.
160
161
 
161
- Runs recorded by another tool that writes OCP v0.3, such as an experiment runner, come in with `loopmath run import DIR --finish`: several files or a directory, with one refit at the end (`--no-fit` skips it). It says how many runs were new, unchanged or replaced; importing finished runs into a store with no fit starts a fit. Importing the same documents again changes nothing and keeps the outcomes you added since, and with `--finish` it finishes the runs left open (without it, the runs are stored open and it says to import again with `--finish`). A document whose run id is already in the store with different content is refused by name, with the fields that differ; `--replace` takes it and keeps the outcomes added after the import, and refuses a copy that would overwrite one. Runs in your store always count as yours, whatever source their documents name. `loopmath fit --without SOURCE` leaves out one shipped prior source, and `loopmath status` names the options of the current fit.
162
+ Runs recorded by another tool that writes OCP v0.3 (or v0.4, for a run that names a flow or states checks), such as an experiment runner, come in with `loopmath run import DIR --finish`: several files or a directory, with one refit at the end (`--no-fit` skips it). It says how many runs were new, unchanged or replaced; importing finished runs into a store with no fit starts a fit. Importing the same documents again changes nothing and keeps the outcomes you added since, and with `--finish` it finishes the runs left open (without it, the runs are stored open and it says to import again with `--finish`). A document whose run id is already in the store with different content is refused by name, with the fields that differ; `--replace` takes it and keeps the outcomes added after the import, and refuses a copy that would overwrite one. Runs in your store always count as yours, whatever source their documents name. `loopmath fit --without SOURCE` leaves out one shipped prior source, and `loopmath status` names the options of the current fit.
162
163
 
163
164
  ## The three views
164
165
 
@@ -178,16 +179,18 @@ The workflow builder is the one page that is served: `loopmath builder --type bu
178
179
  |---|---|
179
180
  | Plan | `task-types`, `workflows` (list, show, validate, diff), `recommend`, `builder` |
180
181
  | Record | `run` (start, record, import, attempt, artifact, finish, sessions), `outcome`, `budget`, `config` (get, set, unset) |
182
+ | Flows | `flow` (init, show, export, import, plan, next, record, score, status, check) |
181
183
  | Learn | `fit`, `onboard`, `share`, `prior` |
182
184
  | View | `runs`, `posterior`, `status`, `report`, `doctor`, `verify-receipts`, `update` |
183
185
  | Harness testing | `check-change`, `gate` (experimental), `screen` (experimental) |
186
+ | Harness tuning | `harness` (experimental) |
184
187
  | Task subsets | `tasks pick` (experimental) |
185
188
  | Evolution loops | `adapt openevolve` (experimental), `adapt shinkaevolve` (experimental), `recommend --role` (experimental) |
186
189
  | Skill | `skill` (install, uninstall, show), `guide` |
187
190
  | OCP | `ocp` (validate, migrate) |
188
191
  | Log analysis | `analyze`, `graph`, `adapt`, `prices`, `validate-prices` |
189
192
 
190
- These are experimental: `gate`, `screen`, `tasks pick`, the harness-part estimates (`recommend --harness-variants` and `--harness`, `posterior --level harness` and its `factors`), `recommend --role`, `adapt harness2`, `adapt plugin-eval`, `adapt openevolve`, `adapt shinkaevolve` and the ADE adapters (`adapt NAME`). Each works and has tests, but has had little use on real work so far, and its output may change. Their help says so too. The gate at DSPy's GEPA and MIPROv2 accept step (`loopmath.integrations.dspy`, Python) is experimental too: it is tested against fakes written from their source, not yet with DSPy installed, and its guide says so. So is the opt-in cost model for arms that mix models, `loopmath.compare.model.COST_MODEL = "sw"`, a Python setting with no help of its own; the [changelog](CHANGELOG.md) describes it.
193
+ These are experimental: `harness`, `gate`, `screen`, `tasks pick`, the harness-part estimates (`recommend --harness-variants` and `--harness`, `posterior --level harness` and its `factors`), `recommend --role`, `adapt harness2`, `adapt plugin-eval`, `adapt openevolve`, `adapt shinkaevolve` and the ADE adapters (`adapt NAME`). Each works and has tests, but has had little use on real work so far, and its output may change. Their help says so too. The gate at DSPy's GEPA and MIPROv2 accept step (`loopmath.integrations.dspy`, Python) is experimental too: it is tested against fakes written from their source, not yet with DSPy installed, and its guide says so. So is the opt-in cost model for arms that mix models, `loopmath.compare.model.COST_MODEL = "sw"`, a Python setting with no help of its own; the [changelog](CHANGELOG.md) describes it.
191
194
 
192
195
  Each command prints a short summary by default. With `--json`, it prints exactly one JSON object instead. One exception: `loopmath adapt harness2`, `adapt harness-runs`, `adapt plugin-eval`, `adapt openevolve` and `adapt shinkaevolve` without `--out` print the run documents on stdout, one per line, so their `--json` summary goes to stderr. Exit codes: 0 ok, 1 user error, 2 not found, 3 not implemented, 4 store locked, 5 no fit yet. For flags, `loopmath <command> --help` is the source of truth. Commands, pages and the `runs` table show times in your local time with the zone; the store and `--json` keep UTC. A cost under a cent shows one significant digit (`$0.004`), and an exact zero is `$0`.
193
196
 
@@ -289,6 +292,21 @@ These commands are for changing the harness your agents run with and finding out
289
292
  - **DSPy's GEPA and MIPROv2 (experimental).** An optimizer's accept step keeps a new prompt when its score on a few instances goes up, and on 3 instances that keeps many children that are no better. `loopmath.integrations.dspy` puts the gate there: `GEPAAcceptance` is a GEPA acceptance criterion (run GEPA with `use_merge=False`), `MIPROv2Gate` confirms MIPROv2's replacements, and `run([], [], more)` gates any compiled program against its student. It imports neither dspy nor gepa. See [the DSPy guide](docs/dspy.md).
290
293
  - **`tasks pick` (experimental).** For a loop or a benchmark run that scores each candidate on some of a suite's tasks instead of all of them. `loopmath tasks pick --candidate SEL` reads the finished runs in the store, or `--runs FILE`, learns each task's difficulty and discrimination from the other arms' runs on it, and prints the candidate's suite score so far (the mean over the suite of its chance of acceptance per task) with 80% and 95% ranges, whether to stop, and the next task to run. From a store it writes that task's file and the `run record --task-file F --label KEY=VALUE --home PATH` line that records the run in the same store, so the next call sees it. It stops when the 80% range is as narrow as one full run of the suite would give (`--halfwidth` sets another target), or, with `--versus X` or `--versus-arm SEL`, when the score is above or below a number or another arm's at `--level`. `--method` chooses the next task: the largest expected cut in the score's variance (`loss`, the default), information, one fixed order, random, or stratified by predicted rate. The default learns fastest when the candidate behaves like the arms in the history; for a candidate unlike all of them (a new model rather than a change to a known one's harness), `--method stratified` or `random` keeps the ranges closer to honest at the cost of more sessions. A candidate that scores below every arm in the history (a broken setup, say) is estimated too high by every method, and its ranges can miss even at the full suite; under `--method random` the accepted count over the sessions, which every call prints, is the check. Every estimate prints both warnings, in text and in `--json` (`estimate.warnings`). With `--versus`, a bar within about 0.01 of the candidate's score is close to a coin toss for any method; to ask whether a change helps by at least some margin, pass the bar plus that margin. The ranges are approximate: they leave out the history fit's own error shared with other arms. `loopmath tasks pick --help` lists the rest.
291
294
 
295
+ ## Tune a Claude Code harness
296
+
297
+ `loopmath harness` (experimental) tunes a repo's Claude Code harness (CLAUDE.md, skills and agents) on a task you run again and again: editor sessions propose edits, a screening design of task runs measures each one, and the kept edits are delivered only when they beat the base. It follows the design measured in stream 1 of our harness2 study; this release has not been measured on its own yet. Every session spends model calls, so `plan` prices the tune before any runs:
298
+
299
+ ```
300
+ loopmath harness init # loopmath-harness.toml, one comment per field
301
+ loopmath harness config set task.prompt "add a --json flag to the export command"
302
+ loopmath harness plan # no model call; on the defaults: cost: 2.72 USD (1.72 to 6.38)
303
+ loopmath harness run --detach --yes # prints the tune id; the engine runs on in its own session
304
+ loopmath harness watch # follow the events to the end
305
+ loopmath harness apply --dry-run # the files it would write; `apply` writes them and commits nothing
306
+ ```
307
+
308
+ Every config field has a flag (`--budget-usd 6`), and `loopmath harness skill` prints the guide an agent follows to drive these commands. In Claude Code, `loopmath harness mod install` adds `/harness`: a pane to configure, plan and start a tune, and a line above the prompt while it runs. The [harness guide](docs/harness.md) has the fields, the events and the isolation.
309
+
292
310
  ## Does my plugin pay?
293
311
 
294
312
  `claude plugin eval` grades a plugin's eval cases with and without the plugin. `adapt plugin-eval` (experimental) reads its result, and loopmath turns the per-case deltas into a decision: adopt, reject, or run more, with ranges on the gain and, given each run's cost with `--cost-from`, on cost per accepted result. It reads the file only and never runs Claude Code.
@@ -306,7 +324,7 @@ Runs of one case are not new tasks: to learn whether the plugin helps on tasks l
306
324
 
307
325
  The store is `~/.loopmath`. Set `LOOPMATH_HOME` or pass `--home` to put it elsewhere; the log parse cache moves with it, to `cache/` inside the store, unless you set `LOOPMATH_CACHE_DIR`. It holds:
308
326
 
309
- - one OCP v0.3 document per recorded run;
327
+ - one OCP document per recorded run: v0.3, or v0.4 for a run that names a flow or states checks;
310
328
  - signals, receipts and fits;
311
329
  - your config and your workflows;
312
330
  - the views you write;
@@ -343,6 +361,7 @@ loopmath graph --workspace NAME --format html --out graph.html
343
361
  - [OpenEvolve and ShinkaEvolve runs](docs/adapters.md#openevolve-and-shinkaevolve): `adapt openevolve`, `adapt shinkaevolve` and `recommend --role`, which model to give an evolution loop's mutator
344
362
  - [Release policy](docs/release.md)
345
363
  - [Screening harness edits](docs/screen.md): `screen`, with a worked 48-session example and its limits
364
+ - [Tuning a Claude Code harness](docs/harness.md): `loopmath harness`, the `/harness` mod and the herdr runner
346
365
  - [Packaged model prices](src/loopmath/prices.toml)
347
366
 
348
367
  ## License
@@ -4,7 +4,7 @@ loopmath helps an orchestrator agent choose how to run a coding task, and learns
4
4
 
5
5
  Before a task, it predicts how the user's usual agent workflow will do: the chance of an accepted result, and the cost in tokens and dollars. It shows the other workflows on a success-cost curve and offers two exploration picks. Each pick comes with its gain on every future similar run, its one-time price, and the number of runs it takes to pay back. After the task, the orchestrator records what ran and what came of it. loopmath fills in the token costs from the Claude Code and Codex logs, writes a receipt of predicted against actual, and refits.
6
6
 
7
- loopmath never starts or coordinates agents. Claude Code, Codex, herdr or your own tool does that; loopmath is a CLI they call. Everything runs locally. loopmath connects to no other machine but pypi.org: `loopmath builder` serves its page on 127.0.0.1 only, and no other command opens a network connection, except the daily update check. Once a day loopmath asks pypi.org whether a newer loopmath exists; it sends only its version and uploads nothing. `LOOPMATH_NO_UPDATE_CHECK=1` turns the check off, and it is off when `CI` is set. The logs are opened read only, and loopmath writes only to its store (`~/.loopmath`, which holds its caches too), to the skill folders `skill install` names, and to paths you name.
7
+ loopmath never starts or coordinates agents, except `loopmath harness` (experimental), which runs Claude Code sessions to tune a repo's harness once you agree to its cost. Otherwise Claude Code, Codex, herdr or your own tool does that; loopmath is a CLI they call. Everything runs locally. loopmath connects to no other machine but pypi.org: `loopmath builder` serves its page on 127.0.0.1 only, and no other command opens a network connection, except the daily update check. Once a day loopmath asks pypi.org whether a newer loopmath exists; it sends only its version and uploads nothing. `LOOPMATH_NO_UPDATE_CHECK=1` turns the check off, and it is off when `CI` is set. A harness tune's sessions are Claude Code sessions, and they call their model as Claude Code does. The logs are opened read only, and loopmath writes only to its store (`~/.loopmath`, which holds its caches too), to the skill folders `skill install` names, and to paths you name.
8
8
 
9
9
  The package installs two commands: `loopmath` and its short alias `loop`. If another `loop` is already on your PATH, use `loopmath`.
10
10
 
@@ -46,6 +46,7 @@ Then ask your agent to onboard, for example "onboard loopmath". The agent runs a
46
46
  | `loopmath guide plan` | "plan a task with loopmath"; which workflow, model or effort to use |
47
47
  | `loopmath guide record` | a task planned with loopmath is done; "record", "log" or "save" a run; both runs of a pair need a blind judge |
48
48
  | `loopmath guide fit` | "update", "refresh" or "rerun" the fit; what loopmath learned; runs imported or recorded without a refit |
49
+ | `loopmath guide flow` | an experiment on a fixed multi-step workflow (a flow): set it up, run its arms, record them, read the verdicts |
49
50
 
50
51
  `loopmath guide` alone lists them, and `loopmath guide reference` prints the command reference they share, with every command, flag and JSON field they use. A guide is read only: it needs no store and writes nothing.
51
52
 
@@ -71,7 +72,7 @@ The dry run makes no labelling call and writes no runs or fit; like `doctor`, it
71
72
 
72
73
  Reading the history uses up to 8 worker processes (one per CPU, at most 8). Set `LOOPMATH_WORKERS=1` to keep everything in one process, or another number to change the count.
73
74
 
74
- loopmath ships with a prior built from our own sweeps and experiments, so `recommend` gives an answer before you have any history. Your own runs then move it.
75
+ loopmath ships with a prior built from our own sweeps and experiments, so `recommend` gives an answer before you have any history. Your own runs then move it. Your store's overall pass rate is its own, with a wide prior that only your runs move: the shipped runs give their costs and gate rows but no success rows, and the public benchmarks say which models are stronger (`belief.level`, `store` by default; `loopmath config set belief.level shared`, then `loopmath fit`, gives 0.3.5's fit).
75
76
 
76
77
  The prior ships inside the package: our runs, in the shared form (no titles, paths, commands or free text), and the published benchmark results. They are the same files we fit with, and each release updates them. `onboard` and the results page say in one line which prior they start from, and `loopmath prior show` lists it source by source.
77
78
 
@@ -120,7 +121,7 @@ A pair runs the goal workflow and an exploration pick from the same base commit,
120
121
 
121
122
  A run counts as a success when it is accepted under your rule. By default that means the task's tests pass. A run that `onboard` brought in from your logs, or that `run import` stored, with no tests verdict but a review or accepted verdict, is judged by the review rule instead: a success when its latest review or accepted verdict is accept, approve or pass. `loopmath runs` lists other finished runs such a verdict could settle, with the command that moves them to the review rule, `loopmath outcome --rule review RUN...`. `loopmath outcome --undo-rule RUN...` undoes that, restoring each run's rule as it was; naming that rule (`tests` when it had none) does too, unless the run's own rule was also named review. A review verdict on a reviewer's last attempt then counts twice: as the review gate's pass, and as the run's success. A rule can also be a score target: `loopmath recommend ... --target 'heldout_perf>=2400'` or `--target 'runtime_s<=200'` gives the expected score and the chance of reaching the target. Set standing rules and other options with `loopmath config set KEY VALUE` (`loopmath config get` lists every key, set or not, `config set` refuses a key loopmath does not read, and `loopmath config unset KEY` returns a key to its default), and the spending cap with `loopmath budget --usd X --period month`. Spend counts your runs and onboard's labelling calls; runs onboard brought in from your logs are shown apart and not counted. A run you record with `--source habit` counts.
122
123
 
123
- Runs recorded by another tool that writes OCP v0.3, such as an experiment runner, come in with `loopmath run import DIR --finish`: several files or a directory, with one refit at the end (`--no-fit` skips it). It says how many runs were new, unchanged or replaced; importing finished runs into a store with no fit starts a fit. Importing the same documents again changes nothing and keeps the outcomes you added since, and with `--finish` it finishes the runs left open (without it, the runs are stored open and it says to import again with `--finish`). A document whose run id is already in the store with different content is refused by name, with the fields that differ; `--replace` takes it and keeps the outcomes added after the import, and refuses a copy that would overwrite one. Runs in your store always count as yours, whatever source their documents name. `loopmath fit --without SOURCE` leaves out one shipped prior source, and `loopmath status` names the options of the current fit.
124
+ Runs recorded by another tool that writes OCP v0.3 (or v0.4, for a run that names a flow or states checks), such as an experiment runner, come in with `loopmath run import DIR --finish`: several files or a directory, with one refit at the end (`--no-fit` skips it). It says how many runs were new, unchanged or replaced; importing finished runs into a store with no fit starts a fit. Importing the same documents again changes nothing and keeps the outcomes you added since, and with `--finish` it finishes the runs left open (without it, the runs are stored open and it says to import again with `--finish`). A document whose run id is already in the store with different content is refused by name, with the fields that differ; `--replace` takes it and keeps the outcomes added after the import, and refuses a copy that would overwrite one. Runs in your store always count as yours, whatever source their documents name. `loopmath fit --without SOURCE` leaves out one shipped prior source, and `loopmath status` names the options of the current fit.
124
125
 
125
126
  ## The three views
126
127
 
@@ -140,16 +141,18 @@ The workflow builder is the one page that is served: `loopmath builder --type bu
140
141
  |---|---|
141
142
  | Plan | `task-types`, `workflows` (list, show, validate, diff), `recommend`, `builder` |
142
143
  | Record | `run` (start, record, import, attempt, artifact, finish, sessions), `outcome`, `budget`, `config` (get, set, unset) |
144
+ | Flows | `flow` (init, show, export, import, plan, next, record, score, status, check) |
143
145
  | Learn | `fit`, `onboard`, `share`, `prior` |
144
146
  | View | `runs`, `posterior`, `status`, `report`, `doctor`, `verify-receipts`, `update` |
145
147
  | Harness testing | `check-change`, `gate` (experimental), `screen` (experimental) |
148
+ | Harness tuning | `harness` (experimental) |
146
149
  | Task subsets | `tasks pick` (experimental) |
147
150
  | Evolution loops | `adapt openevolve` (experimental), `adapt shinkaevolve` (experimental), `recommend --role` (experimental) |
148
151
  | Skill | `skill` (install, uninstall, show), `guide` |
149
152
  | OCP | `ocp` (validate, migrate) |
150
153
  | Log analysis | `analyze`, `graph`, `adapt`, `prices`, `validate-prices` |
151
154
 
152
- These are experimental: `gate`, `screen`, `tasks pick`, the harness-part estimates (`recommend --harness-variants` and `--harness`, `posterior --level harness` and its `factors`), `recommend --role`, `adapt harness2`, `adapt plugin-eval`, `adapt openevolve`, `adapt shinkaevolve` and the ADE adapters (`adapt NAME`). Each works and has tests, but has had little use on real work so far, and its output may change. Their help says so too. The gate at DSPy's GEPA and MIPROv2 accept step (`loopmath.integrations.dspy`, Python) is experimental too: it is tested against fakes written from their source, not yet with DSPy installed, and its guide says so. So is the opt-in cost model for arms that mix models, `loopmath.compare.model.COST_MODEL = "sw"`, a Python setting with no help of its own; the [changelog](CHANGELOG.md) describes it.
155
+ These are experimental: `harness`, `gate`, `screen`, `tasks pick`, the harness-part estimates (`recommend --harness-variants` and `--harness`, `posterior --level harness` and its `factors`), `recommend --role`, `adapt harness2`, `adapt plugin-eval`, `adapt openevolve`, `adapt shinkaevolve` and the ADE adapters (`adapt NAME`). Each works and has tests, but has had little use on real work so far, and its output may change. Their help says so too. The gate at DSPy's GEPA and MIPROv2 accept step (`loopmath.integrations.dspy`, Python) is experimental too: it is tested against fakes written from their source, not yet with DSPy installed, and its guide says so. So is the opt-in cost model for arms that mix models, `loopmath.compare.model.COST_MODEL = "sw"`, a Python setting with no help of its own; the [changelog](CHANGELOG.md) describes it.
153
156
 
154
157
  Each command prints a short summary by default. With `--json`, it prints exactly one JSON object instead. One exception: `loopmath adapt harness2`, `adapt harness-runs`, `adapt plugin-eval`, `adapt openevolve` and `adapt shinkaevolve` without `--out` print the run documents on stdout, one per line, so their `--json` summary goes to stderr. Exit codes: 0 ok, 1 user error, 2 not found, 3 not implemented, 4 store locked, 5 no fit yet. For flags, `loopmath <command> --help` is the source of truth. Commands, pages and the `runs` table show times in your local time with the zone; the store and `--json` keep UTC. A cost under a cent shows one significant digit (`$0.004`), and an exact zero is `$0`.
155
158
 
@@ -251,6 +254,21 @@ These commands are for changing the harness your agents run with and finding out
251
254
  - **DSPy's GEPA and MIPROv2 (experimental).** An optimizer's accept step keeps a new prompt when its score on a few instances goes up, and on 3 instances that keeps many children that are no better. `loopmath.integrations.dspy` puts the gate there: `GEPAAcceptance` is a GEPA acceptance criterion (run GEPA with `use_merge=False`), `MIPROv2Gate` confirms MIPROv2's replacements, and `run([], [], more)` gates any compiled program against its student. It imports neither dspy nor gepa. See [the DSPy guide](docs/dspy.md).
252
255
  - **`tasks pick` (experimental).** For a loop or a benchmark run that scores each candidate on some of a suite's tasks instead of all of them. `loopmath tasks pick --candidate SEL` reads the finished runs in the store, or `--runs FILE`, learns each task's difficulty and discrimination from the other arms' runs on it, and prints the candidate's suite score so far (the mean over the suite of its chance of acceptance per task) with 80% and 95% ranges, whether to stop, and the next task to run. From a store it writes that task's file and the `run record --task-file F --label KEY=VALUE --home PATH` line that records the run in the same store, so the next call sees it. It stops when the 80% range is as narrow as one full run of the suite would give (`--halfwidth` sets another target), or, with `--versus X` or `--versus-arm SEL`, when the score is above or below a number or another arm's at `--level`. `--method` chooses the next task: the largest expected cut in the score's variance (`loss`, the default), information, one fixed order, random, or stratified by predicted rate. The default learns fastest when the candidate behaves like the arms in the history; for a candidate unlike all of them (a new model rather than a change to a known one's harness), `--method stratified` or `random` keeps the ranges closer to honest at the cost of more sessions. A candidate that scores below every arm in the history (a broken setup, say) is estimated too high by every method, and its ranges can miss even at the full suite; under `--method random` the accepted count over the sessions, which every call prints, is the check. Every estimate prints both warnings, in text and in `--json` (`estimate.warnings`). With `--versus`, a bar within about 0.01 of the candidate's score is close to a coin toss for any method; to ask whether a change helps by at least some margin, pass the bar plus that margin. The ranges are approximate: they leave out the history fit's own error shared with other arms. `loopmath tasks pick --help` lists the rest.
253
256
 
257
+ ## Tune a Claude Code harness
258
+
259
+ `loopmath harness` (experimental) tunes a repo's Claude Code harness (CLAUDE.md, skills and agents) on a task you run again and again: editor sessions propose edits, a screening design of task runs measures each one, and the kept edits are delivered only when they beat the base. It follows the design measured in stream 1 of our harness2 study; this release has not been measured on its own yet. Every session spends model calls, so `plan` prices the tune before any runs:
260
+
261
+ ```
262
+ loopmath harness init # loopmath-harness.toml, one comment per field
263
+ loopmath harness config set task.prompt "add a --json flag to the export command"
264
+ loopmath harness plan # no model call; on the defaults: cost: 2.72 USD (1.72 to 6.38)
265
+ loopmath harness run --detach --yes # prints the tune id; the engine runs on in its own session
266
+ loopmath harness watch # follow the events to the end
267
+ loopmath harness apply --dry-run # the files it would write; `apply` writes them and commits nothing
268
+ ```
269
+
270
+ Every config field has a flag (`--budget-usd 6`), and `loopmath harness skill` prints the guide an agent follows to drive these commands. In Claude Code, `loopmath harness mod install` adds `/harness`: a pane to configure, plan and start a tune, and a line above the prompt while it runs. The [harness guide](docs/harness.md) has the fields, the events and the isolation.
271
+
254
272
  ## Does my plugin pay?
255
273
 
256
274
  `claude plugin eval` grades a plugin's eval cases with and without the plugin. `adapt plugin-eval` (experimental) reads its result, and loopmath turns the per-case deltas into a decision: adopt, reject, or run more, with ranges on the gain and, given each run's cost with `--cost-from`, on cost per accepted result. It reads the file only and never runs Claude Code.
@@ -268,7 +286,7 @@ Runs of one case are not new tasks: to learn whether the plugin helps on tasks l
268
286
 
269
287
  The store is `~/.loopmath`. Set `LOOPMATH_HOME` or pass `--home` to put it elsewhere; the log parse cache moves with it, to `cache/` inside the store, unless you set `LOOPMATH_CACHE_DIR`. It holds:
270
288
 
271
- - one OCP v0.3 document per recorded run;
289
+ - one OCP document per recorded run: v0.3, or v0.4 for a run that names a flow or states checks;
272
290
  - signals, receipts and fits;
273
291
  - your config and your workflows;
274
292
  - the views you write;
@@ -305,6 +323,7 @@ loopmath graph --workspace NAME --format html --out graph.html
305
323
  - [OpenEvolve and ShinkaEvolve runs](docs/adapters.md#openevolve-and-shinkaevolve): `adapt openevolve`, `adapt shinkaevolve` and `recommend --role`, which model to give an evolution loop's mutator
306
324
  - [Release policy](docs/release.md)
307
325
  - [Screening harness edits](docs/screen.md): `screen`, with a worked 48-session example and its limits
326
+ - [Tuning a Claude Code harness](docs/harness.md): `loopmath harness`, the `/harness` mod and the herdr runner
308
327
  - [Packaged model prices](src/loopmath/prices.toml)
309
328
 
310
329
  ## License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "loopmath"
7
- version = "0.3.5"
7
+ version = "0.4.0"
8
8
  description = "Plan agent workflows, record how they went, and learn from your own Claude Code and Codex logs"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -94,6 +94,14 @@ loopmath = [
94
94
  "priors/bundle/*",
95
95
  "views/assets/*",
96
96
  "ocp/schema/*.json",
97
+ "harness/mod/loopmath-harness/README.md",
98
+ "harness/mod/loopmath-harness/.gitignore",
99
+ "harness/mod/loopmath-harness/.claude-plugin/*.json",
100
+ "harness/mod/loopmath-harness/hooks/*.json",
101
+ "harness/mod/loopmath-harness/hooks/*.ts",
102
+ "harness/mod/loopmath-harness/hooks/*.tsx",
103
+ "harness/mod/loopmath-harness/types/*.d.ts",
104
+ "harness/herdr/loopmath-harness/*.toml",
97
105
  ]
98
106
 
99
107
  [tool.setuptools.data-files]
@@ -5,4 +5,4 @@ The command line (`loopmath`, or its alias `loop`) is the interface; see the
5
5
  README and `loopmath --help`.
6
6
  """
7
7
 
8
- __version__ = "0.3.5"
8
+ __version__ = "0.4.0"
@@ -16,7 +16,7 @@ import json
16
16
  import math
17
17
  from collections.abc import Iterable, Mapping
18
18
  from dataclasses import dataclass, field
19
- from datetime import datetime
19
+ from datetime import datetime, timedelta
20
20
  from functools import lru_cache
21
21
  from typing import Any, Sequence
22
22
 
@@ -40,7 +40,11 @@ OPT_IN_DESIGN_VERSION = 5
40
40
  # The model options this loopmath's `fit` writes, each with the values it writes there (unset or `eb` writes
41
41
  # version 4, with no options). A version 5 fit with any other key or value was made by a loopmath with an option
42
42
  # this one has no nodes for: it is refused, as 0.3.1 refuses version 5, rather than read without them.
43
- MODEL_OPTIONS: dict[str, tuple[Any, ...]] = {"belief.success_head": ("sampled",)}
43
+ MODEL_OPTIONS: dict[str, tuple[Any, ...]] = {"belief.success_head": ("sampled",),
44
+ # the store level and benchmark transfer (level.py)
45
+ "belief.level": ("shared", "store"),
46
+ "belief.shipped_success": ("keep", "drop"),
47
+ "belief.benchmark_factors": ("reference", "offset")}
44
48
  # The version the seed key hashes (spec 04 section 3). It stays 3 from 0.2.8: the same data seeds the same
45
49
  # draws as in 0.2.7, so every number that is not a token count is 0.2.7's.
46
50
  SEED_VERSION = 3
@@ -200,6 +204,27 @@ def role_terms(role: str, model: str, weight: float = 1.0) -> tuple[Term, ...]:
200
204
  return ((f"role:{role}", None, weight), (f"role_family:{role}|{fam}", f"role:{role}", weight))
201
205
 
202
206
 
207
+ def _step_key(text: str) -> str:
208
+ return text.replace("%", "%25").replace("#", "%23").replace("|", "%7C")
209
+
210
+
211
+ def step_node(flow: str, piece: str, family: str) -> str:
212
+ """The node of a flow's piece on a model family (SPEC 3.10): `step:<flow>#<piece>|<family>`, with `%`, `#` and
213
+ `|` in the flow and piece ids written `%25`, `%23` and `%7C`, so two (flow, piece) pairs never share a node.
214
+ Ids without those characters read as written."""
215
+ return f"step:{_step_key(flow)}#{_step_key(piece)}|{family}"
216
+
217
+
218
+ @lru_cache(maxsize=65536)
219
+ def step_terms(flow: str, piece: str, role: str, model: str, weight: float = 1.0) -> tuple[Term, ...]:
220
+ """The step term of a flow run's piece, a child of the piece's `role_family` node (`role_terms`), at that
221
+ node's weight. Empty outside a flow (`flow` empty), so a run without `run.flow` keeps its rows."""
222
+ if not flow:
223
+ return ()
224
+ fam = model_path(model)[1]
225
+ return ((step_node(flow, piece, fam), f"role_family:{role}|{fam}", weight),)
226
+
227
+
203
228
  def _s(setting: Setting) -> tuple[str, str, str]:
204
229
  return (setting.harness or "unknown", canonical_model_id(setting.model), (setting.effort or "default").lower())
205
230
 
@@ -232,6 +257,7 @@ class Structure:
232
257
  shape: str = "" # topology and position key (`shape_key`); empty means the workflow id
233
258
  copies: dict[str, int] = field(default_factory=dict) # piece -> copies in its group (`copy_groups`)
234
259
  factors: tuple[str, ...] = () # the run's harness factors, sorted (`spec/harness.md`); () without a record
260
+ flow: str = "" # the run's flow id (`run.flow.id`), for the step terms (SPEC 3.10); empty outside a flow
235
261
 
236
262
 
237
263
  def topological_pieces(workflow: Workflow) -> list[str]:
@@ -315,8 +341,9 @@ def default_gate_rule(role: str) -> str:
315
341
  return {"reviewer": "review_approve", "tester": "tests_pass", "referee": "referee_pick"}.get(role, "gate")
316
342
 
317
343
 
318
- def structure(config: Configuration, factors: Iterable[str] = ()) -> Structure:
319
- """The configuration's structure; `factors` are the harness factors every piece runs with (sorted, unique)."""
344
+ def structure(config: Configuration, factors: Iterable[str] = (), flow: str | None = None) -> Structure:
345
+ """The configuration's structure; `factors` are the harness factors every piece runs with (sorted, unique), and
346
+ `flow` the run's flow id (`ParsedRun.flow`; None outside a flow)."""
320
347
  wf = config.workflow
321
348
  order = topological_pieces(wf)
322
349
  roles = {p.id: canonical_role(p.role) for p in wf.pieces}
@@ -362,7 +389,8 @@ def structure(config: Configuration, factors: Iterable[str] = ()) -> Structure:
362
389
  for i in gidx:
363
390
  gate_loop[i] = len(loops) - 1
364
391
  return Structure(wf.id, order, roles, settings, widths, gates, loops, k_max, piece_loop, gate_loop,
365
- shape_key(wf.id, roles.values()), copy_groups(order, roles, reach), tuple(sorted(set(factors))))
392
+ shape_key(wf.id, roles.values()), copy_groups(order, roles, reach), tuple(sorted(set(factors))),
393
+ flow or "")
366
394
 
367
395
 
368
396
  # ---------------------------------------------------------------- rows
@@ -384,12 +412,12 @@ def _effort_scaled(terms: tuple[Term, ...], weight: float) -> tuple[Term, ...]:
384
412
  def cost_rest(st: Structure, piece: str, k: int, setting: Setting | None = None, *,
385
413
  source: str | None = None, effort: float = 1.0,
386
414
  prices: Mapping[str, float] | None = None) -> tuple[Term, ...]:
387
- """Cost and tokens rows without the task part: setting, role, topology, position, round, control,
388
- and with a `source` the position x source node `psrc:<shape>#<pos>|<source>` and the family x source
389
- node `fsrc:<family>|<source>` (spec 04 section 1); the structure's harness factors under the piece's
390
- harness, at 1 (`factor_terms`). `effort` is the value of the terms a timebox caps, the
391
- effort and shape (topology, position) terms (`effort_weight`: below 1 under a timebox); the role, psrc and
392
- fsrc terms stay at 1. `prices` is a fit's price offsets (`FitState.price_offsets`, spec 04 section 2): the
415
+ """Cost and tokens rows without the task part: setting, role (and in a flow run its step term, `step_terms`),
416
+ topology, position, round, control, and with a `source` the position x source node
417
+ `psrc:<shape>#<pos>|<source>` and the family x source node `fsrc:<family>|<source>` (spec 04 section 1); the
418
+ structure's harness factors under the piece's harness, at 1 (`factor_terms`). `effort` is the value of the
419
+ terms a timebox caps, the effort and shape (topology, position) terms (`effort_weight`: below 1 under a
420
+ timebox); the role, step, psrc and fsrc terms stay at 1. `prices` is a fit's price offsets (`FitState.price_offsets`, spec 04 section 2): the
393
421
  model's `price:offset` term goes last. The cost head has that node and the tokens head does not, so a
394
422
  prediction's shared row prices only its cost."""
395
423
  s = setting or st.settings[piece]
@@ -400,7 +428,8 @@ def cost_rest(st: Structure, piece: str, k: int, setting: Setting | None = None,
400
428
  shape_terms = ((f"topology:{shape}", None, 1.0), (f"position:{position}", f"topology:{shape}", 1.0))
401
429
  if effort != 1.0:
402
430
  st_terms, shape_terms = _effort_scaled(st_terms, float(effort)), _effort_scaled(shape_terms, float(effort))
403
- terms = st_terms + role_terms(st.roles[piece], m) + shape_terms
431
+ role = st.roles[piece]
432
+ terms = st_terms + role_terms(role, m) + step_terms(st.flow, piece, role, m) + shape_terms
404
433
  if st.factors:
405
434
  terms += factor_terms(h, st.factors)
406
435
  if source is not None:
@@ -412,17 +441,19 @@ def cost_rest(st: Structure, piece: str, k: int, setting: Setting | None = None,
412
441
 
413
442
 
414
443
  def gate_rest(st: Structure, gate: GateInfo, k: int) -> tuple[Term, ...]:
415
- """Gate rows without the task part: gate rule, round, and the judged piece's setting and role."""
444
+ """Gate rows without the task part: gate rule, round, and the judged piece's setting and role, with its step
445
+ term in a flow run (`step_terms`)."""
416
446
  h, m, e = _s(st.settings[gate.judged])
447
+ role = st.roles[gate.judged]
417
448
  return (((f"gate:{gate.rule}", None, 1.0),) + tuple(round_terms(k)) + setting_terms(h, m, e, 1.0, False)
418
- + role_terms(st.roles[gate.judged], m))
449
+ + role_terms(role, m) + step_terms(st.flow, gate.judged, role, m))
419
450
 
420
451
 
421
452
  def run_rest(st: Structure) -> tuple[Term, ...]:
422
453
  """Success and score rows without the task part: topology, control, and per piece its model chain,
423
454
  effort and harness (weight 1/n) with its harness factors at that weight, plus its role and role x family
424
455
  (weight 1/g, g the copies in its group, so parallel copies carry the role effect once, as one wide piece
425
- does)."""
456
+ does), and in a flow run its step term at the role x family weight (`step_terms`)."""
426
457
  terms: list[Term] = [(f"topology:{st.shape or st.workflow_id}", None, 1.0)]
427
458
  terms += _control_terms(st.k_max, max(st.widths.values() or [1]))
428
459
  n = max(1, len(st.pieces))
@@ -431,7 +462,8 @@ def run_rest(st: Structure) -> tuple[Term, ...]:
431
462
  terms += setting_terms(h, m, e, 1.0 / n)
432
463
  if st.factors:
433
464
  terms += factor_terms(h, st.factors, 1.0 / n)
434
- terms += role_terms(st.roles[piece], m, 1.0 / (st.copies.get(piece) or 1))
465
+ g = 1.0 / (st.copies.get(piece) or 1)
466
+ terms += role_terms(st.roles[piece], m, g) + step_terms(st.flow, piece, st.roles[piece], m, g)
435
467
  return tuple(terms)
436
468
 
437
469
 
@@ -507,6 +539,7 @@ class ParsedRun:
507
539
  dropped: dict[str, int] = field(default_factory=dict)
508
540
  checks: dict[str, int] = field(default_factory=dict) # check name -> attempts that ran no model
509
541
  harness: dict | None = None # the run's harness record (`harness.run_record`), None without one
542
+ flow: str | None = None # the run's flow id (`run.flow.id`), None without `run.flow`
510
543
 
511
544
  @property
512
545
  def factors(self) -> tuple[str, ...]:
@@ -667,18 +700,44 @@ def config_from_doc(cfg: dict) -> Configuration:
667
700
 
668
701
 
669
702
  def rule_from_doc(doc: dict, default: AcceptanceRule = DEFAULT_RULE) -> AcceptanceRule:
703
+ """The run's stored rule. A score target no finite float holds, or a `window_days` no timedelta holds, is
704
+ refused by name (`Unusable`, a ValueError, which every reader of a malformed rule catches); any other
705
+ malformed score raises ValueError or TypeError as before."""
670
706
  r = (doc.get("run") or {}).get("acceptance_rule")
671
707
  if not isinstance(r, dict) or not r.get("name"):
672
708
  return default
673
709
  score = r.get("score")
674
710
  st = None
675
711
  if isinstance(score, dict) and score.get("name") and score.get("target") is not None:
676
- st = ScoreTarget(name=str(score["name"]), target=float(score["target"]),
712
+ st = ScoreTarget(name=str(score["name"]), target=_rule_target(score["target"]),
677
713
  better=str(score.get("better") or "higher"), scale=str(score.get("scale") or "linear"))
678
714
  return AcceptanceRule(name=str(r["name"]), definition=str(r.get("definition") or r["name"]),
679
715
  requires=tuple(r.get("requires") if r.get("requires") is not None else ("tests",)),
680
716
  score=st, excludes_events=tuple(r.get("excludes_events") or ("revert", "incident")),
681
- window_days=int(r.get("window_days") or 14))
717
+ window_days=_rule_window(r.get("window_days")))
718
+
719
+
720
+ def _rule_target(value: Any) -> float:
721
+ """A stored score target as a float; one past the float range, infinite or NaN is refused by name."""
722
+ try:
723
+ target = float(value)
724
+ except OverflowError:
725
+ target = math.inf
726
+ if not math.isfinite(target):
727
+ raise Unusable("score target not a finite number")
728
+ return target
729
+
730
+
731
+ def _rule_window(value: Any) -> int:
732
+ """A stored `window_days` (0 or none: 14); a day count past 999999999 either way (`timedelta.max.days`), or
733
+ an infinite float, is refused by name."""
734
+ try:
735
+ days = int(value or 14)
736
+ except OverflowError:
737
+ raise Unusable("window_days past 999999999") from None
738
+ if abs(days) > timedelta.max.days:
739
+ raise Unusable("window_days past 999999999")
740
+ return days
682
741
 
683
742
 
684
743
  _PRICES = None
@@ -792,19 +851,23 @@ def _check_name(a: dict, node: dict) -> str | None:
792
851
 
793
852
 
794
853
  def run_evidence(doc: dict, rule: AcceptanceRule, *, now: datetime,
795
- q_by_tier: dict[str, float] | None = None) -> Evidence:
796
- """The run's outcome as the fit reads it: `rules.evidence` under `rule` (None `q_by_tier`: the built-in q)."""
854
+ q_by_tier: dict[str, float] | None = None,
855
+ quality: tuple[float | None, float | None] | None = None) -> Evidence:
856
+ """The run's outcome as the fit reads it: `rules.evidence` under `rule` (None `q_by_tier`: the built-in q;
857
+ `quality`: a flow run's combined quality, as `outcome_evidence` takes it)."""
797
858
  from . import rules
798
859
 
799
- return rules.evidence(doc, rule, now=now, q_by_tier=q_by_tier)
860
+ return rules.evidence(doc, rule, now=now, q_by_tier=q_by_tier, quality=quality)
800
861
 
801
862
 
802
863
  def parse_run(doc: dict, *, now: datetime | None = None, rule: AcceptanceRule | None = None,
803
- origin: str | None = None, q_by_tier: dict[str, float] | None = None) -> ParsedRun:
864
+ origin: str | None = None, q_by_tier: dict[str, float] | None = None,
865
+ quality: tuple[float | None, float | None] | None = None) -> ParsedRun:
804
866
  """Everything the fit needs from one finished OCP v0.3 run document. Raises Unusable.
805
867
 
806
868
  `origin` is where the fit found the document (`data_source`); None reads its label. `q_by_tier` is
807
- `outcome.q.<tier>` from config.toml, passed to `outcome_evidence` (None: the built-in q).
869
+ `outcome.q.<tier>` from config.toml, passed to `outcome_evidence` (None: the built-in q), and so is
870
+ `quality`, a flow run's combined quality.
808
871
  """
809
872
  run = doc.get("run") or {}
810
873
  cfg = run.get("configuration")
@@ -869,7 +932,19 @@ def parse_run(doc: dict, *, now: datetime | None = None, rule: AcceptanceRule |
869
932
  from .rules import resolve_rule
870
933
 
871
934
  use_rule = rule or resolve_rule(doc) # one resolver for every reader (0.2.7); raises on a malformed score
872
- evidence = run_evidence(doc, use_rule, now=now or datetime.now().astimezone(), q_by_tier=q_by_tier)
935
+ evidence = run_evidence(doc, use_rule, now=now or datetime.now().astimezone(), q_by_tier=q_by_tier,
936
+ quality=quality)
937
+ flow = (run.get("flow") or {}).get("id") if isinstance(run.get("flow"), dict) else None
938
+ return ParsedRun(str(run.get("id") or task.id), task, config, source, attempts, gates, evidence,
939
+ run_score_meta(doc, evidence, use_rule), use_rule, dropped, checks, harness,
940
+ flow if isinstance(flow, str) and flow else None)
941
+
942
+
943
+ def run_score_meta(doc: dict, evidence: Evidence, rule: AcceptanceRule) -> dict[str, dict]:
944
+ """Each score's unit, direction and scale, from the run's first signal of that name. A flow run's combined
945
+ quality (`outcome_evidence`) is a fraction in the rule's direction; a score name a judge scored with no
946
+ combined value has no entry."""
947
+ run = doc.get("run") or {}
873
948
  score_meta: dict[str, dict] = {}
874
949
  for s in run.get("signals") or []:
875
950
  if s.get("kind") == "score" and isinstance(s.get("value"), (int, float)) and not isinstance(s.get("value"), bool):
@@ -881,8 +956,14 @@ def parse_run(doc: dict, *, now: datetime | None = None, rule: AcceptanceRule |
881
956
  score_meta.setdefault(str(name), dict(meta))
882
957
  for name in (evidence.scores or {}):
883
958
  score_meta.setdefault(str(name), {"unit": None, "better": "higher", "scale": "linear"})
884
- return ParsedRun(str(run.get("id") or task.id), task, config, source, attempts, gates, evidence,
885
- score_meta, use_rule, dropped, checks, harness)
959
+ elif isinstance(run.get("flow"), dict) and rule.score is not None:
960
+ from ..flows import judges
961
+
962
+ if any(judges.judged(doc, rule.score.name)):
963
+ score_meta.pop(rule.score.name, None)
964
+ if rule.score.name in (evidence.scores or {}):
965
+ score_meta[rule.score.name] = {"unit": None, "better": rule.score.better, "scale": "fraction"}
966
+ return score_meta
886
967
 
887
968
 
888
969
  def _gate_observations(doc: dict, st: Structure, by_piece_round: dict) -> list[tuple[int, int, bool]]:
@@ -951,7 +1032,7 @@ def _gate_observations(doc: dict, st: Structure, by_piece_round: dict) -> list[t
951
1032
  def rows_for_run(run_doc: dict) -> dict:
952
1033
  """Fitting rows for one run document: {cost, tokens, gate, success, scores} plus its structure."""
953
1034
  pr = parse_run(run_doc)
954
- st = structure(pr.config, pr.factors)
1035
+ st = structure(pr.config, pr.factors, pr.flow)
955
1036
  out: dict[str, Any] = {"run": pr.run_id, "source": pr.source, "structure": st,
956
1037
  "cost": [], "tokens": [], "gate": [], "success": None, "scores": {}}
957
1038
  for a in pr.attempts: