giraffe-llm 0.1.0a1__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 (332) hide show
  1. giraffe_llm-0.1.0a1/.dockerignore +8 -0
  2. giraffe_llm-0.1.0a1/.github/CODEOWNERS +2 -0
  3. giraffe_llm-0.1.0a1/.github/main-ruleset.json +26 -0
  4. giraffe_llm-0.1.0a1/.github/scripts/pytest_summary.py +32 -0
  5. giraffe_llm-0.1.0a1/.github/scripts/smoke_package.py +51 -0
  6. giraffe_llm-0.1.0a1/.github/scripts/validate_release.py +41 -0
  7. giraffe_llm-0.1.0a1/.github/workflows/checks.yml +55 -0
  8. giraffe_llm-0.1.0a1/.github/workflows/publish.yml +101 -0
  9. giraffe_llm-0.1.0a1/.gitignore +22 -0
  10. giraffe_llm-0.1.0a1/CONTRIBUTING.md +146 -0
  11. giraffe_llm-0.1.0a1/Dockerfile +7 -0
  12. giraffe_llm-0.1.0a1/LICENSE +202 -0
  13. giraffe_llm-0.1.0a1/PKG-INFO +175 -0
  14. giraffe_llm-0.1.0a1/PRODUCT.md +41 -0
  15. giraffe_llm-0.1.0a1/README.md +142 -0
  16. giraffe_llm-0.1.0a1/docs/README.md +28 -0
  17. giraffe_llm-0.1.0a1/docs/assets/OFL.txt +92 -0
  18. giraffe_llm-0.1.0a1/docs/assets/badges/discord.svg +1 -0
  19. giraffe_llm-0.1.0a1/docs/assets/badges/docs.svg +1 -0
  20. giraffe_llm-0.1.0a1/docs/assets/badges/license.svg +1 -0
  21. giraffe_llm-0.1.0a1/docs/assets/badges/python.svg +1 -0
  22. giraffe_llm-0.1.0a1/docs/assets/badges/version.svg +1 -0
  23. giraffe_llm-0.1.0a1/docs/assets/giraffe-dark.svg +1 -0
  24. giraffe_llm-0.1.0a1/docs/assets/giraffe-light.svg +1 -0
  25. giraffe_llm-0.1.0a1/docs/concurrent-load-design.md +421 -0
  26. giraffe_llm-0.1.0a1/docs/offline.md +64 -0
  27. giraffe_llm-0.1.0a1/docs/resources.md +246 -0
  28. giraffe_llm-0.1.0a1/docs/running.md +168 -0
  29. giraffe_llm-0.1.0a1/docs/validation/2026-10-08-ollama-deployment.json +14 -0
  30. giraffe_llm-0.1.0a1/docs/validation/2026-10-08-ollama-results.json +571 -0
  31. giraffe_llm-0.1.0a1/docs/validation/2026-10-08-ollama.json +137 -0
  32. giraffe_llm-0.1.0a1/docs/validation/2026-10-08-vllm-deployment.json +21 -0
  33. giraffe_llm-0.1.0a1/docs/validation/2026-10-08-vllm-results.json +833 -0
  34. giraffe_llm-0.1.0a1/docs/validation/2026-10-08-vllm.json +145 -0
  35. giraffe_llm-0.1.0a1/docs/validation/2026-10-08.md +174 -0
  36. giraffe_llm-0.1.0a1/docs/workloads.md +771 -0
  37. giraffe_llm-0.1.0a1/examples/concurrent-workloads.yaml +76 -0
  38. giraffe_llm-0.1.0a1/examples/llamacpp.yaml +104 -0
  39. giraffe_llm-0.1.0a1/examples/lmdeploy.yaml +104 -0
  40. giraffe_llm-0.1.0a1/examples/local.yaml +32 -0
  41. giraffe_llm-0.1.0a1/examples/logprob-consistency.yaml +31 -0
  42. giraffe_llm-0.1.0a1/examples/request-pack-judged.json +29 -0
  43. giraffe_llm-0.1.0a1/examples/request-pack.json +34 -0
  44. giraffe_llm-0.1.0a1/examples/tensorrt-llm.yaml +103 -0
  45. giraffe_llm-0.1.0a1/examples/tgi.yaml +104 -0
  46. giraffe_llm-0.1.0a1/examples/tool-choice.yaml +135 -0
  47. giraffe_llm-0.1.0a1/examples/tool-content.yaml +49 -0
  48. giraffe_llm-0.1.0a1/examples/tool-result-conversation.yaml +47 -0
  49. giraffe_llm-0.1.0a1/examples/traffic.yaml +40 -0
  50. giraffe_llm-0.1.0a1/examples/vllm.yaml +36 -0
  51. giraffe_llm-0.1.0a1/examples/workloads.yaml +122 -0
  52. giraffe_llm-0.1.0a1/pyproject.toml +50 -0
  53. giraffe_llm-0.1.0a1/scripts/_measurement.py +124 -0
  54. giraffe_llm-0.1.0a1/scripts/measure_arrivals.py +163 -0
  55. giraffe_llm-0.1.0a1/scripts/measure_concurrency.py +145 -0
  56. giraffe_llm-0.1.0a1/scripts/measure_memory.py +186 -0
  57. giraffe_llm-0.1.0a1/scripts/measure_storage.py +75 -0
  58. giraffe_llm-0.1.0a1/src/giraffe/__init__.py +3 -0
  59. giraffe_llm-0.1.0a1/src/giraffe/backend_cancellation.py +232 -0
  60. giraffe_llm-0.1.0a1/src/giraffe/capabilities.py +229 -0
  61. giraffe_llm-0.1.0a1/src/giraffe/caps.py +170 -0
  62. giraffe_llm-0.1.0a1/src/giraffe/cli.py +907 -0
  63. giraffe_llm-0.1.0a1/src/giraffe/client.py +874 -0
  64. giraffe_llm-0.1.0a1/src/giraffe/concurrent_load.py +436 -0
  65. giraffe_llm-0.1.0a1/src/giraffe/conditions.py +696 -0
  66. giraffe_llm-0.1.0a1/src/giraffe/configuration_errors.py +258 -0
  67. giraffe_llm-0.1.0a1/src/giraffe/dataset_import.py +158 -0
  68. giraffe_llm-0.1.0a1/src/giraffe/deployment.py +635 -0
  69. giraffe_llm-0.1.0a1/src/giraffe/fixtures.py +860 -0
  70. giraffe_llm-0.1.0a1/src/giraffe/handoff.py +63 -0
  71. giraffe_llm-0.1.0a1/src/giraffe/invocation.py +67 -0
  72. giraffe_llm-0.1.0a1/src/giraffe/judging.py +229 -0
  73. giraffe_llm-0.1.0a1/src/giraffe/latency.py +475 -0
  74. giraffe_llm-0.1.0a1/src/giraffe/load_test.py +1758 -0
  75. giraffe_llm-0.1.0a1/src/giraffe/local_tokenizer.py +470 -0
  76. giraffe_llm-0.1.0a1/src/giraffe/logprob_workload.py +247 -0
  77. giraffe_llm-0.1.0a1/src/giraffe/logprobs.py +250 -0
  78. giraffe_llm-0.1.0a1/src/giraffe/models.py +2644 -0
  79. giraffe_llm-0.1.0a1/src/giraffe/ollama_cancellation.py +76 -0
  80. giraffe_llm-0.1.0a1/src/giraffe/open_files.py +145 -0
  81. giraffe_llm-0.1.0a1/src/giraffe/overlap.py +154 -0
  82. giraffe_llm-0.1.0a1/src/giraffe/performance.py +915 -0
  83. giraffe_llm-0.1.0a1/src/giraffe/performance_html.py +406 -0
  84. giraffe_llm-0.1.0a1/src/giraffe/planning.py +1189 -0
  85. giraffe_llm-0.1.0a1/src/giraffe/preflight.py +261 -0
  86. giraffe_llm-0.1.0a1/src/giraffe/report_inputs.py +14 -0
  87. giraffe_llm-0.1.0a1/src/giraffe/report_stream.py +274 -0
  88. giraffe_llm-0.1.0a1/src/giraffe/reporting.py +1900 -0
  89. giraffe_llm-0.1.0a1/src/giraffe/request_pack.py +282 -0
  90. giraffe_llm-0.1.0a1/src/giraffe/resources.py +112 -0
  91. giraffe_llm-0.1.0a1/src/giraffe/runner.py +2441 -0
  92. giraffe_llm-0.1.0a1/src/giraffe/session_metrics.py +85 -0
  93. giraffe_llm-0.1.0a1/src/giraffe/sglang_traces.py +145 -0
  94. giraffe_llm-0.1.0a1/src/giraffe/static/app.js +3909 -0
  95. giraffe_llm-0.1.0a1/src/giraffe/static/fonts/Geist-Variable.woff2 +0 -0
  96. giraffe_llm-0.1.0a1/src/giraffe/static/fonts/GeistMono-Variable.woff2 +0 -0
  97. giraffe_llm-0.1.0a1/src/giraffe/static/fonts/OFL.txt +92 -0
  98. giraffe_llm-0.1.0a1/src/giraffe/static/form-config.mjs +488 -0
  99. giraffe_llm-0.1.0a1/src/giraffe/static/index.html +65 -0
  100. giraffe_llm-0.1.0a1/src/giraffe/static/styles.css +1574 -0
  101. giraffe_llm-0.1.0a1/src/giraffe/storage.py +449 -0
  102. giraffe_llm-0.1.0a1/src/giraffe/telemetry.py +877 -0
  103. giraffe_llm-0.1.0a1/src/giraffe/timing.py +195 -0
  104. giraffe_llm-0.1.0a1/src/giraffe/tool_checks.py +41 -0
  105. giraffe_llm-0.1.0a1/src/giraffe/tool_conversations.py +181 -0
  106. giraffe_llm-0.1.0a1/src/giraffe/tool_schema.py +147 -0
  107. giraffe_llm-0.1.0a1/src/giraffe/traffic.py +643 -0
  108. giraffe_llm-0.1.0a1/src/giraffe/transport.py +125 -0
  109. giraffe_llm-0.1.0a1/src/giraffe/vllm_cancellation_hooks.py +50 -0
  110. giraffe_llm-0.1.0a1/src/giraffe/web.py +1238 -0
  111. giraffe_llm-0.1.0a1/src/giraffe/workloads.py +837 -0
  112. giraffe_llm-0.1.0a1/tests/__init__.py +0 -0
  113. giraffe_llm-0.1.0a1/tests/conftest.py +34 -0
  114. giraffe_llm-0.1.0a1/tests/evidence_helpers.py +22 -0
  115. giraffe_llm-0.1.0a1/tests/fake_endpoint.py +459 -0
  116. giraffe_llm-0.1.0a1/tests/fixtures/legacy-concurrent-load.yaml +55 -0
  117. giraffe_llm-0.1.0a1/tests/fixtures/legacy-run-limits-overlap.yaml +8 -0
  118. giraffe_llm-0.1.0a1/tests/fixtures/review26-legacy-effective.json +5665 -0
  119. giraffe_llm-0.1.0a1/tests/fixtures/run-limits-phase3-defaults.json +5321 -0
  120. giraffe_llm-0.1.0a1/tests/performance_fixture.py +72 -0
  121. giraffe_llm-0.1.0a1/tests/test_arrival_end_to_end.py +231 -0
  122. giraffe_llm-0.1.0a1/tests/test_automatic_performance_evidence.py +370 -0
  123. giraffe_llm-0.1.0a1/tests/test_backend_cancellation.py +164 -0
  124. giraffe_llm-0.1.0a1/tests/test_builtin_tokenizer.py +260 -0
  125. giraffe_llm-0.1.0a1/tests/test_cancellation_clock.py +54 -0
  126. giraffe_llm-0.1.0a1/tests/test_cancellation_compatibility_issue54.py +74 -0
  127. giraffe_llm-0.1.0a1/tests/test_cancellation_reliability.py +100 -0
  128. giraffe_llm-0.1.0a1/tests/test_check_intent_cancel_gpu.py +341 -0
  129. giraffe_llm-0.1.0a1/tests/test_check_intent_core.py +460 -0
  130. giraffe_llm-0.1.0a1/tests/test_check_intent_load.py +417 -0
  131. giraffe_llm-0.1.0a1/tests/test_check_intent_overlap.py +391 -0
  132. giraffe_llm-0.1.0a1/tests/test_check_intent_round2_core.py +388 -0
  133. giraffe_llm-0.1.0a1/tests/test_check_intent_round2_scoring.py +259 -0
  134. giraffe_llm-0.1.0a1/tests/test_check_intent_scoring.py +390 -0
  135. giraffe_llm-0.1.0a1/tests/test_cli.py +452 -0
  136. giraffe_llm-0.1.0a1/tests/test_cli_preflight.py +531 -0
  137. giraffe_llm-0.1.0a1/tests/test_client.py +766 -0
  138. giraffe_llm-0.1.0a1/tests/test_client_keepalive.py +327 -0
  139. giraffe_llm-0.1.0a1/tests/test_concurrent_load.py +652 -0
  140. giraffe_llm-0.1.0a1/tests/test_concurrent_load_defaults.py +160 -0
  141. giraffe_llm-0.1.0a1/tests/test_concurrent_load_migration.py +324 -0
  142. giraffe_llm-0.1.0a1/tests/test_concurrent_load_qa.py +198 -0
  143. giraffe_llm-0.1.0a1/tests/test_concurrent_load_reporting.py +101 -0
  144. giraffe_llm-0.1.0a1/tests/test_concurrent_load_ui.py +210 -0
  145. giraffe_llm-0.1.0a1/tests/test_concurrent_load_ui_review.py +300 -0
  146. giraffe_llm-0.1.0a1/tests/test_condition_execution_order.py +51 -0
  147. giraffe_llm-0.1.0a1/tests/test_condition_mapping.py +103 -0
  148. giraffe_llm-0.1.0a1/tests/test_condition_planned.py +190 -0
  149. giraffe_llm-0.1.0a1/tests/test_condition_requests.py +183 -0
  150. giraffe_llm-0.1.0a1/tests/test_condition_revisions.py +180 -0
  151. giraffe_llm-0.1.0a1/tests/test_condition_tracking.py +200 -0
  152. giraffe_llm-0.1.0a1/tests/test_config_validation_issue54.py +224 -0
  153. giraffe_llm-0.1.0a1/tests/test_connection.py +297 -0
  154. giraffe_llm-0.1.0a1/tests/test_core_round2.py +276 -0
  155. giraffe_llm-0.1.0a1/tests/test_dataset_import.py +118 -0
  156. giraffe_llm-0.1.0a1/tests/test_dataset_interfaces.py +134 -0
  157. giraffe_llm-0.1.0a1/tests/test_deployment.py +541 -0
  158. giraffe_llm-0.1.0a1/tests/test_docs_examples.py +120 -0
  159. giraffe_llm-0.1.0a1/tests/test_end_to_end.py +195 -0
  160. giraffe_llm-0.1.0a1/tests/test_engines.py +141 -0
  161. giraffe_llm-0.1.0a1/tests/test_event_timing.py +223 -0
  162. giraffe_llm-0.1.0a1/tests/test_execution_reliability.py +208 -0
  163. giraffe_llm-0.1.0a1/tests/test_fixtures.py +296 -0
  164. giraffe_llm-0.1.0a1/tests/test_generation.py +62 -0
  165. giraffe_llm-0.1.0a1/tests/test_gpu_reliability.py +133 -0
  166. giraffe_llm-0.1.0a1/tests/test_handoff.py +193 -0
  167. giraffe_llm-0.1.0a1/tests/test_handoff_end_to_end.py +103 -0
  168. giraffe_llm-0.1.0a1/tests/test_historical_baseline_issue54.py +176 -0
  169. giraffe_llm-0.1.0a1/tests/test_invocation.py +119 -0
  170. giraffe_llm-0.1.0a1/tests/test_judge_interfaces.py +114 -0
  171. giraffe_llm-0.1.0a1/tests/test_judging.py +359 -0
  172. giraffe_llm-0.1.0a1/tests/test_label_regressions.py +208 -0
  173. giraffe_llm-0.1.0a1/tests/test_load_error_policy.py +197 -0
  174. giraffe_llm-0.1.0a1/tests/test_load_executor_regressions.py +425 -0
  175. giraffe_llm-0.1.0a1/tests/test_load_reliability.py +214 -0
  176. giraffe_llm-0.1.0a1/tests/test_load_test_api.py +94 -0
  177. giraffe_llm-0.1.0a1/tests/test_load_test_baseline.py +212 -0
  178. giraffe_llm-0.1.0a1/tests/test_load_test_phase_a.py +941 -0
  179. giraffe_llm-0.1.0a1/tests/test_load_test_qualification.py +101 -0
  180. giraffe_llm-0.1.0a1/tests/test_load_test_review2.py +256 -0
  181. giraffe_llm-0.1.0a1/tests/test_load_test_ui.py +354 -0
  182. giraffe_llm-0.1.0a1/tests/test_local_host_issue54.py +142 -0
  183. giraffe_llm-0.1.0a1/tests/test_local_tokenizer.py +266 -0
  184. giraffe_llm-0.1.0a1/tests/test_local_tokenizer_library.py +43 -0
  185. giraffe_llm-0.1.0a1/tests/test_logprobs.py +503 -0
  186. giraffe_llm-0.1.0a1/tests/test_memory_export.py +184 -0
  187. giraffe_llm-0.1.0a1/tests/test_model_discovery.py +92 -0
  188. giraffe_llm-0.1.0a1/tests/test_models.py +184 -0
  189. giraffe_llm-0.1.0a1/tests/test_performance.py +405 -0
  190. giraffe_llm-0.1.0a1/tests/test_performance_api.py +166 -0
  191. giraffe_llm-0.1.0a1/tests/test_performance_fixture.py +41 -0
  192. giraffe_llm-0.1.0a1/tests/test_performance_html.py +159 -0
  193. giraffe_llm-0.1.0a1/tests/test_performance_html_polish.py +46 -0
  194. giraffe_llm-0.1.0a1/tests/test_performance_legacy_generation.py +58 -0
  195. giraffe_llm-0.1.0a1/tests/test_performance_scope.py +181 -0
  196. giraffe_llm-0.1.0a1/tests/test_performance_telemetry.py +201 -0
  197. giraffe_llm-0.1.0a1/tests/test_planning.py +529 -0
  198. giraffe_llm-0.1.0a1/tests/test_pr53_execution_feedback.py +87 -0
  199. giraffe_llm-0.1.0a1/tests/test_quality_load_reliability.py +112 -0
  200. giraffe_llm-0.1.0a1/tests/test_ram_lifecycle.py +251 -0
  201. giraffe_llm-0.1.0a1/tests/test_ram_web.py +121 -0
  202. giraffe_llm-0.1.0a1/tests/test_readable_labels.py +225 -0
  203. giraffe_llm-0.1.0a1/tests/test_recovery_issue54.py +60 -0
  204. giraffe_llm-0.1.0a1/tests/test_release.py +73 -0
  205. giraffe_llm-0.1.0a1/tests/test_reliability_round3.py +367 -0
  206. giraffe_llm-0.1.0a1/tests/test_report_write_failures.py +75 -0
  207. giraffe_llm-0.1.0a1/tests/test_reporting.py +820 -0
  208. giraffe_llm-0.1.0a1/tests/test_request_pack.py +360 -0
  209. giraffe_llm-0.1.0a1/tests/test_resources.py +223 -0
  210. giraffe_llm-0.1.0a1/tests/test_resources_interfaces.py +125 -0
  211. giraffe_llm-0.1.0a1/tests/test_reticulate.py +138 -0
  212. giraffe_llm-0.1.0a1/tests/test_review26_cli_baseline.py +122 -0
  213. giraffe_llm-0.1.0a1/tests/test_review26_legacy_cases.py +80 -0
  214. giraffe_llm-0.1.0a1/tests/test_review26_migrations.py +180 -0
  215. giraffe_llm-0.1.0a1/tests/test_review26_phase4_accuracy.py +201 -0
  216. giraffe_llm-0.1.0a1/tests/test_review26_phase4_guard.py +162 -0
  217. giraffe_llm-0.1.0a1/tests/test_review26_phase4_timeline.py +284 -0
  218. giraffe_llm-0.1.0a1/tests/test_review26_runtime.py +116 -0
  219. giraffe_llm-0.1.0a1/tests/test_review26p4_latency.py +142 -0
  220. giraffe_llm-0.1.0a1/tests/test_run_limits_audit.py +430 -0
  221. giraffe_llm-0.1.0a1/tests/test_run_limits_baseline_identity.py +155 -0
  222. giraffe_llm-0.1.0a1/tests/test_run_limits_cli.py +197 -0
  223. giraffe_llm-0.1.0a1/tests/test_run_limits_final_fixes.py +70 -0
  224. giraffe_llm-0.1.0a1/tests/test_run_limits_forms.py +46 -0
  225. giraffe_llm-0.1.0a1/tests/test_run_limits_models.py +187 -0
  226. giraffe_llm-0.1.0a1/tests/test_run_limits_phase3_config.py +314 -0
  227. giraffe_llm-0.1.0a1/tests/test_run_limits_phase3_defaults.py +45 -0
  228. giraffe_llm-0.1.0a1/tests/test_run_limits_phase3_runtime.py +178 -0
  229. giraffe_llm-0.1.0a1/tests/test_run_limits_phase3_workloads.py +341 -0
  230. giraffe_llm-0.1.0a1/tests/test_run_limits_phase4_integration.py +171 -0
  231. giraffe_llm-0.1.0a1/tests/test_run_limits_phase4_latency.py +289 -0
  232. giraffe_llm-0.1.0a1/tests/test_run_limits_phase4_open_files.py +215 -0
  233. giraffe_llm-0.1.0a1/tests/test_run_limits_phase4_planning.py +627 -0
  234. giraffe_llm-0.1.0a1/tests/test_run_limits_phase5_errors.py +297 -0
  235. giraffe_llm-0.1.0a1/tests/test_run_limits_phase5_traffic.py +146 -0
  236. giraffe_llm-0.1.0a1/tests/test_run_limits_phase5_ui.py +142 -0
  237. giraffe_llm-0.1.0a1/tests/test_run_limits_phase6_capabilities.py +87 -0
  238. giraffe_llm-0.1.0a1/tests/test_run_limits_phase6_forms.py +167 -0
  239. giraffe_llm-0.1.0a1/tests/test_run_limits_phase6_qa.py +116 -0
  240. giraffe_llm-0.1.0a1/tests/test_run_limits_phase6_ui.py +475 -0
  241. giraffe_llm-0.1.0a1/tests/test_run_limits_phase7_caps.py +184 -0
  242. giraffe_llm-0.1.0a1/tests/test_run_limits_planning.py +110 -0
  243. giraffe_llm-0.1.0a1/tests/test_run_limits_pooling.py +340 -0
  244. giraffe_llm-0.1.0a1/tests/test_run_limits_runtime.py +332 -0
  245. giraffe_llm-0.1.0a1/tests/test_run_limits_web_baseline.py +225 -0
  246. giraffe_llm-0.1.0a1/tests/test_runner.py +2339 -0
  247. giraffe_llm-0.1.0a1/tests/test_schedule_observations.py +59 -0
  248. giraffe_llm-0.1.0a1/tests/test_scoring_reliability.py +188 -0
  249. giraffe_llm-0.1.0a1/tests/test_session_api_key_ui.py +85 -0
  250. giraffe_llm-0.1.0a1/tests/test_session_api_keys.py +199 -0
  251. giraffe_llm-0.1.0a1/tests/test_session_performance.py +148 -0
  252. giraffe_llm-0.1.0a1/tests/test_setup_end_to_end.py +149 -0
  253. giraffe_llm-0.1.0a1/tests/test_setup_flow.py +299 -0
  254. giraffe_llm-0.1.0a1/tests/test_sglang.py +115 -0
  255. giraffe_llm-0.1.0a1/tests/test_sglang_cancellation.py +332 -0
  256. giraffe_llm-0.1.0a1/tests/test_storage.py +407 -0
  257. giraffe_llm-0.1.0a1/tests/test_storage_cli.py +183 -0
  258. giraffe_llm-0.1.0a1/tests/test_storage_cli_regressions.py +187 -0
  259. giraffe_llm-0.1.0a1/tests/test_storage_followup.py +269 -0
  260. giraffe_llm-0.1.0a1/tests/test_storage_footprint.py +256 -0
  261. giraffe_llm-0.1.0a1/tests/test_storage_reporting.py +131 -0
  262. giraffe_llm-0.1.0a1/tests/test_storage_review.py +379 -0
  263. giraffe_llm-0.1.0a1/tests/test_storage_ui_regressions.py +70 -0
  264. giraffe_llm-0.1.0a1/tests/test_storage_web.py +185 -0
  265. giraffe_llm-0.1.0a1/tests/test_storage_web_regressions.py +207 -0
  266. giraffe_llm-0.1.0a1/tests/test_timing.py +108 -0
  267. giraffe_llm-0.1.0a1/tests/test_tokenizer_setup.py +364 -0
  268. giraffe_llm-0.1.0a1/tests/test_tool_choice.py +393 -0
  269. giraffe_llm-0.1.0a1/tests/test_tool_condition_revisions.py +73 -0
  270. giraffe_llm-0.1.0a1/tests/test_tool_contract.py +388 -0
  271. giraffe_llm-0.1.0a1/tests/test_tool_conversations.py +449 -0
  272. giraffe_llm-0.1.0a1/tests/test_traffic.py +492 -0
  273. giraffe_llm-0.1.0a1/tests/test_traffic_reporting.py +442 -0
  274. giraffe_llm-0.1.0a1/tests/test_ui_condition_fixes.py +82 -0
  275. giraffe_llm-0.1.0a1/tests/test_ui_condition_polish.py +74 -0
  276. giraffe_llm-0.1.0a1/tests/test_ui_conditions.py +290 -0
  277. giraffe_llm-0.1.0a1/tests/test_ui_forms.py +1419 -0
  278. giraffe_llm-0.1.0a1/tests/test_ui_legacy_condition_scope.py +15 -0
  279. giraffe_llm-0.1.0a1/tests/test_ui_live_stability.py +320 -0
  280. giraffe_llm-0.1.0a1/tests/test_ui_navigation.py +339 -0
  281. giraffe_llm-0.1.0a1/tests/test_ui_performance.py +298 -0
  282. giraffe_llm-0.1.0a1/tests/test_ui_performance_axes.py +43 -0
  283. giraffe_llm-0.1.0a1/tests/test_ui_performance_polish.py +103 -0
  284. giraffe_llm-0.1.0a1/tests/test_ui_performance_structured.py +89 -0
  285. giraffe_llm-0.1.0a1/tests/test_ui_phasec_integration.py +63 -0
  286. giraffe_llm-0.1.0a1/tests/test_ui_report_tabs.py +326 -0
  287. giraffe_llm-0.1.0a1/tests/test_ui_review53_latest.py +218 -0
  288. giraffe_llm-0.1.0a1/tests/test_ux_catalogue.py +345 -0
  289. giraffe_llm-0.1.0a1/tests/test_ux_check_editors.py +317 -0
  290. giraffe_llm-0.1.0a1/tests/test_ux_resources.py +104 -0
  291. giraffe_llm-0.1.0a1/tests/test_ux_results.py +397 -0
  292. giraffe_llm-0.1.0a1/tests/test_ux_review.py +211 -0
  293. giraffe_llm-0.1.0a1/tests/test_ux_setup.py +482 -0
  294. giraffe_llm-0.1.0a1/tests/test_ux_storage.py +155 -0
  295. giraffe_llm-0.1.0a1/tests/test_ux_workbench.py +213 -0
  296. giraffe_llm-0.1.0a1/tests/test_validation_assess.py +254 -0
  297. giraffe_llm-0.1.0a1/tests/test_validation_driver.py +519 -0
  298. giraffe_llm-0.1.0a1/tests/test_validation_endpoint.py +304 -0
  299. giraffe_llm-0.1.0a1/tests/test_validation_external_timing.py +249 -0
  300. giraffe_llm-0.1.0a1/tests/test_validation_packet_analysis.py +249 -0
  301. giraffe_llm-0.1.0a1/tests/test_validation_reporting.py +82 -0
  302. giraffe_llm-0.1.0a1/tests/test_validation_scenarios.py +78 -0
  303. giraffe_llm-0.1.0a1/tests/test_validation_timing_analysis.py +195 -0
  304. giraffe_llm-0.1.0a1/tests/test_validation_timing_observer.py +335 -0
  305. giraffe_llm-0.1.0a1/tests/test_validation_verifier.py +1429 -0
  306. giraffe_llm-0.1.0a1/tests/test_web.py +1021 -0
  307. giraffe_llm-0.1.0a1/tests/test_web_preparation_history.py +58 -0
  308. giraffe_llm-0.1.0a1/tests/test_workload_reliability.py +452 -0
  309. giraffe_llm-0.1.0a1/tests/test_workloads.py +611 -0
  310. giraffe_llm-0.1.0a1/tests/ui_dom.mjs +78 -0
  311. giraffe_llm-0.1.0a1/uv.lock +2025 -0
  312. giraffe_llm-0.1.0a1/validation_suite/__init__.py +3 -0
  313. giraffe_llm-0.1.0a1/validation_suite/__main__.py +3 -0
  314. giraffe_llm-0.1.0a1/validation_suite/assess.py +333 -0
  315. giraffe_llm-0.1.0a1/validation_suite/baseline.py +481 -0
  316. giraffe_llm-0.1.0a1/validation_suite/driver.py +1341 -0
  317. giraffe_llm-0.1.0a1/validation_suite/endpoint.py +464 -0
  318. giraffe_llm-0.1.0a1/validation_suite/external_timing.py +242 -0
  319. giraffe_llm-0.1.0a1/validation_suite/packet_analysis.py +373 -0
  320. giraffe_llm-0.1.0a1/validation_suite/packet_capture.py +142 -0
  321. giraffe_llm-0.1.0a1/validation_suite/packet_control.py +105 -0
  322. giraffe_llm-0.1.0a1/validation_suite/packet_five_minute.py +123 -0
  323. giraffe_llm-0.1.0a1/validation_suite/packet_index.py +59 -0
  324. giraffe_llm-0.1.0a1/validation_suite/packet_study.py +166 -0
  325. giraffe_llm-0.1.0a1/validation_suite/report.schema.json +1028 -0
  326. giraffe_llm-0.1.0a1/validation_suite/report_fields.json +470 -0
  327. giraffe_llm-0.1.0a1/validation_suite/reporting.py +182 -0
  328. giraffe_llm-0.1.0a1/validation_suite/scenarios.py +358 -0
  329. giraffe_llm-0.1.0a1/validation_suite/timing_analysis.py +511 -0
  330. giraffe_llm-0.1.0a1/validation_suite/timing_observer.py +809 -0
  331. giraffe_llm-0.1.0a1/validation_suite/verifier.py +2030 -0
  332. giraffe_llm-0.1.0a1/validation_suite/wire.py +207 -0
@@ -0,0 +1,8 @@
1
+ .git
2
+ .venv
3
+ research
4
+ runs
5
+ tests
6
+ **/__pycache__
7
+ .pytest_cache
8
+ .ruff_cache
@@ -0,0 +1,2 @@
1
+ # Either owner may approve any change, including changes to this file.
2
+ * @aiswarya797 @0dust
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "main requires owner approval",
3
+ "target": "branch",
4
+ "enforcement": "active",
5
+ "bypass_actors": [],
6
+ "conditions": {
7
+ "ref_name": {
8
+ "include": ["refs/heads/main"],
9
+ "exclude": []
10
+ }
11
+ },
12
+ "rules": [
13
+ {"type": "deletion"},
14
+ {"type": "non_fast_forward"},
15
+ {
16
+ "type": "pull_request",
17
+ "parameters": {
18
+ "required_approving_review_count": 1,
19
+ "require_code_owner_review": true,
20
+ "dismiss_stale_reviews_on_push": true,
21
+ "require_last_push_approval": false,
22
+ "required_review_thread_resolution": false
23
+ }
24
+ }
25
+ ]
26
+ }
@@ -0,0 +1,32 @@
1
+ """Render pytest's JUnit results in the Actions job summary."""
2
+
3
+ import sys
4
+ from html import escape
5
+ from pathlib import Path
6
+ from xml.etree import ElementTree
7
+
8
+
9
+ def summarize(path):
10
+ print("## pytest results\n")
11
+ if not path.exists():
12
+ print("No test-results file was produced. Check the setup and pytest step logs; coverage is unknown.")
13
+ return
14
+ cases = ElementTree.parse(path).findall(".//testcase")
15
+ counts = {kind: sum(case.find(kind) is not None for case in cases)
16
+ for kind in ("failure", "error", "skipped")}
17
+ print(f"{len(cases)} cases · {counts['failure']} failed · {counts['error']} errors · {counts['skipped']} skipped\n")
18
+ for kind, title in (("failure", "Failures"), ("error", "Errors"), ("skipped", "Skipped coverage")):
19
+ if not counts[kind]:
20
+ continue
21
+ print(f"### {title}\n\n<pre>")
22
+ for case in cases:
23
+ detail = case.find(kind)
24
+ if detail is not None:
25
+ name = f"{case.get('classname', '')}::{case.get('name', '')}"
26
+ print(escape(name))
27
+ print(escape(detail.get("message", "See pytest logs")[:1000]))
28
+ print("</pre>\n")
29
+
30
+
31
+ if __name__ == "__main__":
32
+ summarize(Path(sys.argv[1]))
@@ -0,0 +1,51 @@
1
+ """Exercise a wheel installed in a fresh environment, outside the checkout."""
2
+
3
+ import asyncio
4
+ from importlib import metadata, resources
5
+ from pathlib import Path
6
+ import subprocess
7
+ import sys
8
+ import sysconfig
9
+ import tempfile
10
+
11
+ import giraffe
12
+ import httpx
13
+ from giraffe.web import create_app
14
+
15
+
16
+ async def main():
17
+ package = Path(giraffe.__file__).resolve()
18
+ if not package.is_relative_to(Path(sys.prefix).resolve()):
19
+ raise RuntimeError(f"Smoke test imported source instead of the installed wheel: {package}")
20
+ installed = metadata.distribution("giraffe-llm")
21
+ if installed.version != giraffe.__version__:
22
+ raise RuntimeError("Distribution and runtime versions disagree")
23
+ entries = {e.name: e.value for e in installed.entry_points if e.group == "console_scripts"}
24
+ if entries.get("giraffe") != "giraffe.cli:main":
25
+ raise RuntimeError("The giraffe command is missing or points to the wrong entry point")
26
+ command = Path(sysconfig.get_path("scripts")) / "giraffe"
27
+ subprocess.run([str(command), "--help"], check=True, timeout=30)
28
+ static = resources.files("giraffe").joinpath("static")
29
+ with tempfile.TemporaryDirectory() as directory:
30
+ app = create_app(Path(directory) / "runs")
31
+ async with httpx.AsyncClient(
32
+ transport=httpx.ASGITransport(app=app), base_url="http://localhost"
33
+ ) as client:
34
+ response = await client.get("/")
35
+ response.raise_for_status()
36
+ if "<!doctype html>" not in response.text.lower():
37
+ raise RuntimeError("Installed UI did not serve its HTML page")
38
+ for name in (
39
+ "app.js", "form-config.mjs", "styles.css",
40
+ "fonts/Geist-Variable.woff2", "fonts/GeistMono-Variable.woff2", "fonts/OFL.txt",
41
+ ):
42
+ expected = static.joinpath(name).read_bytes()
43
+ response = await client.get(f"/static/{name}")
44
+ response.raise_for_status()
45
+ if not expected or response.content != expected:
46
+ raise RuntimeError(f"Installed UI asset is missing or corrupted: {name}")
47
+ print(f"Installed giraffe-llm {installed.version}: CLI and UI assets passed")
48
+
49
+
50
+ if __name__ == "__main__":
51
+ asyncio.run(main())
@@ -0,0 +1,41 @@
1
+ """Validate release identity before building any publishable distributions."""
2
+
3
+ import ast
4
+ import os
5
+ import subprocess
6
+ import tomllib
7
+ from pathlib import Path
8
+
9
+
10
+ def validate_release(root: Path, event_name: str, ref_name: str) -> None:
11
+ with (root / "pyproject.toml").open("rb") as file:
12
+ version = tomllib.load(file)["project"]["version"]
13
+ module = ast.parse((root / "src/giraffe/__init__.py").read_text())
14
+ package_version = next(
15
+ (
16
+ ast.literal_eval(node.value)
17
+ for node in module.body
18
+ if isinstance(node, ast.Assign)
19
+ and any(isinstance(target, ast.Name) and target.id == "__version__"
20
+ for target in node.targets)
21
+ ),
22
+ None,
23
+ )
24
+ if version != package_version:
25
+ raise ValueError("pyproject.toml and giraffe.__version__ versions must match")
26
+ if event_name == "workflow_dispatch" and ref_name != "main":
27
+ raise ValueError("TestPyPI dispatch must use main")
28
+ if event_name == "release":
29
+ if ref_name != f"v{version}":
30
+ raise ValueError(f"Release tag must be v{version}")
31
+ ancestry = subprocess.run(
32
+ ["git", "merge-base", "--is-ancestor", "HEAD", "refs/remotes/origin/main"],
33
+ cwd=root,
34
+ check=False,
35
+ )
36
+ if ancestry.returncode != 0:
37
+ raise ValueError("Release commit must be reachable from origin/main")
38
+
39
+
40
+ if __name__ == "__main__":
41
+ validate_release(Path.cwd(), os.environ["GITHUB_EVENT_NAME"], os.environ["GITHUB_REF_NAME"])
@@ -0,0 +1,55 @@
1
+ name: Checks
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ concurrency:
12
+ group: checks-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ lint:
17
+ name: Ruff
18
+ runs-on: ubuntu-24.04
19
+ timeout-minutes: 10
20
+ steps:
21
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
22
+ with:
23
+ persist-credentials: false
24
+ - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
25
+ with:
26
+ version: '0.13.5'
27
+ python-version: '3.12'
28
+ - run: uv sync --frozen --extra dev
29
+ - run: uv run --no-sync ruff check .
30
+
31
+ test:
32
+ name: pytest (Python 3.12, Node 22)
33
+ runs-on: ubuntu-24.04
34
+ timeout-minutes: 30
35
+ env:
36
+ HF_HUB_OFFLINE: '1'
37
+ TRANSFORMERS_OFFLINE: '1'
38
+ steps:
39
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
40
+ with:
41
+ persist-credentials: false
42
+ - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
43
+ with:
44
+ node-version: '22'
45
+ package-manager-cache: false
46
+ - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
47
+ with:
48
+ version: '0.13.5'
49
+ python-version: '3.12'
50
+ - run: uv sync --frozen --extra dev --extra sglang-tracing
51
+ - name: Run tests, including Node browser behavior checks
52
+ run: uv run --no-sync python -m pytest -q -ra --tb=short --junitxml="$RUNNER_TEMP/pytest.xml"
53
+ - name: Summarize failures and skipped coverage
54
+ if: always()
55
+ run: python3 .github/scripts/pytest_summary.py "$RUNNER_TEMP/pytest.xml" >> "$GITHUB_STEP_SUMMARY"
@@ -0,0 +1,101 @@
1
+ name: Publish package
2
+
3
+ on:
4
+ pull_request:
5
+ release:
6
+ types: [published]
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ # Never cancel a run while it may be uploading an immutable package version.
13
+ concurrency:
14
+ group: publish-${{ github.ref }}
15
+ cancel-in-progress: false
16
+
17
+ jobs:
18
+ build:
19
+ name: Build and verify distributions
20
+ if: github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/main'
21
+ runs-on: ubuntu-24.04
22
+ timeout-minutes: 30
23
+ env:
24
+ HF_HUB_OFFLINE: '1'
25
+ TRANSFORMERS_OFFLINE: '1'
26
+ steps:
27
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
28
+ with:
29
+ fetch-depth: 0
30
+ persist-credentials: false
31
+ - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
32
+ with:
33
+ version: '0.13.5'
34
+ python-version: '3.12'
35
+ - name: Validate version and release source
36
+ run: python3 .github/scripts/validate_release.py
37
+ - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
38
+ if: github.event_name != 'pull_request'
39
+ with:
40
+ node-version: '22'
41
+ package-manager-cache: false
42
+ - run: uv sync --locked --group release --extra dev --extra sglang-tracing
43
+ - name: Check release source
44
+ if: github.event_name != 'pull_request'
45
+ run: |
46
+ uv run --no-sync ruff check .
47
+ uv run --no-sync python -m pytest -q -ra --tb=short
48
+ - name: Build source distribution and wheel from it
49
+ run: uv run --no-sync python -m build --no-isolation
50
+ - name: Validate package metadata
51
+ run: uv run --no-sync twine check --strict dist/*
52
+ - name: Test installed wheel outside the source checkout
53
+ run: |
54
+ uv venv "$RUNNER_TEMP/package-smoke"
55
+ uv pip install --python "$RUNNER_TEMP/package-smoke/bin/python" dist/*.whl
56
+ cd "$RUNNER_TEMP"
57
+ "$RUNNER_TEMP/package-smoke/bin/python" "$GITHUB_WORKSPACE/.github/scripts/smoke_package.py"
58
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
59
+ with:
60
+ name: package-distributions
61
+ path: dist/
62
+ if-no-files-found: error
63
+ retention-days: 7
64
+
65
+ publish-pypi:
66
+ name: Publish to PyPI
67
+ needs: build
68
+ if: github.repository == '0dust/giraffe' && github.event_name == 'release'
69
+ runs-on: ubuntu-24.04
70
+ timeout-minutes: 10
71
+ environment:
72
+ name: pypi
73
+ url: https://pypi.org/project/giraffe-llm/
74
+ permissions:
75
+ id-token: write
76
+ steps:
77
+ - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
78
+ with:
79
+ name: package-distributions
80
+ path: dist/
81
+ - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
82
+
83
+ publish-testpypi:
84
+ name: Publish to TestPyPI
85
+ needs: build
86
+ if: github.repository == '0dust/giraffe' && github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
87
+ runs-on: ubuntu-24.04
88
+ timeout-minutes: 10
89
+ environment:
90
+ name: testpypi
91
+ url: https://test.pypi.org/project/giraffe-llm/
92
+ permissions:
93
+ id-token: write
94
+ steps:
95
+ - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
96
+ with:
97
+ name: package-distributions
98
+ path: dist/
99
+ - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
100
+ with:
101
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,22 @@
1
+ .venv/
2
+ __pycache__/
3
+ .pytest_cache/
4
+ .ruff_cache/
5
+ *.egg-info/
6
+ dist/
7
+ build/
8
+ runs/
9
+ .env
10
+ .DS_Store
11
+ # Private research stays local; it is not part of the distributable product.
12
+ research/
13
+ # Local planning and review artifacts stay out of version control.
14
+ docs/plans/
15
+ docs/reviews/
16
+ .brooks-lint-history.json
17
+
18
+ # Local engine-validation notebooks and tooling.
19
+ /examples/colab/
20
+
21
+ # Local reliability implementation brief.
22
+ /task.md
@@ -0,0 +1,146 @@
1
+ # Contributing
2
+
3
+ Create a branch and open a pull request targeting `main`. Every change requires
4
+ approval from either `@aiswarya797` or `@0dust` before merging. This includes
5
+ changes to the license, code owners, and repository rules. Authors cannot approve
6
+ their own pull requests; a pull request by either owner needs the other owner's
7
+ approval. Pushes that change the diff invalidate earlier approvals.
8
+
9
+ ## Activate enforcement (repository admin)
10
+
11
+ The CODEOWNERS file selects reviewers. It does not enforce approvals on its own.
12
+ The JSON file below is a ruleset configuration; committing it does not activate
13
+ GitHub enforcement.
14
+
15
+ Review and merge the pull request adding `.github/CODEOWNERS`, then apply the
16
+ ruleset from the repository root while authenticated as a repository admin:
17
+
18
+ ```sh
19
+ gh api --method POST repos/0dust/giraffe/rulesets \
20
+ --input .github/main-ruleset.json
21
+ gh api repos/0dust/giraffe/rules/branches/main
22
+ ```
23
+
24
+ Alternatively, import `.github/main-ruleset.json` under Settings → Rules →
25
+ Rulesets. Keep enforcement **Active** and the bypass list empty. The ruleset
26
+ requires pull requests with one code-owner approval and blocks force pushes and
27
+ deletion of `main`, including for administrators. An administrator can still
28
+ edit repository settings.
29
+
30
+ If the ruleset already exists, update it instead of creating a duplicate:
31
+
32
+ ```sh
33
+ gh api repos/0dust/giraffe/rulesets
34
+ gh api --method PUT repos/0dust/giraffe/rulesets/RULESET_ID \
35
+ --input .github/main-ruleset.json
36
+ ```
37
+
38
+ ## Automated checks
39
+
40
+ Pull requests and pushes to `main` run separate Ruff and pytest checks. CI uses
41
+ Python 3.12 because the validation observer tests require `sys.monitoring`, plus
42
+ Node 22 for browser behavior tests. Dependencies come from `uv.lock`:
43
+
44
+ ```sh
45
+ uv sync --frozen --extra dev --extra sglang-tracing --python 3.12
46
+ uv run --no-sync ruff check .
47
+ uv run --no-sync python -m pytest -q -ra --tb=short
48
+ ```
49
+
50
+ Tests use fake/local endpoints and require no LLM service, GPU or repository
51
+ secrets. CI disables Hugging Face downloads. Optional browser layout checks and
52
+ an uncached tokenizer integration may skip; the job summary lists their names
53
+ and reasons, and pytest logs retain full failure output. Skips are untested
54
+ coverage, not passes. This workflow does not activate branch-protection rules.
55
+
56
+ ## Publish a release
57
+
58
+ The distribution is `giraffe-llm`; its import and command remain `giraffe`.
59
+ `.github/workflows/publish.yml` builds on pull requests without publishing.
60
+ A manual run from `main` publishes to TestPyPI; publishing a GitHub release
61
+ publishes to PyPI. Neither path uses a stored API token.
62
+
63
+ ### One-time account setup
64
+
65
+ Create separate [PyPI](https://pypi.org/account/register/) and
66
+ [TestPyPI](https://test.pypi.org/account/register/) accounts, verify your email,
67
+ and enable two-factor authentication. Save recovery codes securely.
68
+
69
+ Add a pending GitHub trusted publisher under each account's **Publishing** page:
70
+ [PyPI](https://pypi.org/manage/account/publishing/) and
71
+ [TestPyPI](https://test.pypi.org/manage/account/publishing/).
72
+
73
+ | Field | PyPI | TestPyPI |
74
+ | --- | --- | --- |
75
+ | Project name | `giraffe-llm` | `giraffe-llm` |
76
+ | Owner | `0dust` | `0dust` |
77
+ | Repository | `giraffe` | `giraffe` |
78
+ | Workflow filename | `publish.yml` | `publish.yml` |
79
+ | Environment | `pypi` | `testpypi` |
80
+
81
+ These names must match exactly. A pending publisher creates the project only
82
+ when its first upload succeeds; it does not reserve the name. After that first
83
+ upload, manage it under the project's **Publishing** settings.
84
+
85
+ In GitHub **Settings → Environments**, maintain these protections:
86
+
87
+ - `pypi`: selected deployment tags `v*` only.
88
+ - `testpypi`: selected deployment branch `main` only.
89
+ - Both: approval from `0dust` or `aiswarya797`, prevent self-review, and disallow
90
+ administrator bypass. The person who starts a release needs the other owner
91
+ to approve its publishing job.
92
+
93
+ Environment settings are configured in GitHub, not enforced by this file.
94
+ Keep them in place before registering the trusted publishers.
95
+
96
+ ### Rehearse, then publish
97
+
98
+ 1. Update the version in `pyproject.toml` and `src/giraffe/__init__.py` together,
99
+ run `uv lock`, and merge the reviewed change. For the first alpha, both are
100
+ `0.1.0a1`. Keep the README version badge in sync when changing versions.
101
+ 2. Run **Actions → Publish package → Run workflow** on `main`. The workflow
102
+ checks versions, runs Ruff and pytest, builds a source archive and a wheel
103
+ from that archive, validates metadata, and checks the installed CLI and UI
104
+ assets in a fresh environment. Approve the `testpypi` deployment after
105
+ reviewing its commit and results.
106
+ 3. In a fresh virtual environment, download just Giraffe from TestPyPI, then
107
+ install that wheel with dependencies from the normal PyPI index:
108
+
109
+ ```sh
110
+ python -m pip download --no-deps --only-binary=:all: \
111
+ --index-url https://test.pypi.org/simple/ --dest test-dist \
112
+ "giraffe-llm==0.1.0a1"
113
+ python -m pip install test-dist/giraffe_llm-0.1.0a1-py3-none-any.whl
114
+ giraffe --help
115
+ giraffe ui
116
+ ```
117
+
118
+ Open the UI and confirm it loads. Avoid combining TestPyPI and PyPI with
119
+ `--extra-index-url`; dependencies should come from the normal PyPI index.
120
+ 4. Create a GitHub release tagged `v0.1.0a1` at the same tested commit on `main`
121
+ and mark this alpha as a prerelease. Publishing the release reruns verification
122
+ and waits for approval of the `pypi` deployment. A draft release does not upload.
123
+ 5. After upload, verify `python -m pip install "giraffe-llm==0.1.0a1"` and the CLI
124
+ in another fresh environment. Then update README installation instructions
125
+ to use the published package.
126
+
127
+ Use a new version for changed artifacts; uploaded distribution filenames cannot
128
+ be reused. Upload failures remain failures instead of silently skipping existing
129
+ files. Inspect the registry before retrying a partially completed upload.
130
+
131
+ Publishing jobs download only the distributions built in that run. They do not
132
+ check out or execute repository code, and only those jobs receive `id-token:
133
+ write`. Build tooling is pinned in the `release` dependency group and `uv.lock`;
134
+ GitHub Actions are pinned to commit SHAs. PyPI's publish action also produces
135
+ attestations through Trusted Publishing.
136
+
137
+ For local package verification:
138
+
139
+ ```sh
140
+ uv sync --locked --group release --extra dev --extra sglang-tracing --python 3.12
141
+ uv run --no-sync python -m build --no-isolation
142
+ uv run --no-sync twine check --strict dist/*
143
+ ```
144
+
145
+ See [PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/) and
146
+ [its security guidance](https://docs.pypi.org/trusted-publishers/security-model/).
@@ -0,0 +1,7 @@
1
+ FROM python:3.12-slim
2
+ WORKDIR /app
3
+ COPY pyproject.toml README.md LICENSE ./
4
+ COPY src ./src
5
+ RUN pip install --no-cache-dir .
6
+ WORKDIR /work
7
+ ENTRYPOINT ["giraffe"]