orbi-cli 0.7.51__tar.gz → 0.7.52__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 (292) hide show
  1. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/PKG-INFO +1 -1
  2. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/pyproject.toml +1 -1
  3. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/__init__.py +1 -1
  4. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/draft.py +129 -34
  5. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/failure.py +22 -21
  6. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/failure_report.py +35 -21
  7. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/language_failure.py +19 -0
  8. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/pi_process.py +21 -23
  9. orbi_cli-0.7.52/src/orbi/provider_balance.py +107 -0
  10. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/suggest.py +52 -55
  11. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi_cli.egg-info/PKG-INFO +1 -1
  12. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi_cli.egg-info/SOURCES.txt +3 -0
  13. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_bootstrap_delivery.py +43 -1
  14. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_bootstrap_pi.py +80 -1
  15. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_draft.py +34 -1
  16. orbi_cli-0.7.52/tests/test_draft_repo_view.py +241 -0
  17. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_failure.py +173 -3
  18. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_fix_needed_loop.py +33 -1
  19. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_suggest.py +3 -0
  20. orbi_cli-0.7.52/tests/test_suggest_repo_view.py +181 -0
  21. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/LICENSE +0 -0
  22. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/README.md +0 -0
  23. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/docs/licenses/sustainable-use-license.md +0 -0
  24. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/setup.cfg +0 -0
  25. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/acceptance_section.py +0 -0
  26. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/amend_command.py +0 -0
  27. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/answer.py +0 -0
  28. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/base_ci_fix.py +0 -0
  29. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/base_ci_red.py +0 -0
  30. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/blocked_comment.py +0 -0
  31. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/blocked_record.py +0 -0
  32. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/blocked_scan.py +0 -0
  33. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/body_steering.py +0 -0
  34. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/branch_reclaim.py +0 -0
  35. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/check_permission.py +0 -0
  36. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/checks.py +0 -0
  37. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/claim.py +0 -0
  38. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/clarify.py +0 -0
  39. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/clarify_proposal.py +0 -0
  40. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/clarify_stop.py +0 -0
  41. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/cli.py +0 -0
  42. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/cli_commands.py +0 -0
  43. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/cli_doctor.py +0 -0
  44. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/cli_parser.py +0 -0
  45. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/cli_source.py +0 -0
  46. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/cli_status.py +0 -0
  47. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/cli_ticket_command.py +0 -0
  48. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/command_line.py +0 -0
  49. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/comment_kind.py +0 -0
  50. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/comment_rest_id.py +0 -0
  51. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/comment_trust.py +0 -0
  52. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/config.py +0 -0
  53. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/config_hint.py +0 -0
  54. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/delivery_comment.py +0 -0
  55. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/delivery_labels.py +0 -0
  56. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/delivery_push.py +0 -0
  57. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/delivery_scene.py +0 -0
  58. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/draft_cli.py +0 -0
  59. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/draft_document.py +0 -0
  60. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/draft_marker.py +0 -0
  61. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/engine_source.py +0 -0
  62. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/example_config.toml +0 -0
  63. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/extensions/clarify_verdict.ts +0 -0
  64. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/extensions/draft_tools.ts +0 -0
  65. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/failure_evidence.py +0 -0
  66. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/gh_response.py +0 -0
  67. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/git_identity.py +0 -0
  68. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/git_transport.py +0 -0
  69. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/github.py +0 -0
  70. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/github_feedback.py +0 -0
  71. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/gitops.py +0 -0
  72. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/human_review.py +0 -0
  73. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/implementation_delivery.py +0 -0
  74. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/journal.py +0 -0
  75. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/language.py +0 -0
  76. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/language_terms.py +0 -0
  77. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/language_terms_criteria.py +0 -0
  78. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/language_terms_fix.py +0 -0
  79. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/launchd_deploy.py +0 -0
  80. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/merge_blocked.py +0 -0
  81. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/merge_exec.py +0 -0
  82. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/merge_gate.py +0 -0
  83. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/merge_handoff.py +0 -0
  84. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/milestone.py +0 -0
  85. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/milestone_command.py +0 -0
  86. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/milestone_errors.py +0 -0
  87. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/notify.py +0 -0
  88. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/ops_delivery.py +0 -0
  89. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/pi_activity.py +0 -0
  90. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/pi_command.py +0 -0
  91. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/pi_exec.py +0 -0
  92. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/pi_idle.py +0 -0
  93. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/pi_recovery.py +0 -0
  94. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/pi_session.py +0 -0
  95. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/pi_stream_log.py +0 -0
  96. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/pilot_setup.py +0 -0
  97. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/pilot_slots.py +0 -0
  98. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/pr_head_sync.py +0 -0
  99. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/pr_verification.py +0 -0
  100. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/progress.py +0 -0
  101. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/progress_display.py +0 -0
  102. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/progress_outcome.py +0 -0
  103. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/progress_summary.py +0 -0
  104. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/question.py +0 -0
  105. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/release.py +0 -0
  106. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/release_closeout.py +0 -0
  107. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/release_comments.py +0 -0
  108. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/release_declaration.py +0 -0
  109. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/release_git.py +0 -0
  110. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/release_notes.py +0 -0
  111. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/release_run.py +0 -0
  112. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/repo_config.py +0 -0
  113. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/requeue.py +0 -0
  114. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/restart_scan.py +0 -0
  115. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/resume_scan.py +0 -0
  116. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/resume_verification.py +0 -0
  117. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/review_merge.py +0 -0
  118. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/review_rounds.py +0 -0
  119. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/review_verdict.py +0 -0
  120. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/run_fields.py +0 -0
  121. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/run_state.py +0 -0
  122. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/runner.py +0 -0
  123. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/runner_health.py +0 -0
  124. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/runner_marker.py +0 -0
  125. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/runner_source.py +0 -0
  126. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/scene.py +0 -0
  127. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/scheduler.py +0 -0
  128. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/scheduler_units.py +0 -0
  129. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/session_command.py +0 -0
  130. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/setup_checks.py +0 -0
  131. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/setup_config.py +0 -0
  132. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/source_pool.py +0 -0
  133. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/split_apply.py +0 -0
  134. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/split_command.py +0 -0
  135. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/status_observe.py +0 -0
  136. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/steering.py +0 -0
  137. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/stopped_scans.py +0 -0
  138. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/systemd_deploy.py +0 -0
  139. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/terminal_stops.py +0 -0
  140. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/tick_reads.py +0 -0
  141. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/ticket_command.py +0 -0
  142. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/ticket_command_registry.py +0 -0
  143. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/ticket_criteria.py +0 -0
  144. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/user_summary.py +0 -0
  145. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi/worktree_retention.py +0 -0
  146. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi_cli.egg-info/dependency_links.txt +0 -0
  147. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi_cli.egg-info/entry_points.txt +0 -0
  148. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/src/orbi_cli.egg-info/top_level.txt +0 -0
  149. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_agents_md.py +0 -0
  150. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_amend_command.py +0 -0
  151. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_answer.py +0 -0
  152. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_apply_label_patch.py +0 -0
  153. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_base_branch_failure.py +0 -0
  154. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_base_ci_red.py +0 -0
  155. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_blocked_comment.py +0 -0
  156. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_body_steering.py +0 -0
  157. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_bootstrap_adapters.py +0 -0
  158. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_bootstrap_preflight.py +0 -0
  159. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_bootstrap_release.py +0 -0
  160. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_bootstrap_runner_claim_resume.py +0 -0
  161. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_bootstrap_runner_failure_report.py +0 -0
  162. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_bootstrap_runner_main.py +0 -0
  163. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_bootstrap_runner_milestone.py +0 -0
  164. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_bootstrap_runner_outcome.py +0 -0
  165. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_bootstrap_runner_prompt.py +0 -0
  166. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_bootstrap_runner_reconcile.py +0 -0
  167. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_bootstrap_runner_session.py +0 -0
  168. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_bootstrap_runner_tickets.py +0 -0
  169. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_branch_reclaim.py +0 -0
  170. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_check_permission.py +0 -0
  171. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_ci_failure_issue_workflow.py +0 -0
  172. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_ci_failure_triage.py +0 -0
  173. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_ci_macos_workflow.py +0 -0
  174. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_ci_workflow.py +0 -0
  175. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_clarify.py +0 -0
  176. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_claude_plugin.py +0 -0
  177. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_cli_golden.py +0 -0
  178. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_cli_install.py +0 -0
  179. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_cli_milestone.py +0 -0
  180. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_cli_packaging.py +0 -0
  181. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_cli_source.py +0 -0
  182. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_cli_ticket_commands.py +0 -0
  183. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_command_receipt_contract.py +0 -0
  184. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_comment_identity.py +0 -0
  185. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_comment_readers_contract.py +0 -0
  186. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_comment_rest_id.py +0 -0
  187. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_comment_trust.py +0 -0
  188. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_concurrency_e2e.py +0 -0
  189. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_constitution.py +0 -0
  190. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_coverage_gate.py +0 -0
  191. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_deliver_pr_fakes.py +0 -0
  192. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_delivery_branch_delete.py +0 -0
  193. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_delivery_labels.py +0 -0
  194. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_delivery_scene.py +0 -0
  195. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_docker_docs.py +0 -0
  196. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_docker_entrypoint.py +0 -0
  197. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_docker_image_workflow.py +0 -0
  198. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_docs_i18n.py +0 -0
  199. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_docs_issue_shapes.py +0 -0
  200. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_docs_labels.py +0 -0
  201. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_docs_mermaid.py +0 -0
  202. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_docs_releases.py +0 -0
  203. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_docs_safety_matrix.py +0 -0
  204. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_docs_single_source.py +0 -0
  205. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_docs_site.py +0 -0
  206. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_engine_source.py +0 -0
  207. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_failure_report.py +0 -0
  208. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_gh_read_retry.py +0 -0
  209. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_gh_response.py +0 -0
  210. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_git_base_smoke.py +0 -0
  211. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_git_merge_smoke.py +0 -0
  212. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_git_network_retry.py +0 -0
  213. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_git_transport.py +0 -0
  214. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_github.py +0 -0
  215. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_github_fakes.py +0 -0
  216. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_gitops.py +0 -0
  217. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_gitops_fakes.py +0 -0
  218. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_human_review.py +0 -0
  219. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_import_graph.py +0 -0
  220. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_install_sh.py +0 -0
  221. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_issue_1367.py +0 -0
  222. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_issue_461.py +0 -0
  223. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_issue_template_config.py +0 -0
  224. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_journal.py +0 -0
  225. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_journal_events.py +0 -0
  226. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_launchd_deploy.py +0 -0
  227. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_license.py +0 -0
  228. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_merge_exec_extraction.py +0 -0
  229. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_message_language.py +0 -0
  230. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_milestone_command.py +0 -0
  231. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_notify.py +0 -0
  232. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_ops_e2e.py +0 -0
  233. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_orbi.py +0 -0
  234. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_orbi_dashboard.py +0 -0
  235. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_orbi_exporter.py +0 -0
  236. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_patch_ratchet.py +0 -0
  237. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_pi_activity.py +0 -0
  238. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_pi_child_reap.py +0 -0
  239. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_pi_command.py +0 -0
  240. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_pi_exec.py +0 -0
  241. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_pi_extensions.py +0 -0
  242. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_pi_provider_templates.py +0 -0
  243. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_pi_recovery.py +0 -0
  244. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_pi_session.py +0 -0
  245. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_pilot_setup.py +0 -0
  246. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_pilot_slots.py +0 -0
  247. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_pr_issue_link_workflow.py +0 -0
  248. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_pr_verification.py +0 -0
  249. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_prerequisite_check.py +0 -0
  250. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_progress.py +0 -0
  251. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_progress_wiring.py +0 -0
  252. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_prompt_contract.py +0 -0
  253. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_public_contracts.py +0 -0
  254. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_public_helpers.py +0 -0
  255. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_publish_workflow.py +0 -0
  256. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_question.py +0 -0
  257. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_question_resume.py +0 -0
  258. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_release_docs_workflow.py +0 -0
  259. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_release_extraction.py +0 -0
  260. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_release_ticket_templates.py +0 -0
  261. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_repo_config.py +0 -0
  262. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_resume_continue_e2e.py +0 -0
  263. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_resume_e2e.py +0 -0
  264. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_resume_pr.py +0 -0
  265. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_review_merge.py +0 -0
  266. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_review_verdict.py +0 -0
  267. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_run_artifacts.py +0 -0
  268. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_run_fields.py +0 -0
  269. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_run_id_e2e.py +0 -0
  270. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_run_id_fixture.py +0 -0
  271. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_runner_config.py +0 -0
  272. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_runner_health.py +0 -0
  273. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_runner_source_freshness.py +0 -0
  274. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_scene.py +0 -0
  275. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_scheduler.py +0 -0
  276. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_seam.py +0 -0
  277. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_setup_output_golden.py +0 -0
  278. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_size_ratchet.py +0 -0
  279. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_split_command.py +0 -0
  280. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_src_layout.py +0 -0
  281. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_status_observe.py +0 -0
  282. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_steering_review.py +0 -0
  283. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_suite_hygiene.py +0 -0
  284. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_systemd_deploy.py +0 -0
  285. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_systemd_timer.py +0 -0
  286. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_tick_reads.py +0 -0
  287. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_ticket_command.py +0 -0
  288. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_ticket_command_registration.py +0 -0
  289. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_user_acceptance_contract.py +0 -0
  290. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_user_summary.py +0 -0
  291. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_versioned_comment_block.py +0 -0
  292. {orbi_cli-0.7.51 → orbi_cli-0.7.52}/tests/test_worktree_reclaim.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orbi-cli
3
- Version: 0.7.51
3
+ Version: 0.7.52
4
4
  Summary: Orbi — local AI development worker: claims GitHub Issues, runs Pi in isolated worktrees, and delivers PRs (GitHub Issues + labels are the only state store).
5
5
  Author: xqliu
6
6
  License-Expression: AGPL-3.0-only OR LicenseRef-Sustainable-Use-1.0
@@ -44,7 +44,7 @@ build-backend = "setuptools.build_meta"
44
44
 
45
45
  [project]
46
46
  name = "orbi-cli"
47
- version = "0.7.51"
47
+ version = "0.7.52"
48
48
  description = "Orbi — local AI development worker: claims GitHub Issues, runs Pi in isolated worktrees, and delivers PRs (GitHub Issues + labels are the only state store)."
49
49
  readme = "README.md"
50
50
  requires-python = ">=3.14"
@@ -18,4 +18,4 @@ the package would shadow the installed package for every process with
18
18
  the checkout root on sys.path. The direct-execution compatibility entry
19
19
  is `python3 -m orbi.cli` (development path only).
20
20
  """
21
- __version__ = "0.7.51"
21
+ __version__ = "0.7.52"
@@ -31,9 +31,13 @@ import json
31
31
  import logging
32
32
  import re
33
33
  import subprocess
34
+ from contextlib import contextmanager
34
35
  from pathlib import Path
35
36
 
36
- from orbi import clarify, draft_marker, journal, split_command
37
+ from orbi import (
38
+ clarify, draft_marker, failure, gitops, journal, provider_balance,
39
+ split_command,
40
+ )
37
41
  from orbi.acceptance_section import appended_body, write_body
38
42
  from orbi.claim import _repo_scan_keys
39
43
  from orbi.config import RunnerConfig
@@ -58,8 +62,9 @@ from orbi.draft_document import (
58
62
  taken_message,
59
63
  taken_options,
60
64
  )
65
+ from orbi.failure import failure_detail
61
66
  from orbi.github import edit_issue, issue_view, list_issues, list_milestones
62
- from orbi.journal import event
67
+ from orbi.journal import LOGGER, event, run_command
63
68
  from orbi.pi_command import (
64
69
  IMPLEMENT_EXCLUDED_SKILLS,
65
70
  ROLE_SUGGEST,
@@ -209,6 +214,90 @@ def _round_payload(payload: dict) -> dict:
209
214
  return payload
210
215
 
211
216
 
217
+ DRAFT_VIEW_DIRNAME = "draft-view"
218
+
219
+
220
+ def draft_view_path(repo_dir: Path, run_id: str) -> Path:
221
+ """Where one draft's view of `origin/<base>` lives.
222
+
223
+ Inside the checkout's gitignored `.orbi/` run dirs, so the deployment
224
+ checkout's working tree is never moved (Issue #2276) and no delivery
225
+ worktree ever sees a file it would call dirty.
226
+ """
227
+ return Path(repo_dir) / ".orbi" / DRAFT_VIEW_DIRNAME / run_id
228
+
229
+
230
+ def add_draft_view(repo_dir: Path, base_branch: str, run_id: str) -> Path:
231
+ """Fetch `origin/<base>` under the base-sync lock, then check it out.
232
+
233
+ The detached worktree of the fetched commit IS the drafting session's
234
+ repository view: a delivery never advances the checkout, so its working
235
+ tree can be arbitrarily old. `--detach` keeps the view off every branch,
236
+ so a draft can neither move the checkout nor touch a delivery's
237
+ worktree, and only the fetch writes shared state (the one remote-tracking
238
+ ref the lock guards). `--force` re-creates over the `prunable` entry a
239
+ killed draft left at the same path.
240
+ """
241
+ gitops.fetch_base_ref(repo_dir, base_branch)
242
+ path = draft_view_path(repo_dir, run_id)
243
+ run_command(
244
+ ["git", "worktree", "add", "--detach", "--force", str(path),
245
+ f"origin/{base_branch}"],
246
+ cwd=repo_dir,
247
+ )
248
+ return path
249
+
250
+
251
+ def remove_draft_view(repo_dir: Path, path: Path) -> None:
252
+ """Remove a draft's view; a view already gone is nothing to remove.
253
+
254
+ No `git worktree prune` here: the next view is created with
255
+ `--force`, which re-creates over the `prunable` registration a killed
256
+ draft left behind, while a prune would touch the one `worktrees/`
257
+ registry a delivery running at the same time is writing to.
258
+ """
259
+ if not Path(path).is_dir():
260
+ return
261
+ run_command(
262
+ ["git", "worktree", "remove", "--force", str(path)], cwd=repo_dir,
263
+ )
264
+
265
+
266
+ @contextmanager
267
+ def draft_repo_view(config: RunnerConfig, *, run_id: str):
268
+ """The repository state ONE draft reads (Issue #2276).
269
+
270
+ Yields a detached worktree of `origin/<base_branch>`, fetched at the
271
+ moment the draft starts. The deployment checkout is never advanced —
272
+ deliveries build their worktrees from the remote — so its working tree
273
+ can predate the base by weeks, and a draft that reads it reports
274
+ existing files as missing and cites names the base renamed.
275
+
276
+ A failed fetch FAILS the draft (`draft_failed`): a failed draft is
277
+ recoverable, a stale read is the defect this replaces, so there is no
278
+ fallback to the checkout. The view is removed when the draft ends; the
279
+ checkout and every delivery worktree are never touched.
280
+ """
281
+ repo_dir = Path(config.repo_dir)
282
+ base_branch = config.base_branch
283
+ try:
284
+ view = add_draft_view(repo_dir, base_branch, run_id)
285
+ except (RuntimeError, subprocess.SubprocessError) as exc:
286
+ raise DraftError(
287
+ "draft_failed", f"read the repository at origin/{base_branch}",
288
+ failure_detail(exc),
289
+ ) from exc
290
+ try:
291
+ yield view
292
+ finally:
293
+ try:
294
+ remove_draft_view(repo_dir, view)
295
+ except subprocess.SubprocessError as exc:
296
+ LOGGER.warning(
297
+ "draft view %s could not be removed: %s", view, exc,
298
+ )
299
+
300
+
212
301
  def render_context(payload: dict, *, repo_dir: Path) -> str:
213
302
  """The one context a round hands the session.
214
303
 
@@ -357,7 +446,10 @@ def _run_answer_session(
357
446
  The answer file is removed first, so an answer found after a failure is
358
447
  the one THIS round wrote: a round that timed out after the model wrote
359
448
  its draft still returns that draft, and a round that wrote nothing
360
- fails.
449
+ fails. A model-provider balance refusal is its own code with the plain
450
+ sentence as its detail — never `session_failed` and never the Python
451
+ exception text, which is where the provider's raw payload lives
452
+ (Issue #2278).
361
453
  """
362
454
  out_path.unlink(missing_ok=True)
363
455
  try:
@@ -368,6 +460,11 @@ def _run_answer_session(
368
460
  )
369
461
  except Exception as exc:
370
462
  if not out_path.is_file():
463
+ if provider_balance.is_stop(failure.failure_detail(exc)):
464
+ raise DraftError(
465
+ provider_balance.DRAFT_CODE, "run the drafting session",
466
+ provider_balance.DETAIL,
467
+ ) from exc
371
468
  code = (
372
469
  "timeout"
373
470
  if isinstance(exc, subprocess.TimeoutExpired)
@@ -545,36 +642,38 @@ def run_round(
545
642
  session_root = Path(session_dir).resolve()
546
643
  session_root.mkdir(parents=True, exist_ok=True)
547
644
  out_path = session_root / DRAFT_ANSWER_FILE
548
- payload, answer, taken = _answered_round(
549
- config, repo, session_root=session_root, payload=payload,
550
- out_path=out_path, run_id=run_id,
551
- )
552
- if answer.questions:
645
+ with draft_repo_view(config, run_id=run_id) as repo_view:
646
+ payload, answer, taken = _answered_round(
647
+ config, repo, session_root=session_root, payload=payload,
648
+ out_path=out_path, run_id=run_id, repo_view=repo_view,
649
+ )
650
+ if answer.questions:
651
+ return DraftRound(
652
+ reply=named_in_reply(answer.reply, taken),
653
+ questions=answer.questions,
654
+ )
655
+ if not answer.issues:
656
+ # Issue #2201: a reply-only answer asks for no code change, so
657
+ # neither the fidelity pass nor the pre-work check runs.
658
+ return DraftRound(reply=named_in_reply(answer.reply, taken))
659
+ issues, warning = fidelity_pass(
660
+ config, repo, session_root=session_root, run_id=run_id,
661
+ request=_fidelity_request(payload), issues=answer.issues,
662
+ )
663
+ issues, check, warning, reply = _apply_check(
664
+ config, repo, session_root=session_root, payload=payload,
665
+ run_id=run_id, issues=issues, warning=warning, reply=answer.reply,
666
+ repo_view=repo_view,
667
+ )
553
668
  return DraftRound(
554
- reply=named_in_reply(answer.reply, taken),
555
- questions=answer.questions,
669
+ reply=named_in_reply(reply, taken), issues=issues,
670
+ check=check, warning=warning,
556
671
  )
557
- if not answer.issues:
558
- # Issue #2201: a reply-only answer asks for no code change, so
559
- # neither the fidelity pass nor the pre-work check runs.
560
- return DraftRound(reply=named_in_reply(answer.reply, taken))
561
- issues, warning = fidelity_pass(
562
- config, repo, session_root=session_root, run_id=run_id,
563
- request=_fidelity_request(payload), issues=answer.issues,
564
- )
565
- issues, check, warning, reply = _apply_check(
566
- config, repo, session_root=session_root, payload=payload,
567
- run_id=run_id, issues=issues, warning=warning, reply=answer.reply,
568
- )
569
- return DraftRound(
570
- reply=named_in_reply(reply, taken), issues=issues,
571
- check=check, warning=warning,
572
- )
573
672
 
574
673
 
575
674
  def _answered_round(
576
675
  config: RunnerConfig, repo: str, *, session_root: Path, payload: dict,
577
- out_path: Path, run_id: str,
676
+ out_path: Path, run_id: str, repo_view: Path,
578
677
  ) -> tuple[dict, DraftAnswer, tuple[Option, ...]]:
579
678
  """Run the session until it drafts or asks what only the person can answer.
580
679
 
@@ -592,9 +691,7 @@ def _answered_round(
592
691
  round_payload = {**payload, "message": message, "conversation": turns}
593
692
  _run_answer_session(
594
693
  config, repo, session_root=session_root,
595
- context=render_context(
596
- round_payload, repo_dir=Path(config.repo_dir),
597
- ),
694
+ context=render_context(round_payload, repo_dir=repo_view),
598
695
  out_path=out_path, run_id=run_id,
599
696
  resume=any((session_root / DRAFT_SESSION_DIR).glob("*.jsonl")),
600
697
  )
@@ -622,7 +719,7 @@ def _answered_round(
622
719
  def _apply_check(
623
720
  config: RunnerConfig, repo: str, *, session_root: Path, payload: dict,
624
721
  run_id: str, issues: tuple[DraftIssue, ...], warning: str | None,
625
- reply: str,
722
+ reply: str, repo_view: Path,
626
723
  ) -> tuple[tuple[DraftIssue, ...], str, str | None, str]:
627
724
  """Judge the draft; on a failure rewrite it ONCE and judge again.
628
725
 
@@ -645,9 +742,7 @@ def _apply_check(
645
742
  try:
646
743
  _run_answer_session(
647
744
  config, repo, session_root=session_root,
648
- context=render_context(rewrite_payload, repo_dir=Path(
649
- config.repo_dir,
650
- )),
745
+ context=render_context(rewrite_payload, repo_dir=repo_view),
651
746
  out_path=session_root / DRAFT_ANSWER_FILE, run_id=run_id,
652
747
  resume=True,
653
748
  )
@@ -26,7 +26,7 @@ import json
26
26
  import re
27
27
  import subprocess
28
28
 
29
- from orbi import gh_response, language, user_summary
29
+ from orbi import gh_response, language, provider_balance, user_summary
30
30
  from orbi.comment_kind import parse_versioned_block
31
31
 
32
32
  SCHEMA_VERSION = 1
@@ -57,6 +57,8 @@ REASON_CODES = frozenset({
57
57
  "human_decision_required",
58
58
  # The GitHub/provider credential is missing or rejected.
59
59
  "credential_missing",
60
+ # The model provider ACCOUNT has no balance (#2283).
61
+ provider_balance.REASON_CODE,
60
62
  # The model provider quota is exhausted (429/RESOURCE_EXHAUSTED).
61
63
  "provider_quota",
62
64
  # The configured base branch does not exist in the repository
@@ -87,6 +89,8 @@ ACTION_CODES = frozenset({
87
89
  "decide",
88
90
  # Verify and repair the credential, then retry.
89
91
  "check_credentials",
92
+ # Top up the provider account (or switch the key), then retry.
93
+ provider_balance.ACTION_CODE,
90
94
  # Retry after the provider quota window resets.
91
95
  "wait_quota",
92
96
  })
@@ -178,9 +182,7 @@ def _validate(record: Failure) -> None:
178
182
  if record.action_code not in ACTION_CODES:
179
183
  raise FailureError(f"unknown action_code: {record.action_code!r}")
180
184
  if type(record.retry_safe) is not bool:
181
- raise FailureError(
182
- f"retry_safe must be a boolean, got {record.retry_safe!r}"
183
- )
185
+ raise FailureError(f"retry_safe must be a boolean, got {record.retry_safe!r}")
184
186
 
185
187
 
186
188
  def parse(body: object) -> Failure | None:
@@ -218,30 +220,24 @@ def _parse_block(data: dict) -> Failure:
218
220
  # The classifier: exception detail -> closed reason/action codes
219
221
  # --------------------------------------------------------------------------
220
222
 
221
- # Failure-reason markers. The classifier reads only the bounded
222
- # exception detail; the caller (the runner, which owns the exception
223
- # classes) passes the type-derived flags that win over these patterns, so
224
- # a code is never derived from a guess.
223
+ # Failure-reason markers. The classifier reads only the bounded exception
224
+ # detail; the caller (the runner, which owns the exception classes) passes
225
+ # the type-derived flags that win over these patterns, so no code is guessed.
225
226
  _PROVIDER_QUOTA_RE = re.compile(
226
227
  r"\b429\b|quota|resource_exhausted|retry in|usage limit has been reached",
227
228
  re.IGNORECASE,
228
229
  )
229
230
  # The word markers `pi_process`'s early-exit classifier
230
- # (`_classify_startup_exit`) matches: the provider's own words stay the Pi
231
- # startup classification's (Issue #1465), read here by the one regex below.
231
+ # (`_classify_startup_exit`) matches, read here by the one regex below
232
+ # (Issue #1465).
232
233
  PROVIDER_AUTH_WORDS = ("unauthorized", "forbidden", "api key")
233
234
 
234
- # The text-only credential markers. GitHub failures no longer read this
235
- # one: they carry the exact response status (`gh_response`), while
236
- # `forbidden` and `credential` matched a branch or check name in the
237
- # command's argv (Issue #1760). The remaining markers serve the Pi /
238
- # model-provider detail, which only gives text (Issue #1465); `forbidden`
239
- # stays in `PROVIDER_AUTH_WORDS` for `pi_process`'s startup classifier.
240
- # `api key` is the provider's own missing/rejected-key sentence ("No API
241
- # key found for provider …"), the marker `PROVIDER_AUTH_WORDS` still
242
- # lists; only `incorrect api key` survived #1762, so the plain sentence
243
- # regressed to `unclassified` (Issue #1768). An argv word cannot carry
244
- # it — the space keeps it out of a branch, label or check name.
235
+ # The text-only credential markers. GitHub failures no longer read this one:
236
+ # they carry the exact response status (`gh_response`), while `forbidden`
237
+ # and `credential` matched a branch or check name in the command's argv
238
+ # (Issue #1760). The remaining markers serve the Pi / model-provider detail,
239
+ # which only gives text (Issue #1465). `api key` is the provider's own
240
+ # missing-key sentence, which no argv word can carry across the space (#1768).
245
241
  _CREDENTIAL_MISSING_RE = re.compile(
246
242
  r"bad credentials"
247
243
  r"|(?:http|status)\s+401\b"
@@ -320,6 +316,7 @@ DISPOSITIONS: dict[str, tuple[str, bool]] = {
320
316
  "review_budget_exhausted": ("decide", False),
321
317
  "human_decision_required": ("decide", False),
322
318
  "credential_missing": ("check_credentials", False),
319
+ "provider_balance": (provider_balance.ACTION_CODE, False),
323
320
  "provider_quota": ("wait_quota", True),
324
321
  "base_branch_missing": ("fix_ticket", False),
325
322
  "base_ci_red": ("fix_ticket", False),
@@ -409,6 +406,10 @@ def classify(detail: str, *, outcome: str = "blocked",
409
406
  # cannot grant: the existing `credential_missing` /
410
407
  # `check_credentials` category, a repair required before retry.
411
408
  reason_code = "credential_missing"
409
+ elif provider_balance.is_stop(detail):
410
+ # The provider ACCOUNT has no balance (a 402 refusal, #2283): its
411
+ # own stop, repaired by a top-up, not a credential re-check.
412
+ reason_code = provider_balance.REASON_CODE
412
413
  elif _CREDENTIAL_MISSING_RE.search(detail):
413
414
  reason_code = "credential_missing"
414
415
  elif _timeout_is_text_only(error) and _TEXT_TIMEOUT_RE.search(detail):
@@ -27,8 +27,8 @@ import logging
27
27
  from pathlib import Path
28
28
 
29
29
  from orbi import (
30
- base_ci_fix, base_ci_red, failure, failure_evidence, language, question,
31
- requeue, runner_health, scene, user_summary,
30
+ base_ci_fix, base_ci_red, failure, failure_evidence, language,
31
+ provider_balance, question, requeue, runner_health, scene, user_summary,
32
32
  )
33
33
  from orbi.blocked_comment import post_blocked_comment
34
34
  from orbi.comment_kind import (
@@ -538,19 +538,24 @@ def _update_reported_failure(*, number: int, source_repo: str,
538
538
  def _typed_failure_wording(
539
539
  exc: BaseException, *, pr_url: str | None, branch: str | None,
540
540
  language_code: str,
541
- ) -> tuple[bool, tuple[str, str] | None]:
541
+ ) -> tuple[bool, bool, tuple[str, str] | None]:
542
542
  """The reader-facing Action/Reason of a typed failure (#1651, #2273).
543
543
 
544
- Two failures answer the reader themselves instead of with the generic
544
+ Three failures answer the reader themselves instead of with the generic
545
545
  wording: the GitHub App Actions-workflow refusal (an authorization only
546
- a human can grant, so the repair path names the permission) and the
546
+ a human can grant, so the repair path names the permission), the
547
547
  delivery branch changed outside this run (Git answers with a "Note
548
548
  about fast-forwards" hint that names neither the cause nor the next
549
- step). Returns `(milestone_shows_the_action, (action, reason))`, or
550
- `(False, None)` for a failure that keeps the generic wording.
549
+ step) and the model provider's balance refusal (its exit's stderr is the
550
+ provider's `insufficient_balance_error` payload, not a reason a person
551
+ can act on, Issue #2278). Returns
552
+ `(terminal, milestone_shows_the_action, (action, reason))`, or
553
+ `(False, False, None)` for a failure that keeps the generic wording.
554
+ Only the two external authorizations are terminal; the balance stop
555
+ keeps the recovery its exit already had.
551
556
  """
552
557
  if failure.workflow_permission_refused(failure_detail(exc)):
553
- return True, (
558
+ return True, True, (
554
559
  failure.workflow_permission_action(
555
560
  pr_url, language_code=language_code),
556
561
  failure.workflow_permission_cause(language_code),
@@ -560,14 +565,19 @@ def _typed_failure_wording(
560
565
  language_code, "failure.delivery_branch_changed_cause",
561
566
  branch=branch or "-",
562
567
  )
563
- return False, (
568
+ return True, False, (
564
569
  language.text(
565
570
  language_code, "failure.delivery_branch_changed_action",
566
571
  cause=cause,
567
572
  ),
568
573
  cause,
569
574
  )
570
- return False, None
575
+ if provider_balance.is_stop(failure_detail(exc)):
576
+ return False, False, (
577
+ provider_balance.action(language_code),
578
+ provider_balance.cause(language_code),
579
+ )
580
+ return False, False, None
571
581
 
572
582
 
573
583
  def report_delivery_failure(
@@ -649,13 +659,15 @@ def report_delivery_failure(
649
659
  if diagnosis is None:
650
660
  diagnosis = cause or failure_detail(exc)
651
661
  blocked = not classify or is_unrecoverable_failure(exc)
652
- # A typed failure carries its own cause and repair, and it is terminal
653
- # (`ai-blocked`) whichever path caught it (Issues #1651, #2273).
654
- workflow_refusal, wording = _typed_failure_wording(
662
+ # A typed failure carries its own cause and repair; the two external
663
+ # authorizations are terminal (`ai-blocked`) whichever path caught them
664
+ # (Issues #1651, #2273).
665
+ typed_terminal, milestone_shows_action, wording = _typed_failure_wording(
655
666
  exc, pr_url=pr_url, branch=branch, language_code=language_code,
656
667
  )
657
- if wording is not None:
668
+ if typed_terminal:
658
669
  blocked = True
670
+ if wording is not None:
659
671
  action, reason = wording
660
672
  # Issue #2220: a stop that carries one structured question shows its
661
673
  # one-sentence summary as the visible Reason and — when the class is not
@@ -696,12 +708,14 @@ def report_delivery_failure(
696
708
  streak = _failure_streak(history, run_id, fingerprint, repo=source_repo)
697
709
  if streak + 1 >= FAILURE_STREAK_LIMIT:
698
710
  blocked = True
699
- reason += language.text(
700
- language_code,
701
- "delivery.failure_streak_escalation",
702
- count=streak + 1, run_id=run_id,
703
- fingerprint=fingerprint,
704
- )
711
+ # A typed failure already answered the reader (#2278).
712
+ if wording is None:
713
+ reason += language.text(
714
+ language_code,
715
+ "delivery.failure_streak_escalation",
716
+ count=streak + 1, run_id=run_id,
717
+ fingerprint=fingerprint,
718
+ )
705
719
  event(
706
720
  "failure_streak_escalated", level=logging.ERROR,
707
721
  issue=number, run_id=run_id, streak=streak + 1,
@@ -777,7 +791,7 @@ def report_delivery_failure(
777
791
  # the bare cause. Computed here, after the #825 guard may have
778
792
  # extended `reason`.
779
793
  milestone_summary = (
780
- action if workflow_refusal and action
794
+ action if milestone_shows_action and action
781
795
  else failure_summary(reason, language_code)
782
796
  )
783
797
  scene = scene_line() or "- run: `-`"
@@ -143,6 +143,25 @@ FAILURE_MESSAGES: dict[str, tuple[str, str]] = {
143
143
  "然后去掉 \u0060ai-blocked\u0060、重新加上 \u0060ai-ready\u0060,"
144
144
  "下一轮会从分支当前的状态继续。整个过程没有强推,也没有覆盖任何提交。",
145
145
  ),
146
+ # Issue #2278: the model provider refused a request because the
147
+ # account has no balance (HTTP 402, `insufficient_balance_error`).
148
+ # The cause is the provider account, not the code, and the repair is a
149
+ # human's: top up or switch the key, then relabel — a plain re-queue
150
+ # meets the same empty account. The provider's raw payload never
151
+ # reaches these lines (it is not a reason a person can act on).
152
+ "failure.provider_balance_cause": (
153
+ "The model provider refused the request because the account has no "
154
+ "balance left (HTTP 402).",
155
+ "模型服务商拒绝了这次请求:账户余额不足(HTTP 402)。",
156
+ ),
157
+ "failure.provider_balance_action": (
158
+ "Top up the model provider account or switch to an API key that has "
159
+ "balance, then remove `ai-blocked` and add `ai-ready` to run this "
160
+ "Issue again; nothing in the code needs to change.",
161
+ "请给模型服务商账户充值,或换用一个有余额的 API key,然后去掉 "
162
+ "`ai-blocked`、重新加上 `ai-ready`,以便重新运行这个 Issue;"
163
+ "代码本身不需要改动。",
164
+ ),
146
165
  "failure.blocked_precondition": (
147
166
  "this is an external precondition the AI cannot safely judge or "
148
167
  "fix, so it cannot be recovered automatically (the Issue stays "
@@ -24,6 +24,7 @@ from collections.abc import Callable
24
24
  from pathlib import Path
25
25
  from typing import NoReturn
26
26
 
27
+ from orbi import provider_balance
27
28
  from orbi.delivery_scene import RunContext
28
29
  from orbi.journal import (
29
30
  RunIdFilter,
@@ -475,11 +476,11 @@ def stream_pi(
475
476
  dir, so it keeps rising across runner restarts and the limit
476
477
  actually bites) — with the `run_failed` scene marked
477
478
  `reason=provider_rate_limited`. Long-term quota exhaustion stays out
478
- of scope (#313) — no wait window is added. The one annotated non-429
479
- exception is a usage-limit stop carried in the session journal's
480
- newest `errorMessage`: it logs one `provider_quota` WARNING and rides
481
- into the raised failure's detail (Issue #1374); every other non-429
482
- exit is untouched.
479
+ of scope (#313) — no wait window is added. Two non-429 exits are
480
+ annotated: a usage-limit stop carried in the session journal's newest
481
+ `errorMessage` logs one `provider_quota` WARNING and rides into the
482
+ raised failure's detail (Issue #1374), and a provider 402 balance
483
+ refusal carries one plain sentence instead of its payload (#2278).
483
484
 
484
485
  `progress` is invoked on EVERY poll — an activity change
485
486
  or a heartbeat — with the current activity state, while the Pi
@@ -1122,21 +1123,20 @@ def _stream_pi_once(
1122
1123
  ),
1123
1124
  )
1124
1125
  if process.returncode != 0:
1125
- # A provider 429 exit is TRANSIENT throttling, not a
1126
- # task failure — the `stream_pi` retry loop backs off and
1127
- # re-spawns this session. The refreshed activity rides on the
1128
- # exception so the retry logs and the exhausted-retries terminal
1129
- # failure carry the exit scene.
1130
- if _is_rate_limited(stderr):
1126
+ # A missing-balance refusal is its own stop and never throttling;
1127
+ # its payload becomes the one plain sentence (Issue #2278).
1128
+ balance_stop = provider_balance.is_stop(stderr)
1129
+ stderr = provider_balance.stop_detail(stderr)
1130
+ # A provider 429 exit is TRANSIENT throttling: `stream_pi` backs
1131
+ # off and re-spawns this session.
1132
+ if not balance_stop and _is_rate_limited(stderr):
1131
1133
  raise ProviderRateLimitedError(
1132
1134
  returncode=process.returncode,
1133
1135
  stdout=stdout, stderr=stderr, activity=activity,
1134
1136
  )
1135
- # A provider quota stop is carried only in the session journal's
1136
- # newest `errorMessage` (stderr stays empty), so without this the
1137
- # journal reads `returned non-zero exit status 1` and a quota stop
1138
- # looks like a crash. Log it, put the message into the exception
1139
- # detail, and keep the existing recoverable raise (Issue #1374).
1137
+ # A Codex quota stop lives only in the journal's newest
1138
+ # `errorMessage` (stderr stays empty): log it and put the message
1139
+ # into the exception detail so it is not read as a crash (#1374).
1140
1140
  quota_message = activity.get("error_message")
1141
1141
  if (quota_message is not None
1142
1142
  and _PROVIDER_QUOTA_MESSAGE in quota_message.lower()):
@@ -1146,17 +1146,15 @@ def _stream_pi_once(
1146
1146
  )
1147
1147
  stderr = f"{stderr}\n{quota_message}".strip()
1148
1148
  # A Pi exit after it created a session is an interrupted run: its
1149
- # work is resumable, including exits after idle recovery. A
1150
- # pre-session startup failure remains terminal unless it reaches
1151
- # one of the explicit recovery classifications above.
1149
+ # work is resumable, including exits after idle recovery.
1152
1150
  error_type = (
1153
1151
  # A session file alone only proves that Pi initialized its
1154
1152
  # journal; an exit before the first request is still a startup
1155
1153
  # failure (for example provider initialization) and must keep
1156
- # the existing terminal failure behavior. Only an interrupted
1157
- # session after a request has actually started is resumable —
1158
- # and that is judged from the journal on disk,
1159
- # never from a live poll that can predate it.
1154
+ # the existing terminal failure behavior. Only an interrupted
1155
+ # session after a request actually started is resumable —
1156
+ # judged from the journal on disk, never from a live poll that
1157
+ # can predate it.
1160
1158
  RecoverablePiProcessError
1161
1159
  if activity["first_request"]
1162
1160
  else subprocess.CalledProcessError