evaltrack 0.3.0__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 (261) hide show
  1. {evaltrack-0.3.0 → evaltrack-0.4.0}/.gitignore +1 -0
  2. {evaltrack-0.3.0 → evaltrack-0.4.0}/CHANGELOG.md +27 -1
  3. {evaltrack-0.3.0 → evaltrack-0.4.0}/CONTRIBUTING.md +3 -1
  4. {evaltrack-0.3.0 → evaltrack-0.4.0}/PKG-INFO +3 -2
  5. {evaltrack-0.3.0 → evaltrack-0.4.0}/README.md +2 -1
  6. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/ci-cd.md +16 -1
  7. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/cli.md +25 -4
  8. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/configuration.md +5 -5
  9. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/flakiness.md +3 -3
  10. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/getting-started.md +6 -5
  11. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/index.md +3 -2
  12. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/repositories.md +11 -7
  13. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/roadmap.md +0 -2
  14. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/cli.py +200 -13
  15. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/core/run_record.py +11 -2
  16. evaltrack-0.4.0/evaltrack/report/__init__.py +1 -0
  17. evaltrack-0.4.0/evaltrack/report/page.py +204 -0
  18. evaltrack-0.4.0/evaltrack/report/static/report.html +77 -0
  19. evaltrack-0.4.0/evaltrack/ui/__init__.py +1 -0
  20. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/ui/app.py +12 -13
  21. evaltrack-0.4.0/evaltrack/ui/models.py +45 -0
  22. evaltrack-0.4.0/evaltrack/ui/routes/history.py +35 -0
  23. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/ui/routes/refs.py +10 -27
  24. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/ui/routes/runs.py +43 -19
  25. evaltrack-0.3.0/evaltrack/ui/static/assets/index-BZO2JqWB.css → evaltrack-0.4.0/evaltrack/ui/static/assets/index-C64eCxny.css +1 -1
  26. evaltrack-0.4.0/evaltrack/ui/static/assets/index-CdxqKllv.js +56 -0
  27. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/ui/static/index.html +2 -2
  28. evaltrack-0.4.0/evaltrack/views/__init__.py +2 -0
  29. evaltrack-0.4.0/evaltrack/views/mainline.py +174 -0
  30. evaltrack-0.4.0/evaltrack/views/models.py +37 -0
  31. evaltrack-0.4.0/evaltrack/views/refs.py +41 -0
  32. {evaltrack-0.3.0/evaltrack/ui → evaltrack-0.4.0/evaltrack/views}/run_view.py +24 -16
  33. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/README.md +5 -1
  34. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/eslint.config.js +19 -0
  35. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/package-lock.json +99 -0
  36. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/package.json +2 -1
  37. evaltrack-0.4.0/frontend/report.html +21 -0
  38. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/App.tsx +12 -8
  39. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/api.test.ts +15 -1
  40. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/api.ts +10 -0
  41. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/baseline.test.ts +27 -5
  42. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/baseline.ts +18 -10
  43. evaltrack-0.4.0/frontend/src/components/Brand.tsx +24 -0
  44. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/RunDetail.tsx +88 -72
  45. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/RunDiff.tsx +27 -3
  46. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/Sidebar.tsx +7 -23
  47. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/deferred.ts +18 -9
  48. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/index.css +28 -0
  49. evaltrack-0.4.0/frontend/src/report.tsx +187 -0
  50. evaltrack-0.4.0/frontend/src/reportData.test.ts +152 -0
  51. evaltrack-0.4.0/frontend/src/reportData.ts +106 -0
  52. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/tsconfig.json +1 -1
  53. evaltrack-0.4.0/frontend/vite.report.config.ts +23 -0
  54. evaltrack-0.4.0/hatch_build.py +42 -0
  55. {evaltrack-0.3.0 → evaltrack-0.4.0}/pyproject.toml +8 -5
  56. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/cli/test_promote.py +21 -1
  57. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/cli/test_push.py +22 -1
  58. evaltrack-0.4.0/tests/cli/test_report.py +330 -0
  59. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/cli/test_ui_command.py +1 -1
  60. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/conftest.py +17 -0
  61. evaltrack-0.4.0/tests/report_support.py +39 -0
  62. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/ui/conftest.py +9 -5
  63. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/ui/test_history.py +19 -1
  64. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/ui/test_reads.py +2 -2
  65. evaltrack-0.4.0/tests/ui/test_report.py +315 -0
  66. evaltrack-0.4.0/tests/ui/test_report_route.py +82 -0
  67. evaltrack-0.3.0/evaltrack/ui/__init__.py +0 -7
  68. evaltrack-0.3.0/evaltrack/ui/models.py +0 -77
  69. evaltrack-0.3.0/evaltrack/ui/routes/history.py +0 -119
  70. evaltrack-0.3.0/evaltrack/ui/static/assets/index-Bf-jmLAW.js +0 -56
  71. evaltrack-0.3.0/hatch_build.py +0 -32
  72. {evaltrack-0.3.0 → evaltrack-0.4.0}/LICENSE +0 -0
  73. {evaltrack-0.3.0 → evaltrack-0.4.0}/SECURITY.md +0 -0
  74. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/changelog.md +0 -0
  75. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/contributing.md +0 -0
  76. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/eval-runners.md +0 -0
  77. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/eval-shape.md +0 -0
  78. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/examples.md +0 -0
  79. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/marker.md +0 -0
  80. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/outputs.md +0 -0
  81. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/reference/api.md +0 -0
  82. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/stylesheets/extra.css +0 -0
  83. {evaltrack-0.3.0 → evaltrack-0.4.0}/docs/translators.md +0 -0
  84. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/__init__.py +0 -0
  85. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/config.py +0 -0
  86. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/context.py +0 -0
  87. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/converters.py +0 -0
  88. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/core/__init__.py +0 -0
  89. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/core/converters.py +0 -0
  90. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/core/errors.py +0 -0
  91. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/core/eval_round.py +0 -0
  92. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/core/gate.py +0 -0
  93. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/core/projection.py +0 -0
  94. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/core/recorder.py +0 -0
  95. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/core/refs.py +0 -0
  96. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/core/repetition.py +0 -0
  97. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/core/results.py +0 -0
  98. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/core/run_context.py +0 -0
  99. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/core/score_bars.py +0 -0
  100. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/core/type_paths.py +0 -0
  101. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/core/user_values.py +0 -0
  102. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/failure.py +0 -0
  103. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/history/__init__.py +0 -0
  104. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/history/reliability.py +0 -0
  105. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/history/score_history.py +0 -0
  106. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/history/segments.py +0 -0
  107. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/marked_test.py +0 -0
  108. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/py.typed +0 -0
  109. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/pytest_plugin.py +0 -0
  110. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/repositories/__init__.py +0 -0
  111. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/repositories/azure.py +0 -0
  112. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/repositories/file.py +0 -0
  113. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/repositories/lifecycle.py +0 -0
  114. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/repositories/repository.py +0 -0
  115. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/repositories/s3.py +0 -0
  116. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/repositories/store.py +0 -0
  117. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/translators/__init__.py +0 -0
  118. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/translators/deepeval.py +0 -0
  119. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/translators/protocol.py +0 -0
  120. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/translators/pydantic_evals.py +0 -0
  121. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/ui/routes/__init__.py +0 -0
  122. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/ui/routes/meta.py +0 -0
  123. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/ui/routes/static.py +0 -0
  124. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/ui/run_cache.py +0 -0
  125. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/ui/security.py +0 -0
  126. {evaltrack-0.3.0 → evaltrack-0.4.0}/evaltrack/ui/static/favicon.svg +0 -0
  127. {evaltrack-0.3.0 → evaltrack-0.4.0}/examples/README.md +0 -0
  128. {evaltrack-0.3.0 → evaltrack-0.4.0}/examples/test_01_function.py +0 -0
  129. {evaltrack-0.3.0 → evaltrack-0.4.0}/examples/test_02_scores.py +0 -0
  130. {evaltrack-0.3.0 → evaltrack-0.4.0}/examples/test_03_reliability.py +0 -0
  131. {evaltrack-0.3.0 → evaltrack-0.4.0}/examples/test_04_agent_tool_use.py +0 -0
  132. {evaltrack-0.3.0 → evaltrack-0.4.0}/examples/test_05_llm_judge.py +0 -0
  133. {evaltrack-0.3.0 → evaltrack-0.4.0}/examples/test_06_fake_tool_in_inputs.py +0 -0
  134. {evaltrack-0.3.0 → evaltrack-0.4.0}/examples/test_07_deepeval.py +0 -0
  135. {evaltrack-0.3.0 → evaltrack-0.4.0}/examples/test_08_deepeval_repeats.py +0 -0
  136. {evaltrack-0.3.0 → evaltrack-0.4.0}/examples/test_09_other_eval_runner.py +0 -0
  137. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/.gitignore +0 -0
  138. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/index.html +0 -0
  139. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/public/favicon.svg +0 -0
  140. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/attemptCounts.test.ts +0 -0
  141. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/attemptCounts.ts +0 -0
  142. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/attemptErrors.test.ts +0 -0
  143. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/attemptErrors.ts +0 -0
  144. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/binaryEnvelope.test.ts +0 -0
  145. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/binaryEnvelope.ts +0 -0
  146. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/caseFilter.test.ts +0 -0
  147. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/caseFilter.ts +0 -0
  148. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/caseSections.test.ts +0 -0
  149. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/caseSections.ts +0 -0
  150. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/checks.test.ts +0 -0
  151. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/checks.ts +0 -0
  152. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/clamp.test.ts +0 -0
  153. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/clamp.ts +0 -0
  154. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/ConfirmDialog.tsx +0 -0
  155. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/CopyButton.tsx +0 -0
  156. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/Drawer.tsx +0 -0
  157. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/EvaluatorList.tsx +0 -0
  158. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/JsonDiff.tsx +0 -0
  159. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/JsonView.test.ts +0 -0
  160. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/JsonView.tsx +0 -0
  161. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/OutcomeCard.test.ts +0 -0
  162. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/OutcomeCard.tsx +0 -0
  163. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/PrRef.tsx +0 -0
  164. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/RunDetail.test.ts +0 -0
  165. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/RunDiff.test.ts +0 -0
  166. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/ScoreMeter.tsx +0 -0
  167. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/ScoreTrend.tsx +0 -0
  168. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/TableScroll.tsx +0 -0
  169. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/TextDiff.test.ts +0 -0
  170. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/TextDiff.tsx +0 -0
  171. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/ThemeToggle.test.ts +0 -0
  172. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/components/ThemeToggle.tsx +0 -0
  173. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/deferred.test.ts +0 -0
  174. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/diff.test.ts +0 -0
  175. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/diff.ts +0 -0
  176. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/drawerOpener.test.ts +0 -0
  177. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/drawerOpener.ts +0 -0
  178. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/extract.test.ts +0 -0
  179. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/extract.ts +0 -0
  180. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/format.test.ts +0 -0
  181. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/format.ts +0 -0
  182. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/grouping.test.ts +0 -0
  183. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/grouping.ts +0 -0
  184. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/load.test.ts +0 -0
  185. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/main.tsx +0 -0
  186. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/reliabilityNote.test.ts +0 -0
  187. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/reliabilityNote.ts +0 -0
  188. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/results.ts +0 -0
  189. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/runBody.test.ts +0 -0
  190. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/runOutcome.test.ts +0 -0
  191. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/runOutcome.ts +0 -0
  192. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/scoreTrend.test.ts +0 -0
  193. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/scoreTrend.ts +0 -0
  194. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/shortenUrl.test.ts +0 -0
  195. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/shortenUrl.ts +0 -0
  196. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/test-support.ts +0 -0
  197. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/src/types.ts +0 -0
  198. {evaltrack-0.3.0 → evaltrack-0.4.0}/frontend/vite.config.ts +0 -0
  199. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/__init__.py +0 -0
  200. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/cli/__init__.py +0 -0
  201. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/cli/helpers.py +0 -0
  202. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/cli/test_export.py +0 -0
  203. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/cli/test_listing.py +0 -0
  204. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/cli/test_main.py +0 -0
  205. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/core/__init__.py +0 -0
  206. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/core/test_converters.py +0 -0
  207. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/core/test_errors.py +0 -0
  208. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/core/test_eval_round.py +0 -0
  209. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/core/test_recorder.py +0 -0
  210. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/core/test_refs.py +0 -0
  211. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/core/test_results.py +0 -0
  212. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/core/test_run_record.py +0 -0
  213. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/core/test_score_bars.py +0 -0
  214. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/core/test_user_values.py +0 -0
  215. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/factories.py +0 -0
  216. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/fakes.py +0 -0
  217. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/history/__init__.py +0 -0
  218. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/history/test_reliability.py +0 -0
  219. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/history/test_score_history.py +0 -0
  220. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/marked_test/__init__.py +0 -0
  221. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/marked_test/conftest.py +0 -0
  222. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/marked_test/test_api.py +0 -0
  223. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/marked_test/test_merge.py +0 -0
  224. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/marked_test/test_run_loop.py +0 -0
  225. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/plugin/__init__.py +0 -0
  226. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/plugin/helpers.py +0 -0
  227. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/plugin/test_async_plugins.py +0 -0
  228. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/plugin/test_context.py +0 -0
  229. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/plugin/test_converters.py +0 -0
  230. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/plugin/test_gate_integration.py +0 -0
  231. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/plugin/test_large_outputs.py +0 -0
  232. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/plugin/test_marker.py +0 -0
  233. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/plugin/test_options.py +0 -0
  234. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/plugin/test_outcomes.py +0 -0
  235. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/plugin/test_reruns.py +0 -0
  236. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/plugin/test_termination.py +0 -0
  237. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/repositories/__init__.py +0 -0
  238. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/repositories/conftest.py +0 -0
  239. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/repositories/helpers.py +0 -0
  240. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/repositories/test_azure_store.py +0 -0
  241. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/repositories/test_file_store.py +0 -0
  242. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/repositories/test_open_repository.py +0 -0
  243. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/repositories/test_repository_refs.py +0 -0
  244. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/repositories/test_repository_retention.py +0 -0
  245. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/repositories/test_repository_runs.py +0 -0
  246. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/repositories/test_s3_store.py +0 -0
  247. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/repositories/test_store_contract.py +0 -0
  248. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/test_config.py +0 -0
  249. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/test_context.py +0 -0
  250. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/test_failure.py +0 -0
  251. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/test_public_api.py +0 -0
  252. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/translators/__init__.py +0 -0
  253. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/translators/contract.py +0 -0
  254. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/translators/test_deepeval.py +0 -0
  255. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/translators/test_pydantic_evals.py +0 -0
  256. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/translators/test_registry.py +0 -0
  257. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/ui/__init__.py +0 -0
  258. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/ui/test_hardening.py +0 -0
  259. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/ui/test_run_cache.py +0 -0
  260. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/ui/test_static.py +0 -0
  261. {evaltrack-0.3.0 → evaltrack-0.4.0}/tests/ui/test_writes.py +0 -0
@@ -32,6 +32,7 @@ dist/
32
32
  # directory, so `node_modules/` does not match it and it lands in a commit.
33
33
  node_modules
34
34
  evaltrack/ui/static/
35
+ evaltrack/report/static/
35
36
 
36
37
  # documentation site build output
37
38
  site/
@@ -9,6 +9,31 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.4.0] - 2026-10-08
13
+
14
+ ### Added
15
+
16
+ - `evaltrack report`, which writes a recorded run as one HTML file with the run embedded. It shows
17
+ the run as the dashboard does and opens anywhere with no server and no network, for CI artifacts
18
+ and sharing results. The page also holds the run's history over the mainline and the `baseline`
19
+ run, so **Compare to mainline** works in it. A value over 16 KB is left out of the page unless
20
+ `--full` is passed, so a report of a large run stays small. See
21
+ [CLI › report](https://evaltrack.jesravnbol.dk/latest/cli/#evaltrack-report).
22
+ - **Report** in the dashboard, on a run, which saves the same page for the run on screen, to share
23
+ with someone without the dashboard.
24
+
25
+ ### Changed
26
+
27
+ - The dashboard's history leaves out a promoted run whose body does not parse, and logs it, instead
28
+ of failing the whole history. A damaged `baseline` reflog still fails it.
29
+ - `evaltrack.ui` no longer re-exports `create_app` and `MountedRepository`. Import them from
30
+ `evaltrack.ui.app`.
31
+ - **Breaking:** the mainline is the configured `remote` and nothing else. A dashboard with only a
32
+ local repository mounted no longer measures reliability history over the local `baseline`.
33
+ `promote` and `push --ref baseline` into the local repository now exit `2`. To tell the local
34
+ repository apart, both read `pyproject.toml`, so an invalid `[tool.evaltrack]` table now stops
35
+ them with `--repository` too.
36
+
12
37
  ## [0.3.0] - 2026-09-26
13
38
 
14
39
  ### Added
@@ -67,7 +92,8 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
67
92
  The first public release. evaltrack is a pytest plugin that records, gates and tracks LLM evals. See
68
93
  the [README](https://github.com/jesrav/evaltrack#readme) to get started.
69
94
 
70
- [unreleased]: https://github.com/jesrav/evaltrack/compare/v0.3.0...HEAD
95
+ [unreleased]: https://github.com/jesrav/evaltrack/compare/v0.4.0...HEAD
96
+ [0.4.0]: https://github.com/jesrav/evaltrack/releases/tag/v0.4.0
71
97
  [0.3.0]: https://github.com/jesrav/evaltrack/releases/tag/v0.3.0
72
98
  [0.2.0]: https://github.com/jesrav/evaltrack/releases/tag/v0.2.0
73
99
  [0.1.0]: https://github.com/jesrav/evaltrack/releases/tag/v0.1.0
@@ -26,7 +26,7 @@ An editable install serves a fallback page at `evaltrack ui` until `just fronten
26
26
 
27
27
  ```bash
28
28
  just test # run the test suite
29
- just lint # ruff, basedpyright (strict), bandit, prettier (via pre-commit)
29
+ just lint # ruff, basedpyright (strict), import-linter, bandit, prettier (via pre-commit)
30
30
  ```
31
31
 
32
32
  The justfile has the rest: the frontend checks, the runnable examples, and the live cloud
@@ -62,6 +62,8 @@ just docs_fallback # the same site with MkDocs and mkdocs-material, which mus
62
62
  - Add tests for new behavior and for bug fixes.
63
63
  - Prefer dependency injection with fakes over mocking. Test what a caller can observe, not internal
64
64
  behavior.
65
+ - The package's layers are set out in `.importlinter`, and `just lint` checks them. If a new import
66
+ breaks a rule, move the code, or change the rule there and say why.
65
67
  - If you change the stored run format, bump `RUN_SCHEMA_VERSION`. Its docstring in
66
68
  `evaltrack/core/run_record.py` says what else a bump needs.
67
69
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: evaltrack
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Pytest plugin to record, gate and track LLM eval runs from pydantic-evals, DeepEval or a runner you write a translator for
5
5
  Project-URL: Homepage, https://github.com/jesrav/evaltrack
6
6
  Project-URL: Repository, https://github.com/jesrav/evaltrack
@@ -90,7 +90,8 @@ That one marker gives you three things:
90
90
  - **Keep every run.** Runs land in a repository you own (local files, or Azure Blob Storage or
91
91
  Amazon S3 as the remote), with a dashboard you run locally to inspect them and compare them across
92
92
  PRs and releases. Over the mainline (the runs you have promoted) it tracks each case's pass-rate
93
- and each score, so changes in quality that never trip the gate are still visible. See
93
+ and each score, so changes in quality that never trip the gate are still visible. You can save any
94
+ run as a standalone HTML file that opens anywhere, to share or attach to a CI job. See
94
95
  [Repositories and storage] and [CI/CD].
95
96
 
96
97
  ![Animated demo: a failing eval run in the dashboard, with per-case verdicts, scores against their bars, reliability history, and a comparison against the baseline][dashboard-demo]
@@ -43,7 +43,8 @@ That one marker gives you three things:
43
43
  - **Keep every run.** Runs land in a repository you own (local files, or Azure Blob Storage or
44
44
  Amazon S3 as the remote), with a dashboard you run locally to inspect them and compare them across
45
45
  PRs and releases. Over the mainline (the runs you have promoted) it tracks each case's pass-rate
46
- and each score, so changes in quality that never trip the gate are still visible. See
46
+ and each score, so changes in quality that never trip the gate are still visible. You can save any
47
+ run as a standalone HTML file that opens anywhere, to share or attach to a CI job. See
47
48
  [Repositories and storage] and [CI/CD].
48
49
 
49
50
  ![Animated demo: a failing eval run in the dashboard, with per-case verdicts, scores against their bars, reliability history, and a comparison against the baseline][dashboard-demo]
@@ -91,6 +91,21 @@ That is the whole integration. What the job around it has to get right:
91
91
  `--pr` and `--title` record the PR number and title on the ref, so the dashboard shows which PR a
92
92
  ref represents. With `pr_url_template` set, it links the number to the PR.
93
93
 
94
+ ### A report as a job artifact
95
+
96
+ If you save the run as one HTML file, a reviewer without the dashboard can see it. After the push,
97
+ write the report and upload the file as the job's artifact:
98
+
99
+ ```bash
100
+ evaltrack report --ref "pr/$PR_NUMBER" --output evaltrack-report.html
101
+ ```
102
+
103
+ The page opens from disk, with no server and no network. It shows the run, its history over the
104
+ mainline, and the changes from `baseline` to the run. It holds every input and output the run
105
+ recorded, so keep the artifact as private as the run. On the first pull request of a project there
106
+ is no `baseline` yet, and the report is then of the run alone. See
107
+ [CLI › report](./cli.md#evaltrack-report).
108
+
94
109
  ## Promote pipeline
95
110
 
96
111
  When the PR merges, point `baseline` at its run:
@@ -120,7 +135,7 @@ event means shipped in your process. I promote on merge, which suits trunk-based
120
135
  Promoting later than merge leaves `pr/{n}` refs standing until their run ships, and a ref reaches
121
136
  every run in its history. Delete them once their PR is closed.
122
137
 
123
- A repository has one `baseline`. The dashboard's Mainline section and the [cross-run reliability
138
+ The remote has one `baseline`. The dashboard's Mainline section and the [cross-run reliability
124
139
  estimate][cross-run reliability] read it.
125
140
 
126
141
  ## Reviewing a PR
@@ -13,7 +13,8 @@ already points at the run. See
13
13
 
14
14
  ## evaltrack promote
15
15
 
16
- See [Repositories › Promote](./repositories.md#promote) and
16
+ `promote` writes `baseline` to the remote. If the target is the local repository, the command exits
17
+ `2`. See [Repositories › Promote](./repositories.md#promote) and
17
18
  [Cleaning up runs](./repositories.md#cleaning-up-runs).
18
19
 
19
20
  ## evaltrack runs
@@ -49,9 +50,28 @@ Prints a recorded run as JSON. Use it to inspect a run or archive one outside th
49
50
  same data is available in Python. See [Reading runs from Python].
50
51
 
51
52
  **Exit codes:** `0` when the run was exported. `1` when the named repository does not hold the run,
52
- and the error names that repository. `2` when no repository is named. No other command exits
53
+ and the error names that repository. `2` when no repository is named. Only `report` shares
53
54
  [`1`](#exit-codes), so a script can act on the missing run alone.
54
55
 
56
+ ## evaltrack report
57
+
58
+ Writes a recorded run as one HTML file that opens from disk, with no server and no network.
59
+
60
+ ```bash
61
+ evaltrack report --ref pr/482 --output evaltrack-report.html
62
+ ```
63
+
64
+ The page also shows the run's history over the remote's [`baseline`][baseline], and **Compare to
65
+ mainline** against the run that `baseline` points at. Both come from the remote, whichever
66
+ repository holds the run. Without a remote, the page shows the run alone and says why.
67
+
68
+ The page holds the inputs and outputs that the run recorded. Share it with the same care as the run.
69
+ A value over 16 KB is left out, so a report of a large run stays small. Pass `--full` to embed every
70
+ value whole.
71
+
72
+ **Exit codes:** `0` when the report was written. `1` when the repository does not hold the run or
73
+ the ref. Nothing is written then. `2` when no repository is named.
74
+
55
75
  ## evaltrack ui
56
76
 
57
77
  The remote is not contacted at startup, so the dashboard comes up at once even when the remote is
@@ -74,8 +94,9 @@ carries an **Exit codes** note.
74
94
  | `2` | You or the environment has something to fix, and the message says what |
75
95
  | `70` | A bug in evaltrack, printed with its traceback |
76
96
 
77
- Only [`export`](#evaltrack-export) exits `1` today, for a run the repository does not hold. Please
78
- [report a `70`](https://github.com/jesrav/evaltrack/issues) with the traceback.
97
+ Only [`export`](#evaltrack-export) and [`report`](#evaltrack-report) exit `1` today, for a run or
98
+ ref the repository does not hold. Please [report a `70`](https://github.com/jesrav/evaltrack/issues)
99
+ with the traceback.
79
100
 
80
101
  ---
81
102
 
@@ -38,11 +38,11 @@ pr_url_template = "https://github.com/OWNER/REPO/pull/{pr}"
38
38
  # pr_url_template = "https://dev.azure.com/ORG/PROJECT/_git/REPO/pullrequest/{pr}"
39
39
  ```
40
40
 
41
- | key | default | meaning |
42
- | ----------------- | -------------- | -------------------------------------------------------------------------------------------- |
43
- | `local` | `./.evaltrack` | the plugin's save target and the dashboard's **Local** mount |
44
- | `remote` | unset | the shared repository: default target for `push`/`promote`, the dashboard's **Remote** mount |
45
- | `pr_url_template` | unset | `http(s)` URL template with a `{pr}` placeholder, used as a PR ref's link target |
41
+ | key | default | meaning |
42
+ | ----------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
43
+ | `local` | `./.evaltrack` | the plugin's save target and the dashboard's **Local** mount |
44
+ | `remote` | unset | the shared repository, which holds `baseline` and the mainline: default target for `push`/`promote`, the dashboard's **Remote** mount |
45
+ | `pr_url_template` | unset | `http(s)` URL template with a `{pr}` placeholder, used as a PR ref's link target |
46
46
 
47
47
  ## Pytest options
48
48
 
@@ -93,9 +93,9 @@ the test, and it is not a flakiness sample.
93
93
 
94
94
  ### Which runs pool
95
95
 
96
- The pooled runs are the **mainline**, the runs [`baseline`][baseline] has pointed at, in a window of
97
- the 50 most recent entries in its [reflog](./repositories.md#ref). Runs from assorted PR tips and
98
- local branches do not pool.
96
+ The pooled runs are the **mainline**, the runs the remote's [`baseline`][baseline] has pointed at.
97
+ The window is the 50 most recent entries in its [reflog](./repositories.md#ref). Runs from assorted
98
+ PR tips and local branches do not pool.
99
99
 
100
100
  The pooled rate is always the mainline's (your deploy history). The run you view (a PR run or a
101
101
  local run) is _not_ folded into it, so the number keeps its meaning of "how reliable is this eval on
@@ -104,8 +104,8 @@ evaltrack ui
104
104
  ```
105
105
 
106
106
  This serves the dashboard at `http://127.0.0.1:8765` and prints the link. Browse scores and
107
- pass-rates per case, and diff any two runs. Open a case to see each score against its bar and its
108
- history over the mainline.
107
+ pass-rates per case, and diff any two runs. Open a case to see each score against its bar. With a
108
+ remote (step 5), the case also shows its history over the mainline.
109
109
 
110
110
  !!! note
111
111
 
@@ -114,9 +114,10 @@ history over the mainline.
114
114
 
115
115
  ### 5. Track a shared remote (optional)
116
116
 
117
- Declare your repositories in `pyproject.toml`. `local` is where the plugin saves runs. `remote` is a
118
- shared repository that your CI writes to (Azure Blob Storage or Amazon S3). It stores the baseline
119
- (the run recorded for what is currently deployed) and the PR history.
117
+ The mainline and **Compare to mainline** need a remote. Declare your repositories in
118
+ `pyproject.toml`. `local` is where the plugin saves runs. `remote` is a shared repository that your
119
+ CI writes to (Azure Blob Storage or Amazon S3). It stores `baseline` (the ref for the run of what is
120
+ currently deployed) and the PR history.
120
121
 
121
122
  ```toml
122
123
  [tool.evaltrack]
@@ -30,8 +30,9 @@ That one marker gives you three things:
30
30
  only the evals that fail and tracks each case's pass-rate over time. See
31
31
  [Flakiness & reliability](./flakiness.md).
32
32
  - **Keep every run.** Runs land in a repository you own, local files or Azure Blob Storage or Amazon
33
- S3, with a dashboard you run locally to inspect them and compare them across PRs and releases. See
34
- [Repositories and storage](./repositories.md) and [CI/CD](./ci-cd.md).
33
+ S3, with a dashboard you run locally to inspect them and compare them across PRs and releases. You
34
+ can save any run as a standalone HTML file that opens anywhere, to share or attach to a CI job.
35
+ See [Repositories and storage](./repositories.md) and [CI/CD](./ci-cd.md).
35
36
 
36
37
  ![Animated demo: a failing eval run in the dashboard, with per-case verdicts, scores against their bars, reliability history, and a comparison against the baseline](./images/dashboard-demo.gif)
37
38
 
@@ -36,25 +36,29 @@ the target run and, optionally, a commit, a PR number, and a PR title. Past move
36
36
  The dashboard uses that history to compare a run against past PRs and releases.
37
37
 
38
38
  A ref name is lowercase and can be `/`-separated, as in `pr/123` or `my-experiment`. `baseline` is
39
- reserved.
39
+ reserved for the ref on the remote that the mainline is read from.
40
40
 
41
41
  A ref is treated as a pull request when its latest reflog entry carries a PR number (recorded by
42
42
  `evaltrack push --pr`), not because of its name.
43
43
 
44
44
  ## Baseline and mainline
45
45
 
46
- **`baseline` is the ref.** The **mainline is the history of runs that ref has pointed at.**
46
+ **`baseline` is a ref on the remote.** The **mainline is the history of runs that ref has pointed
47
+ at.** The local repository has no mainline.
47
48
 
48
49
  `baseline` points at the most recently promoted run. Its reflog records every promoted run before
49
50
  that one, with its commit and time, and that history is the mainline: what reliability rates and
50
51
  score histories are measured over. You decide what "promoted" means (merged, deployed, released).
51
52
  See [Adapting the flow].
52
53
 
54
+ The dashboard and `evaltrack report` measure every run, local runs too, over the remote's
55
+ `baseline`. Without a remote there is no history.
56
+
53
57
  ## Promote
54
58
 
55
- `evaltrack promote pr/123 --commit <sha>` moves `baseline` onto the run that `pr/123` already points
56
- at. Nothing is copied and nothing is re-evaluated. The recorded run, with the same ULID, becomes the
57
- newest mainline run.
59
+ `evaltrack promote pr/123 --commit <sha>` writes to the remote. It moves `baseline` onto the run
60
+ that `pr/123` already points at. Nothing is copied and nothing is re-evaluated. The recorded run,
61
+ with the same ULID, becomes the newest mainline run.
58
62
 
59
63
  ### Moving a ref is idempotent
60
64
 
@@ -80,8 +84,8 @@ How a relative path resolves is in
80
84
 
81
85
  Declare them once in the `[tool.evaltrack]` table of `pyproject.toml`: `local` is where the pytest
82
86
  plugin saves, `remote` the shared one CI pushes to, holding the `baseline` and `pr/{n}` refs. Both
83
- are optional, and `evaltrack ui` mounts whichever exist. See
84
- [Configuration](./configuration.md#toolevaltrack-in-pyprojecttoml).
87
+ are optional, and `evaltrack ui` mounts whichever exist, but only the remote's `baseline` gives
88
+ history. See [Configuration](./configuration.md#toolevaltrack-in-pyprojecttoml).
85
89
 
86
90
  ## Azure Blob Storage
87
91
 
@@ -8,8 +8,6 @@ This is directional and priorities and scope will change.
8
8
 
9
9
  ## Sharing results
10
10
 
11
- - A single-file HTML report of a run, or of a run against the baseline, that opens anywhere with no
12
- server. Meant for CI artifacts and release notes.
13
11
  - A Markdown summary of a run against the baseline, for posting on a pull request.
14
12
 
15
13
  ## CI integration
@@ -20,6 +20,7 @@ from evaltrack.config import (
20
20
  EvaltrackConfig,
21
21
  RepositoryRole,
22
22
  load_config,
23
+ names_a_url,
23
24
  resolve_local,
24
25
  resolve_remote,
25
26
  )
@@ -30,13 +31,20 @@ from evaltrack.core.errors import (
30
31
  RepositoryUnavailableError,
31
32
  )
32
33
  from evaltrack.core.refs import BASELINE_REF, Ref, RefKind, ReflogEntry
33
- from evaltrack.core.run_record import dump_run_json, parse_run_json
34
+ from evaltrack.core.run_record import (
35
+ RunRecord,
36
+ dump_run_json,
37
+ parse_run_json,
38
+ )
39
+ from evaltrack.report.page import collect_report_data, render_report
34
40
  from evaltrack.repositories import (
35
41
  RunRepository,
36
42
  RunSummary,
37
43
  open_repository,
38
44
  promote,
39
45
  )
46
+ from evaltrack.views.mainline import NoRemote
47
+ from evaltrack.views.run_view import INLINE_VALUE_BYTES
40
48
 
41
49
  # The dashboard is unauthenticated, so it binds loopback only.
42
50
  _UI_HOST = "127.0.0.1"
@@ -44,6 +52,8 @@ _UI_HOST = "127.0.0.1"
44
52
  # sysexits.h EX_SOFTWARE, clear of the command exit codes.
45
53
  _EXIT_INTERNAL_ERROR = 70
46
54
 
55
+ DEFAULT_REPORT_PATH = "evaltrack-report.html"
56
+
47
57
  _ISSUES_URL = "https://github.com/jesrav/evaltrack/issues"
48
58
 
49
59
 
@@ -257,6 +267,49 @@ def _build_parser() -> argparse.ArgumentParser:
257
267
  export, required=True, url_help="Repository path or URL the run lives in."
258
268
  )
259
269
 
270
+ report = sub.add_parser(
271
+ "report",
272
+ help="Write a single-file HTML report of a recorded run.",
273
+ allow_abbrev=False,
274
+ description=(
275
+ "Write one HTML file that shows a recorded run as the dashboard "
276
+ "does. The run is embedded, so the page opens anywhere with no "
277
+ "server and no network. When the remote has a baseline, the page "
278
+ "also holds the run's history over the mainline and the baseline "
279
+ "run to compare against."
280
+ ),
281
+ )
282
+ report.set_defaults(func=_cmd_report)
283
+ subject = report.add_mutually_exclusive_group(required=True)
284
+ subject.add_argument(
285
+ "--run-id",
286
+ dest="run_id",
287
+ help="The run id (ULID) to report.",
288
+ )
289
+ subject.add_argument(
290
+ "--ref",
291
+ default=None,
292
+ help="Report the run this ref points at, for example pr/123 or baseline.",
293
+ )
294
+ _add_repository_flags(
295
+ report,
296
+ required=False,
297
+ url_help="Repository path or URL. Defaults to the configured remote.",
298
+ )
299
+ report.add_argument(
300
+ "--full",
301
+ action="store_true",
302
+ default=False,
303
+ help="Embed every value whole. Without it, a value over 16 KB is left "
304
+ "out of the page and its preview and size stand in, so the file "
305
+ "stays small.",
306
+ )
307
+ report.add_argument(
308
+ "--output",
309
+ default=DEFAULT_REPORT_PATH,
310
+ help=f"The file to write, or - for stdout (default {DEFAULT_REPORT_PATH}).",
311
+ )
312
+
260
313
  ui = sub.add_parser(
261
314
  "ui",
262
315
  help="Serve the dashboard over the configured repositories.",
@@ -290,7 +343,7 @@ def _build_parser() -> argparse.ArgumentParser:
290
343
  # --- opening a repository ---
291
344
 
292
345
 
293
- def _open_remote_repository(config: EvaltrackConfig) -> ConfiguredRemote:
346
+ def _require_remote(config: EvaltrackConfig) -> ConfiguredRemote:
294
347
  """The configured remote, required."""
295
348
  remote = resolve_remote(config)
296
349
  if remote is None:
@@ -310,8 +363,13 @@ class _OpenedRepository:
310
363
  url: str
311
364
 
312
365
 
313
- def _open_resolved_repository(args: argparse.Namespace) -> _OpenedRepository:
314
- """Open the repository the flags name, or the remote, echoed to stderr."""
366
+ def _open_target_repository(
367
+ args: argparse.Namespace, *, config: EvaltrackConfig | None = None
368
+ ) -> _OpenedRepository:
369
+ """Open the repository the command acts on: the one the flags name, or the
370
+ remote, echoed to stderr.
371
+ `config` is read here only when it is needed and not given, so a named
372
+ repository costs no read at all."""
315
373
  source: str | None = None
316
374
  if args.repository_url is not None:
317
375
  url = args.repository_url
@@ -324,14 +382,14 @@ def _open_resolved_repository(args: argparse.Namespace) -> _OpenedRepository:
324
382
  "expands to an empty string, so check the value you passed."
325
383
  )
326
384
  else:
327
- # Read once here, so a named repository costs no read at all.
328
- config = load_config()
385
+ if config is None:
386
+ config = load_config()
329
387
  if args.local:
330
388
  url = resolve_local(config)
331
389
  elif args.remote:
332
- url = _open_remote_repository(config).url
390
+ url = _require_remote(config).url
333
391
  else:
334
- default = _open_remote_repository(config)
392
+ default = _require_remote(config)
335
393
  url = default.url
336
394
  source = default.source
337
395
  repository = open_repository(url)
@@ -341,6 +399,36 @@ def _open_resolved_repository(args: argparse.Namespace) -> _OpenedRepository:
341
399
  return _OpenedRepository(repository, url)
342
400
 
343
401
 
402
+ def _same_location(one: str, other: str) -> bool:
403
+ """Whether two repository locations name the same place. A directory is
404
+ compared by its absolute path, a URL as written."""
405
+ if names_a_url(one) or names_a_url(other):
406
+ return one == other
407
+ return os.path.abspath(os.path.expanduser(one)) == os.path.abspath(
408
+ os.path.expanduser(other)
409
+ )
410
+
411
+
412
+ def _refuse_baseline_in_local(
413
+ target: _OpenedRepository, config: EvaltrackConfig
414
+ ) -> bool:
415
+ """If `target` is the local repository, print why `baseline` cannot be written there
416
+ and return True. The role decides, so a remote that is a directory passes."""
417
+ remote = resolve_remote(config)
418
+ if remote is not None and _same_location(target.url, remote.url):
419
+ return False
420
+ if not _same_location(target.url, resolve_local(config)):
421
+ return False
422
+ print(
423
+ f"error: {BASELINE_REF!r} lives on the remote, and {target.url} is the "
424
+ "local repository. Add a remote to [tool.evaltrack] in pyproject.toml "
425
+ "and write there:\n"
426
+ ' remote = "<path-or-url>"',
427
+ file=sys.stderr,
428
+ )
429
+ return True
430
+
431
+
344
432
  # --- the commands ---
345
433
 
346
434
 
@@ -389,7 +477,10 @@ def _cmd_push(args: argparse.Namespace) -> int:
389
477
  )
390
478
  return 2
391
479
 
392
- target = _open_resolved_repository(args)
480
+ config = load_config()
481
+ target = _open_target_repository(args, config=config)
482
+ if args.ref == BASELINE_REF and _refuse_baseline_in_local(target, config):
483
+ return 2
393
484
  if args.ref is not None:
394
485
  # Before the save, so an invalid name cannot leave an orphan run behind.
395
486
  target.repository.validate_ref_name(args.ref)
@@ -418,7 +509,10 @@ def _cmd_promote(args: argparse.Namespace) -> int:
418
509
  file=sys.stderr,
419
510
  )
420
511
  return 2
421
- target = _open_resolved_repository(args)
512
+ config = load_config()
513
+ target = _open_target_repository(args, config=config)
514
+ if _refuse_baseline_in_local(target, config):
515
+ return 2
422
516
  result = promote(
423
517
  target.repository, args.ref, commit=args.commit, cleanup=args.cleanup
424
518
  )
@@ -435,7 +529,7 @@ def _cmd_promote(args: argparse.Namespace) -> int:
435
529
 
436
530
 
437
531
  def _cmd_runs(args: argparse.Namespace) -> int:
438
- target = _open_resolved_repository(args)
532
+ target = _open_target_repository(args)
439
533
  listed = 0
440
534
  for listed, summary in enumerate(target.repository.list_runs(), start=1):
441
535
  print(_format_run(summary))
@@ -447,7 +541,7 @@ def _cmd_runs(args: argparse.Namespace) -> int:
447
541
 
448
542
 
449
543
  def _cmd_refs(args: argparse.Namespace) -> int:
450
- target = _open_resolved_repository(args)
544
+ target = _open_target_repository(args)
451
545
  lines = _format_ref_lines(target.repository)
452
546
  for line in lines:
453
547
  print(line)
@@ -457,7 +551,7 @@ def _cmd_refs(args: argparse.Namespace) -> int:
457
551
 
458
552
 
459
553
  def _cmd_export(args: argparse.Namespace) -> int:
460
- target = _open_resolved_repository(args)
554
+ target = _open_target_repository(args)
461
555
  run = target.repository.load_run(args.run_id)
462
556
  if run is None:
463
557
  # A missing run is a defined outcome, so exit 1, not the usage error 2.
@@ -467,6 +561,99 @@ def _cmd_export(args: argparse.Namespace) -> int:
467
561
  return 0
468
562
 
469
563
 
564
+ class _RunNotFound(Exception):
565
+ """The repository does not hold the run a name picks. The message says
566
+ which name, and where it was looked for."""
567
+
568
+
569
+ def _load_run(
570
+ target: _OpenedRepository, *, run_id: str | None, ref: str | None
571
+ ) -> RunRecord:
572
+ """The run with `run_id`, or the run that `ref` points at. One of the two names
573
+ the run, never both.
574
+
575
+ Raises:
576
+ _RunNotFound: when the repository does not hold it.
577
+ """
578
+ if run_id is not None and ref is None:
579
+ run = target.repository.load_run(run_id)
580
+ if run is None:
581
+ raise _RunNotFound(f"run {run_id!r} not found in {target.url}")
582
+ return run
583
+ if ref is not None and run_id is None:
584
+ tip = target.repository.get_ref(ref)
585
+ if tip is None:
586
+ raise _RunNotFound(f"ref {ref!r} not found in {target.url}")
587
+ run = target.repository.load_run(tip.run_id)
588
+ if run is None:
589
+ raise _RunNotFound(
590
+ f"run {tip.run_id!r} (the tip of ref {ref!r}) not found in {target.url}"
591
+ )
592
+ return run
593
+ raise ValueError("a run is named by its id or by a ref, not both")
594
+
595
+
596
+ def _open_remote(
597
+ target: _OpenedRepository, config: EvaltrackConfig
598
+ ) -> RunRepository | NoRemote:
599
+ """The configured remote, which holds the mainline, whichever repository holds
600
+ the run. A report can be written without a mainline, so a remote that does not
601
+ open is a warning, not an error. The URL is printed only after the open
602
+ succeeds, since a URL that is turned away can hold a credential."""
603
+ remote = resolve_remote(config)
604
+ if remote is None:
605
+ return NoRemote.NOT_CONFIGURED
606
+ if _same_location(remote.url, target.url):
607
+ return target.repository
608
+ try:
609
+ repository = open_repository(remote.url)
610
+ except (ValueError, ImportError) as exc:
611
+ # The detail can name a host or a path, so it stays on stderr and out
612
+ # of the page.
613
+ print(
614
+ f"warning: the remote in {remote.source} did not open: {_first_line(exc)}",
615
+ file=sys.stderr,
616
+ )
617
+ return NoRemote.DID_NOT_OPEN
618
+ print(f"reading the mainline from {remote.url}", file=sys.stderr)
619
+ return repository
620
+
621
+
622
+ def _cmd_report(args: argparse.Namespace) -> int:
623
+ config = load_config()
624
+ target = _open_target_repository(args, config=config)
625
+ try:
626
+ subject = _load_run(target, run_id=args.run_id, ref=args.ref)
627
+ except _RunNotFound as exc:
628
+ # A missing run is a defined outcome, so the exit code is 1.
629
+ print(f"report: {exc}", file=sys.stderr)
630
+ return 1
631
+ data = collect_report_data(
632
+ target.repository,
633
+ subject,
634
+ remote=_open_remote(target, config),
635
+ via_ref=args.ref,
636
+ pr_url_template=config.pr_url_template,
637
+ )
638
+ if data.mainline_error is not None:
639
+ # The page carries the same reason, for a reader who never sees stderr.
640
+ print(
641
+ "warning: the report has no history and no comparison against the "
642
+ f"mainline: {data.mainline_error}",
643
+ file=sys.stderr,
644
+ )
645
+ html = render_report(data, inline_limit=None if args.full else INLINE_VALUE_BYTES)
646
+ if args.output == "-":
647
+ sys.stdout.write(html)
648
+ return 0
649
+ Path(args.output).write_text(html, encoding="utf-8")
650
+ what = f"run {subject.id}"
651
+ if data.baseline is not None:
652
+ what += f", with baseline run {data.baseline.id} to compare against,"
653
+ print(f"wrote report of {what} to {args.output}")
654
+ return 0
655
+
656
+
470
657
  def _resolve_ui_mounts(config: EvaltrackConfig) -> list[tuple[str, RepositoryRole]]:
471
658
  """The (url, role) pairs `evaltrack ui` mounts, the remote only when configured."""
472
659
  mounts: list[tuple[str, RepositoryRole]] = [(resolve_local(config), "local")]
@@ -281,7 +281,12 @@ def _repr_or_stand_in(value: object) -> str:
281
281
  return f"<unrepresentable {type(value).__name__}>"
282
282
 
283
283
 
284
- def dump_plain(model: BaseModel, *, include: set[str] | None = None) -> Any:
284
+ def dump_plain(
285
+ model: BaseModel,
286
+ *,
287
+ include: set[str] | None = None,
288
+ exclude: set[str] | None = None,
289
+ ) -> Any:
285
290
  """The model as plain dicts. This is the first half of `dump_run_json`.
286
291
 
287
292
  The dump makes plain dicts first, so that the degrade in `dump_plain_json`
@@ -293,7 +298,11 @@ def dump_plain(model: BaseModel, *, include: set[str] | None = None) -> Any:
293
298
  its declared type, and under `-W error` that warning alone loses the run.
294
299
  """
295
300
  return model.model_dump(
296
- mode="python", include=include, fallback=_repr_or_stand_in, warnings=False
301
+ mode="python",
302
+ include=include,
303
+ exclude=exclude,
304
+ fallback=_repr_or_stand_in,
305
+ warnings=False,
297
306
  )
298
307
 
299
308
 
@@ -0,0 +1 @@
1
+ """The single-file report of a run."""