orbi-cli 0.7.56__tar.gz → 0.7.57__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 (312) hide show
  1. {orbi_cli-0.7.56/src/orbi_cli.egg-info → orbi_cli-0.7.57}/PKG-INFO +1 -1
  2. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/pyproject.toml +1 -1
  3. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/__init__.py +1 -1
  4. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/claim.py +10 -7
  5. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/delivery_labels.py +6 -7
  6. orbi_cli-0.7.57/src/orbi/epic_reconciliation.py +239 -0
  7. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/failure_stop.py +14 -7
  8. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/github.py +35 -98
  9. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/language_failure.py +19 -0
  10. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/language_terms.py +2 -1
  11. orbi_cli-0.7.57/src/orbi/language_terms_epic.py +48 -0
  12. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/release_closeout.py +10 -10
  13. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/release_comments.py +3 -41
  14. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/resume_verification.py +7 -22
  15. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/review_merge.py +16 -16
  16. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/runner.py +1 -1
  17. orbi_cli-0.7.57/src/orbi/terminal_labels.py +56 -0
  18. {orbi_cli-0.7.56 → orbi_cli-0.7.57/src/orbi_cli.egg-info}/PKG-INFO +1 -1
  19. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi_cli.egg-info/SOURCES.txt +4 -0
  20. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_apply_label_patch.py +105 -0
  21. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_bootstrap_adapters.py +0 -75
  22. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_bootstrap_delivery.py +96 -49
  23. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_bootstrap_release.py +191 -52
  24. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_claim_resume.py +4 -5
  25. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_outcome.py +14 -16
  26. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_reconcile.py +162 -61
  27. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_tickets.py +14 -9
  28. orbi_cli-0.7.57/tests/test_epic_reconciliation.py +283 -0
  29. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_failure.py +42 -2
  30. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_failure_report.py +103 -0
  31. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_fix_needed_loop.py +43 -29
  32. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_git_merge_smoke.py +6 -4
  33. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_message_language.py +0 -46
  34. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_notify.py +7 -2
  35. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_pr_verification.py +8 -6
  36. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_progress_wiring.py +14 -20
  37. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_public_helpers.py +9 -1
  38. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_release_extraction.py +4 -3
  39. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_resume_e2e.py +28 -24
  40. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_resume_pr.py +102 -137
  41. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_review_merge.py +22 -17
  42. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/LICENSE +0 -0
  43. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/README.md +0 -0
  44. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/docs/licenses/sustainable-use-license.md +0 -0
  45. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/setup.cfg +0 -0
  46. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/acceptance_section.py +0 -0
  47. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/amend_command.py +0 -0
  48. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/answer.py +0 -0
  49. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/base_ci_fix.py +0 -0
  50. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/base_ci_red.py +0 -0
  51. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/blocked_comment.py +0 -0
  52. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/blocked_record.py +0 -0
  53. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/blocked_scan.py +0 -0
  54. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/body_steering.py +0 -0
  55. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/branch_reclaim.py +0 -0
  56. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/check_permission.py +0 -0
  57. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/checks.py +0 -0
  58. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/claim_race.py +0 -0
  59. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/clarify.py +0 -0
  60. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/clarify_proposal.py +0 -0
  61. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/clarify_stop.py +0 -0
  62. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/cli.py +0 -0
  63. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/cli_commands.py +0 -0
  64. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/cli_doctor.py +0 -0
  65. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/cli_parser.py +0 -0
  66. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/cli_source.py +0 -0
  67. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/cli_status.py +0 -0
  68. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/cli_ticket_command.py +0 -0
  69. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/command_line.py +0 -0
  70. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/comment_kind.py +0 -0
  71. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/comment_rest_id.py +0 -0
  72. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/comment_trust.py +0 -0
  73. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/config.py +0 -0
  74. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/config_hint.py +0 -0
  75. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/delivery_comment.py +0 -0
  76. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/delivery_push.py +0 -0
  77. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/delivery_scene.py +0 -0
  78. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/draft.py +0 -0
  79. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/draft_cli.py +0 -0
  80. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/draft_document.py +0 -0
  81. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/draft_marker.py +0 -0
  82. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/draft_validate.py +0 -0
  83. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/engine_source.py +0 -0
  84. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/example_config.toml +0 -0
  85. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/extensions/clarify_verdict.ts +0 -0
  86. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/extensions/draft_tools.ts +0 -0
  87. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/failure.py +0 -0
  88. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/failure_evidence.py +0 -0
  89. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/failure_report.py +0 -0
  90. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/gh_response.py +0 -0
  91. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/git_identity.py +0 -0
  92. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/git_transport.py +0 -0
  93. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/github_feedback.py +0 -0
  94. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/gitops.py +0 -0
  95. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/human_review.py +0 -0
  96. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/implementation_delivery.py +0 -0
  97. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/journal.py +0 -0
  98. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/labels.py +0 -0
  99. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/labels.toml +0 -0
  100. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/language.py +0 -0
  101. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/language_terms_criteria.py +0 -0
  102. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/language_terms_fix.py +0 -0
  103. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/launchd_deploy.py +0 -0
  104. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/merge_blocked.py +0 -0
  105. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/merge_exec.py +0 -0
  106. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/merge_gate.py +0 -0
  107. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/merge_handoff.py +0 -0
  108. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/milestone.py +0 -0
  109. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/milestone_command.py +0 -0
  110. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/milestone_errors.py +0 -0
  111. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/notify.py +0 -0
  112. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/notify_text.py +0 -0
  113. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/ops_delivery.py +0 -0
  114. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/pi_activity.py +0 -0
  115. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/pi_command.py +0 -0
  116. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/pi_exec.py +0 -0
  117. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/pi_idle.py +0 -0
  118. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/pi_process.py +0 -0
  119. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/pi_recovery.py +0 -0
  120. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/pi_session.py +0 -0
  121. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/pi_stream_log.py +0 -0
  122. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/pilot_setup.py +0 -0
  123. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/pilot_slots.py +0 -0
  124. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/plan_milestone.py +0 -0
  125. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/pr_head_sync.py +0 -0
  126. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/pr_verification.py +0 -0
  127. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/progress.py +0 -0
  128. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/progress_display.py +0 -0
  129. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/progress_outcome.py +0 -0
  130. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/progress_summary.py +0 -0
  131. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/provider_balance.py +0 -0
  132. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/question.py +0 -0
  133. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/recoverable_failure.py +0 -0
  134. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/release.py +0 -0
  135. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/release_declaration.py +0 -0
  136. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/release_git.py +0 -0
  137. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/release_notes.py +0 -0
  138. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/release_run.py +0 -0
  139. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/repo_config.py +0 -0
  140. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/requeue.py +0 -0
  141. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/restart_scan.py +0 -0
  142. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/resume_scan.py +0 -0
  143. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/review_ci_status.py +0 -0
  144. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/review_rounds.py +0 -0
  145. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/review_verdict.py +0 -0
  146. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/review_wait.py +0 -0
  147. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/run_fields.py +0 -0
  148. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/run_state.py +0 -0
  149. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/runner_health.py +0 -0
  150. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/runner_marker.py +0 -0
  151. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/runner_source.py +0 -0
  152. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/scene.py +0 -0
  153. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/scheduler.py +0 -0
  154. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/scheduler_units.py +0 -0
  155. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/session_command.py +0 -0
  156. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/setup_checks.py +0 -0
  157. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/setup_config.py +0 -0
  158. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/source_pool.py +0 -0
  159. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/split_apply.py +0 -0
  160. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/split_command.py +0 -0
  161. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/status_observe.py +0 -0
  162. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/steering.py +0 -0
  163. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/stop_comment.py +0 -0
  164. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/stopped_scans.py +0 -0
  165. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/suggest.py +0 -0
  166. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/systemd_deploy.py +0 -0
  167. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/terminal_stops.py +0 -0
  168. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/tick_reads.py +0 -0
  169. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/ticket_command.py +0 -0
  170. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/ticket_command_registry.py +0 -0
  171. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/ticket_criteria.py +0 -0
  172. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/user_summary.py +0 -0
  173. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/waiting_checks.py +0 -0
  174. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi/worktree_retention.py +0 -0
  175. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi_cli.egg-info/dependency_links.txt +0 -0
  176. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi_cli.egg-info/entry_points.txt +0 -0
  177. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/src/orbi_cli.egg-info/top_level.txt +0 -0
  178. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_agents_md.py +0 -0
  179. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_amend_command.py +0 -0
  180. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_answer.py +0 -0
  181. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_base_branch_failure.py +0 -0
  182. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_base_ci_red.py +0 -0
  183. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_blocked_comment.py +0 -0
  184. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_body_steering.py +0 -0
  185. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_bootstrap_pi.py +0 -0
  186. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_bootstrap_preflight.py +0 -0
  187. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_failure_report.py +0 -0
  188. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_main.py +0 -0
  189. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_milestone.py +0 -0
  190. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_prompt.py +0 -0
  191. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_session.py +0 -0
  192. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_branch_reclaim.py +0 -0
  193. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_check_permission.py +0 -0
  194. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_ci_macos_workflow.py +0 -0
  195. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_ci_workflow.py +0 -0
  196. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_claim_race.py +0 -0
  197. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_clarify.py +0 -0
  198. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_claude_plugin.py +0 -0
  199. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_cli_golden.py +0 -0
  200. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_cli_install.py +0 -0
  201. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_cli_milestone.py +0 -0
  202. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_cli_packaging.py +0 -0
  203. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_cli_source.py +0 -0
  204. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_cli_ticket_commands.py +0 -0
  205. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_command_receipt_contract.py +0 -0
  206. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_comment_identity.py +0 -0
  207. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_comment_readers_contract.py +0 -0
  208. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_comment_rest_id.py +0 -0
  209. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_comment_trust.py +0 -0
  210. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_concurrency_e2e.py +0 -0
  211. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_constitution.py +0 -0
  212. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_coverage_gate.py +0 -0
  213. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_deliver_pr_fakes.py +0 -0
  214. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_delivery_branch_delete.py +0 -0
  215. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_delivery_labels.py +0 -0
  216. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_delivery_scene.py +0 -0
  217. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_docker_docs.py +0 -0
  218. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_docker_entrypoint.py +0 -0
  219. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_docker_image_workflow.py +0 -0
  220. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_docs_i18n.py +0 -0
  221. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_docs_issue_shapes.py +0 -0
  222. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_docs_labels.py +0 -0
  223. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_docs_mermaid.py +0 -0
  224. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_docs_releases.py +0 -0
  225. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_docs_safety_matrix.py +0 -0
  226. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_docs_single_source.py +0 -0
  227. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_docs_site.py +0 -0
  228. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_draft.py +0 -0
  229. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_draft_repo_view.py +0 -0
  230. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_draft_validate.py +0 -0
  231. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_engine_source.py +0 -0
  232. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_gh_read_retry.py +0 -0
  233. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_gh_response.py +0 -0
  234. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_git_base_smoke.py +0 -0
  235. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_git_network_retry.py +0 -0
  236. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_git_transport.py +0 -0
  237. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_github.py +0 -0
  238. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_github_fakes.py +0 -0
  239. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_gitops.py +0 -0
  240. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_gitops_fakes.py +0 -0
  241. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_human_review.py +0 -0
  242. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_import_graph.py +0 -0
  243. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_install_sh.py +0 -0
  244. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_issue_1367.py +0 -0
  245. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_issue_461.py +0 -0
  246. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_issue_template_config.py +0 -0
  247. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_journal.py +0 -0
  248. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_journal_events.py +0 -0
  249. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_labels.py +0 -0
  250. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_launchd_deploy.py +0 -0
  251. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_license.py +0 -0
  252. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_merge_exec_extraction.py +0 -0
  253. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_milestone_command.py +0 -0
  254. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_ops_e2e.py +0 -0
  255. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_orbi.py +0 -0
  256. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_orbi_dashboard.py +0 -0
  257. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_orbi_exporter.py +0 -0
  258. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_patch_ratchet.py +0 -0
  259. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_pi_activity.py +0 -0
  260. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_pi_child_reap.py +0 -0
  261. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_pi_command.py +0 -0
  262. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_pi_exec.py +0 -0
  263. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_pi_extensions.py +0 -0
  264. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_pi_provider_templates.py +0 -0
  265. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_pi_recovery.py +0 -0
  266. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_pi_session.py +0 -0
  267. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_pilot_setup.py +0 -0
  268. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_pilot_slots.py +0 -0
  269. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_pr_issue_link_workflow.py +0 -0
  270. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_prerequisite_check.py +0 -0
  271. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_progress.py +0 -0
  272. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_prompt_contract.py +0 -0
  273. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_public_contracts.py +0 -0
  274. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_publish_workflow.py +0 -0
  275. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_question.py +0 -0
  276. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_question_resume.py +0 -0
  277. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_release_docs_workflow.py +0 -0
  278. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_release_ticket_templates.py +0 -0
  279. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_repo_config.py +0 -0
  280. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_resume_continue_e2e.py +0 -0
  281. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_resume_other_executor.py +0 -0
  282. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_review_verdict.py +0 -0
  283. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_review_waiting.py +0 -0
  284. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_run_artifacts.py +0 -0
  285. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_run_fields.py +0 -0
  286. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_run_id_e2e.py +0 -0
  287. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_run_id_fixture.py +0 -0
  288. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_runner_config.py +0 -0
  289. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_runner_health.py +0 -0
  290. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_runner_source_freshness.py +0 -0
  291. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_scene.py +0 -0
  292. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_scheduler.py +0 -0
  293. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_seam.py +0 -0
  294. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_setup_output_golden.py +0 -0
  295. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_size_ratchet.py +0 -0
  296. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_split_command.py +0 -0
  297. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_src_layout.py +0 -0
  298. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_status_observe.py +0 -0
  299. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_steering_review.py +0 -0
  300. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_suggest.py +0 -0
  301. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_suggest_repo_view.py +0 -0
  302. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_suite_hygiene.py +0 -0
  303. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_systemd_deploy.py +0 -0
  304. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_systemd_timer.py +0 -0
  305. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_tick_reads.py +0 -0
  306. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_ticket_command.py +0 -0
  307. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_ticket_command_registration.py +0 -0
  308. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_user_acceptance_contract.py +0 -0
  309. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_user_summary.py +0 -0
  310. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_versioned_comment_block.py +0 -0
  311. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/tests/test_waiting_checks.py +0 -0
  312. {orbi_cli-0.7.56 → orbi_cli-0.7.57}/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.56
3
+ Version: 0.7.57
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.56"
47
+ version = "0.7.57"
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.56"
21
+ __version__ = "0.7.57"
@@ -22,8 +22,12 @@ from orbi import delivery_labels
22
22
  from orbi.delivery_scene import (
23
23
  EXTERNAL_PR_MARKER, body_markers, classify,
24
24
  )
25
+ from orbi.epic_reconciliation import (
26
+ epic_audit, epic_audit_posted, epic_close_reason, epic_closed_evidence,
27
+ verify_epic_complete,
28
+ )
25
29
  from orbi.github import (
26
- verify_epic_complete, close_issue,
30
+ close_issue,
27
31
  comment_issue, issue_comments, issue_priority, issue_view,
28
32
  list_issues, milestone_open_issue_count,
29
33
  open_blocker_numbers, pr_comments,
@@ -40,7 +44,6 @@ from orbi.resume_scan import (
40
44
  from orbi import language, review_wait, user_summary
41
45
  from orbi.progress import run_marker
42
46
  from orbi.release import release_target_milestone
43
- from orbi.release_comments import _epic_audit, epic_audit_posted
44
47
  from orbi.repo_config import (
45
48
  RepoConfigError, RepoPolicy, load_repo_policy, merged_repo_language,
46
49
  )
@@ -208,20 +211,20 @@ def reconcile_open_epics(repo: str, run_id: str, language_code: str) -> list[str
208
211
  for listed_epic in epics:
209
212
  number = listed_epic.get("number")
210
213
  try:
211
- child_evidence = verify_epic_complete(repo, listed_epic)
214
+ children = verify_epic_complete(repo, listed_epic)
212
215
  except (ValueError, json.JSONDecodeError) as exc:
213
216
  reason = str(exc)
214
217
  event("epic_kept_open", issue=number, repo=repo, reason=reason)
215
218
  evidence.append(f"Epic #{number} kept open: {reason}")
216
219
  continue
217
- audit = _epic_audit(child_evidence, None, language_code)
220
+ audit = epic_audit(children, None, language_code)
218
221
  comments = issue_comments(int(number), repo=repo)
219
- if not epic_audit_posted(comments, child_evidence):
222
+ if not epic_audit_posted(comments, children):
220
223
  comment_issue(int(number), repo=repo,
221
224
  body=f"{run_marker(run_id)}\n{audit}\nrun_id={run_id}")
222
- close_issue(int(number), repo=repo)
225
+ close_issue(int(number), repo=repo, reason=epic_close_reason(children))
223
226
  event("epic_closed", issue=number, repo=repo)
224
- evidence.append(f"Epic #{number} closed after verification ({'; '.join(child_evidence)})")
227
+ evidence.append(epic_closed_evidence(number, children))
225
228
  return evidence
226
229
 
227
230
 
@@ -120,11 +120,10 @@ def label_patch(event: str, current_labels,
120
120
  - claim: add in-progress; remove the queue label and a stale
121
121
  fix-needed / needs-detail (a resumed fix round, the thin-ticket gate
122
122
  once the author re-readied the ticket).
123
- - pr_opened / fix_needed: add the opened-PR state, remove in-progress
124
- and the queue label. A TERMINAL Issue (merged / blocked) changes
125
- nothing on fix_needed: the delivery is over or waiting for a human,
126
- and a fix-needed label beside it would let a later terminal label
127
- removal resume an automatic fix nobody asked for (Issue #1786).
123
+ - pr_opened: add the opened-PR state, remove in-progress, fix-needed
124
+ and the queue label. A TERMINAL Issue changes nothing on fix_needed:
125
+ the delivery is over or waits for a human, and a stale label would
126
+ resume an automatic fix nobody asked for (Issue #1786).
128
127
  - human_review_waiting: add NOTHING, clear in-progress and the queue
129
128
  label; the opened-PR anchor stays (the resume scan needs it).
130
129
  - requeue / release_waiting: add the queue label back (the ticket is
@@ -157,8 +156,8 @@ def label_patch(event: str, current_labels,
157
156
  return ([in_progress], to_remove)
158
157
  if event == EVENT_PR_OPENED:
159
158
  return ([pr_opened], [
160
- label for label in (in_progress, queue) if label in current
161
- ])
159
+ label for label in (in_progress, fix_needed, queue)
160
+ if label in current])
162
161
  if event == EVENT_FIX_NEEDED:
163
162
  if merged in current or blocked in current:
164
163
  return ([], [])
@@ -0,0 +1,239 @@
1
+ """One Epic's children and how each of them ended (Issue #2356).
2
+
3
+ The verification used to reduce every closed child to "Issue #N closed", so
4
+ an Epic whose children a person closed without any delivery received the
5
+ same "complete" comment and the same completed close reason as a fully
6
+ delivered one. The verification now returns one :class:`EpicChild` per
7
+ child carrying its outcome — delivered by Orbi (a merged PR child, or an
8
+ Issue carrying `ai-merged`), closed while it carried `ai-blocked`, or
9
+ closed by a person with GitHub's own `state_reason` — and this module owns
10
+ the two decisions built on it: the reconciliation sentence (catalog text,
11
+ both languages) and the Epic's close reason.
12
+
13
+ Both sweeps render through these functions — the per-tick
14
+ `claim.reconcile_open_epics` and the release
15
+ `release_closeout.reconcile_release_epics` — so the same children can never
16
+ produce two different comments or close reasons. The module imports the
17
+ `gh` read primitives from :mod:`orbi.github`, which imports neither this
18
+ module nor a sweep owner, so there is no cycle.
19
+ """
20
+ from __future__ import annotations
21
+
22
+ import json
23
+ from typing import NamedTuple
24
+
25
+ from orbi import delivery_labels, language
26
+ from orbi.delivery_labels import label_name_set
27
+ from orbi.github import (
28
+ epic_issue_with_blockers,
29
+ open_blocker_numbers,
30
+ parse_paginated_issue_array,
31
+ run_gh_read_command,
32
+ )
33
+
34
+ # How one Epic child ended.
35
+ CHILD_DELIVERED = "delivered"
36
+ CHILD_BLOCKED = "blocked"
37
+ CHILD_COMPLETED = "completed"
38
+ CHILD_NOT_PLANNED = "not_planned"
39
+
40
+ # `gh issue close --reason`'s documented values, verified with
41
+ # `gh issue close --help`: {completed|not planned|duplicate}.
42
+ CLOSE_NOT_PLANNED = "not planned"
43
+
44
+
45
+ class EpicChild(NamedTuple):
46
+ """One verified Epic child: what it is and how it ended."""
47
+
48
+ kind: str # "issue" or "pr"
49
+ number: int
50
+ outcome: str # one of the CHILD_* constants
51
+
52
+
53
+ def verify_epic_complete(repo: str, listed_epic: dict) -> list[EpicChild]:
54
+ """Verify native sub-issues and blockers; otherwise fail closed.
55
+
56
+ Live API shape (measured 2026-09-09 against #305):
57
+ ``GET /repos/{owner}/{repo}/issues/{number}/sub_issues`` returns a JSON
58
+ array (``[]`` for no children), paginates with the standard ``--paginate``
59
+ contract, and Issue items include ``repository.full_name`` and no
60
+ ``pull_request`` key. The endpoint is paginated with ``per_page=100``;
61
+ a cross-repository item is identified by its ``repository.full_name`` and
62
+ is rejected. A PR-shaped item is identified by a non-null
63
+ ``pull_request`` field and is checked through the PR endpoint.
64
+ """
65
+ epic = epic_issue_with_blockers(repo, listed_epic)
66
+ number = epic.get("number")
67
+ if not isinstance(number, int) or isinstance(number, bool):
68
+ raise ValueError("Epic number is missing or invalid")
69
+ blockers = epic.get("blockedBy")
70
+ # Live API check: `gh issue view --json blockedBy` returns
71
+ # {"blockedBy":{"nodes":[],"totalCount":0}} for zero dependencies.
72
+ # Missing/malformed blockedBy is not equivalent to that empty set.
73
+ if not isinstance(blockers, dict) or not isinstance(blockers.get("nodes"), list):
74
+ raise ValueError("native blocker/dependency state is unavailable")
75
+ for node in blockers["nodes"]:
76
+ if (not isinstance(node, dict)
77
+ or not isinstance(node.get("number"), int)
78
+ or isinstance(node.get("number"), bool)
79
+ or ("state" in node and node["state"] not in {"OPEN", "CLOSED"})):
80
+ raise ValueError("native blocker/dependency state is malformed")
81
+ open_blockers = open_blocker_numbers(epic)
82
+ if open_blockers:
83
+ raise ValueError("open blockers: " + ", ".join(f"#{n}" for n in open_blockers))
84
+ raw = run_gh_read_command([
85
+ "gh", "api", f"repos/{repo}/issues/{number}/sub_issues?per_page=100",
86
+ "--paginate", "--slurp",
87
+ ])
88
+ children = parse_paginated_issue_array(raw)
89
+ if not children:
90
+ raise ValueError("Epic child scope is missing or empty")
91
+ verified: list[EpicChild] = []
92
+ for child in children:
93
+ child_number = child.get("number")
94
+ if not isinstance(child_number, int) or isinstance(child_number, bool):
95
+ raise ValueError("Epic child scope contains an invalid number")
96
+ child_repo = child.get("repository")
97
+ if not isinstance(child_repo, dict) or not isinstance(child_repo.get("full_name"), str):
98
+ raise ValueError(f"child #{child_number} repository state is malformed")
99
+ if child_repo["full_name"].lower() != repo.lower():
100
+ raise ValueError(f"cross-repository child #{child_number}")
101
+ if child.get("state") not in {"open", "closed"}:
102
+ raise ValueError(f"child #{child_number} state is malformed")
103
+ kind = "pr" if child.get("pull_request") is not None else "issue"
104
+ verified.append(_epic_child(repo, kind, child_number))
105
+ return verified
106
+
107
+
108
+ def _epic_child(repo: str, kind: str, number: int) -> EpicChild:
109
+ """Verify one child against GitHub's live Issue/PR state."""
110
+ raw = run_gh_read_command(["gh", "api", f"repos/{repo}/issues/{number}"])
111
+ item = json.loads(raw)
112
+ if not isinstance(item, dict):
113
+ raise ValueError(f"child #{number} response is not an object")
114
+ is_pr = "pull_request" in item
115
+ if kind == "issue" and is_pr:
116
+ raise ValueError(f"child #{number} declared as Issue but is a PR")
117
+ if kind == "pr" and not is_pr:
118
+ raise ValueError(f"child #{number} declared as PR but is an Issue")
119
+ if is_pr:
120
+ pr = json.loads(run_gh_read_command(["gh", "api", f"repos/{repo}/pulls/{number}"]))
121
+ if not isinstance(pr, dict) or pr.get("merged") is not True:
122
+ raise ValueError(f"child PR #{number} is not merged")
123
+ return EpicChild("pr", number, CHILD_DELIVERED)
124
+ if item.get("state") != "closed":
125
+ raise ValueError(f"child Issue #{number} is not closed")
126
+ return EpicChild("issue", number, _closed_issue_outcome(item))
127
+
128
+
129
+ def _closed_issue_outcome(item: dict) -> str:
130
+ """How one closed child Issue ended.
131
+
132
+ `ai-merged` means Orbi delivered it; `ai-blocked` means Orbi stopped on
133
+ it and a person closed it anyway. Every other closed Issue was closed by
134
+ a person, and GitHub's own `state_reason` says whether they recorded it
135
+ as completed or not planned — a closed Issue without the field is
136
+ GitHub's default, completed.
137
+ """
138
+ labels = label_name_set(item)
139
+ if delivery_labels.MERGED_LABEL in labels:
140
+ return CHILD_DELIVERED
141
+ if delivery_labels.BLOCKED_LABEL in labels:
142
+ return CHILD_BLOCKED
143
+ return (CHILD_NOT_PLANNED if item.get("state_reason") == "not_planned"
144
+ else CHILD_COMPLETED)
145
+
146
+
147
+ def epic_audit(children: list[EpicChild], version: str | None,
148
+ language_code: str) -> str:
149
+ """The ONE Epic reconciliation sentence, in the bound language.
150
+
151
+ Today's "complete" sentence is kept byte for byte when every child was
152
+ delivered by Orbi — its child fragments are the same shared evidence the
153
+ pre-#2356 verification built ("PR #N merged", "Issue #N closed"), so
154
+ only the sentence around them moves. Every other Epic states that all
155
+ children are closed but not all of them were delivered, followed by one
156
+ fragment per child naming how it ended.
157
+ """
158
+ prefix = "" if not version else language.text(
159
+ language_code, "epic.reconciliation_version", version=version,
160
+ )
161
+ if all(child.outcome == CHILD_DELIVERED for child in children):
162
+ return language.text(
163
+ language_code, "epic.reconciliation", prefix=prefix,
164
+ children=", ".join(_delivered_fragment(child) for child in children),
165
+ )
166
+ return language.text(
167
+ language_code, "epic.reconciliation_closed", prefix=prefix,
168
+ children=", ".join(
169
+ _child_wording(child, language_code) for child in children
170
+ ),
171
+ )
172
+
173
+
174
+ def _delivered_fragment(child: EpicChild) -> str:
175
+ """The delivered-child fragment of the "complete" sentence."""
176
+ return (f"PR #{child.number} merged" if child.kind == "pr"
177
+ else f"Issue #{child.number} closed")
178
+
179
+
180
+ # One catalog key per (child kind, outcome): how a child is named in the
181
+ # sentence that does not claim completion (Issue #2356).
182
+ _CHILD_WORDING = {
183
+ ("pr", CHILD_DELIVERED): "epic.child_delivered_pr",
184
+ ("issue", CHILD_DELIVERED): "epic.child_delivered_issue",
185
+ ("issue", CHILD_BLOCKED): "epic.child_blocked",
186
+ ("issue", CHILD_COMPLETED): "epic.child_completed",
187
+ ("issue", CHILD_NOT_PLANNED): "epic.child_not_planned",
188
+ }
189
+
190
+
191
+ def _child_wording(child: EpicChild, language_code: str) -> str:
192
+ """One child named with how it ended, in the bound language."""
193
+ return language.text(
194
+ language_code, _CHILD_WORDING[(child.kind, child.outcome)],
195
+ number=child.number,
196
+ )
197
+
198
+
199
+ def epic_close_reason(children: list[EpicChild]) -> str | None:
200
+ """The `gh issue close --reason` value this Epic must be closed with.
201
+
202
+ "not planned" only when Orbi delivered none of the children and none of
203
+ them was closed as completed — the scene a person reads as "Orbi
204
+ delivered nothing here". Every other case keeps today's completed close
205
+ (`None` leaves GitHub's default, completed).
206
+ """
207
+ if any(child.outcome in {CHILD_DELIVERED, CHILD_COMPLETED}
208
+ for child in children):
209
+ return None
210
+ return CLOSE_NOT_PLANNED
211
+
212
+
213
+ def epic_audit_posted(comments: list[dict], children: list[EpicChild],
214
+ version: str | None = None) -> bool:
215
+ """True when a comment already carries the audit in EITHER language.
216
+
217
+ The audit sentence is its own duplicate check: both sweeps close the
218
+ Epic right after commenting, so a comment without a close means the
219
+ close failed and the retry may render in another language. Matching
220
+ every rendering keeps a posted English audit from being duplicated by a
221
+ Chinese one (Issue #1705), in both the complete and the #2356 sentence.
222
+ """
223
+ renderings = [
224
+ epic_audit(children, version, language_code)
225
+ for language_code in language.LANGUAGES
226
+ ]
227
+ return any(
228
+ rendering in str(comment.get("body", ""))
229
+ for comment in comments
230
+ for rendering in renderings
231
+ )
232
+
233
+
234
+ def epic_closed_evidence(number: int, children: list[EpicChild]) -> str:
235
+ """The ONE evidence line both sweeps record for a closed Epic."""
236
+ fragments = "; ".join(
237
+ f"#{child.number} {child.outcome}" for child in children
238
+ )
239
+ return f"Epic #{number} closed after verification ({fragments})"
@@ -6,7 +6,8 @@ a human decision") while the record beside it could carry the action
6
6
  take. `stop_wording` decides BOTH strings from ONE record, reading its
7
7
  `action_code` and `retry_safe` (plus the reason codes that already own a better
8
8
  sentence than their action family can give: an undetermined cause, a missing
9
- base branch and the provider balance refusal). The failure comment and the
9
+ base branch, an empty-tree stop whose Issue may already be satisfied and the
10
+ provider balance refusal). The failure comment and the
10
11
  terminal progress comment both read it, so the two cannot drift apart.
11
12
 
12
13
  It lives in its own module because `orbi.failure` is at its size-ratchet
@@ -23,10 +24,11 @@ from orbi import language, provider_balance
23
24
  if TYPE_CHECKING: # the record's home imports this module's names back
24
25
  from orbi.failure import Failure
25
26
 
26
- # reason_code -> (action key, disposition key): the two reasons that own a
27
+ # reason_code -> (action key, disposition key): the reasons that own a
27
28
  # better sentence than their action family can give: the undetermined cause
28
- # (which must not blame the Issue text, Issue #1651) and the branch a human
29
- # must create or pick (Issue #1749). ONE table feeds BOTH strings, so a
29
+ # (which must not blame the Issue text, Issue #1651), the branch a human
30
+ # must create or pick (Issue #1749) and the empty-tree stop (whose Issue may
31
+ # already be satisfied, Issue #2358). ONE table feeds BOTH strings, so a
30
32
  # headline can never tell the reader to change the Issue while the action
31
33
  # beside it names a repository or evidence repair. They are read before the
32
34
  # action family, never instead of it.
@@ -38,6 +40,10 @@ _REASON_WORDING = {
38
40
  "failure.terminal_base_branch_missing",
39
41
  "failure.disposition_base_branch",
40
42
  ),
43
+ "no_file_change": (
44
+ "failure.terminal_no_file_change",
45
+ "failure.disposition_no_file_change",
46
+ ),
41
47
  }
42
48
 
43
49
  # action_code -> the headline disposition that action really asks for
@@ -65,9 +71,10 @@ def _disposition_key(record: "Failure") -> str:
65
71
  A `retry_safe` stop needs no repair (a plain re-queue can succeed), so it
66
72
  never claims a decision; the no-commit stop names what happened instead,
67
73
  because "the ticket needs a change" is not what its reader would guess;
68
- and a reason with its own action sentence above keeps the opposite
69
- disposition, so the headline never asks for a ticket edit the action
70
- does not ask for (Issue #2351).
74
+ and a reason in `_REASON_WORDING` above keeps the disposition paired with
75
+ its action sentence (the empty-tree stop says its Issue may already be
76
+ satisfied), so the headline never asks for a ticket edit the action does
77
+ not ask for (Issue #2351, #2358).
71
78
  """
72
79
  if record.retry_safe:
73
80
  return "failure.disposition_retry"
@@ -24,7 +24,7 @@ from collections.abc import Callable
24
24
  from pathlib import Path
25
25
  from urllib.parse import quote
26
26
 
27
- from orbi import checks, gh_response, notify
27
+ from orbi import checks, gh_response, notify, terminal_labels
28
28
  from orbi.delivery_labels import label_name_set, label_patch
29
29
  from orbi import delivery_labels
30
30
  from orbi.journal import LOGGER, event, run_command, single_line
@@ -439,9 +439,18 @@ def close_milestone(repo: str, number: int) -> None:
439
439
  ], timeout=30)
440
440
 
441
441
 
442
- def close_issue(number: int, *, repo: str) -> None:
443
- """Close one Issue by number (the reconciliation/cleanup step)."""
444
- run_command(["gh", "issue", "close", str(number), "--repo", repo])
442
+ def close_issue(number: int, *, repo: str,
443
+ reason: str | None = None) -> None:
444
+ """Close one Issue by number (the reconciliation/cleanup step).
445
+
446
+ `reason` is `gh issue close --reason`'s documented value set
447
+ (`completed`, `not planned`, `duplicate` — verified with
448
+ `gh issue close --help`); `None` keeps GitHub's own default, completed.
449
+ """
450
+ command = ["gh", "issue", "close", str(number), "--repo", repo]
451
+ if reason is not None:
452
+ command += ["--reason", reason]
453
+ run_command(command)
445
454
 
446
455
 
447
456
  def issue_view(number: int, fields: str, *, repo: str | None = None,
@@ -574,82 +583,6 @@ def open_blocker_numbers(issue: dict) -> list[int]:
574
583
  return numbers
575
584
 
576
585
 
577
- def verify_epic_complete(repo: str, listed_epic: dict) -> list[str]:
578
- """Verify native sub-issues and blockers; otherwise fail closed.
579
-
580
- Live API shape (measured 2026-09-09 against #305):
581
- ``GET /repos/{owner}/{repo}/issues/{number}/sub_issues`` returns a JSON
582
- array (``[]`` for no children), paginates with the standard ``--paginate``
583
- contract, and Issue items include ``repository.full_name`` and no
584
- ``pull_request`` key. The endpoint is paginated with ``per_page=100``;
585
- a cross-repository item is identified by its ``repository.full_name`` and
586
- is rejected. A PR-shaped item is identified by a non-null
587
- ``pull_request`` field and is checked through the PR endpoint.
588
- """
589
- epic = epic_issue_with_blockers(repo, listed_epic)
590
- number = epic.get("number")
591
- if not isinstance(number, int) or isinstance(number, bool):
592
- raise ValueError("Epic number is missing or invalid")
593
- blockers = epic.get("blockedBy")
594
- # Live API check: `gh issue view --json blockedBy` returns
595
- # {"blockedBy":{"nodes":[],"totalCount":0}} for zero dependencies.
596
- # Missing/malformed blockedBy is not equivalent to that empty set.
597
- if not isinstance(blockers, dict) or not isinstance(blockers.get("nodes"), list):
598
- raise ValueError("native blocker/dependency state is unavailable")
599
- for node in blockers["nodes"]:
600
- if (not isinstance(node, dict)
601
- or not isinstance(node.get("number"), int)
602
- or isinstance(node.get("number"), bool)
603
- or ("state" in node and node["state"] not in {"OPEN", "CLOSED"})):
604
- raise ValueError("native blocker/dependency state is malformed")
605
- open_blockers = open_blocker_numbers(epic)
606
- if open_blockers:
607
- raise ValueError("open blockers: " + ", ".join(f"#{n}" for n in open_blockers))
608
- raw = run_gh_read_command([
609
- "gh", "api", f"repos/{repo}/issues/{number}/sub_issues?per_page=100",
610
- "--paginate", "--slurp",
611
- ])
612
- children = parse_paginated_issue_array(raw)
613
- if not children:
614
- raise ValueError("Epic child scope is missing or empty")
615
- child_evidence: list[str] = []
616
- for child in children:
617
- child_number = child.get("number")
618
- if not isinstance(child_number, int) or isinstance(child_number, bool):
619
- raise ValueError("Epic child scope contains an invalid number")
620
- child_repo = child.get("repository")
621
- if not isinstance(child_repo, dict) or not isinstance(child_repo.get("full_name"), str):
622
- raise ValueError(f"child #{child_number} repository state is malformed")
623
- if child_repo["full_name"].lower() != repo.lower():
624
- raise ValueError(f"cross-repository child #{child_number}")
625
- if child.get("state") not in {"open", "closed"}:
626
- raise ValueError(f"child #{child_number} state is malformed")
627
- kind = "pr" if child.get("pull_request") is not None else "issue"
628
- child_evidence.append(_epic_child_evidence(repo, kind, child_number))
629
- return child_evidence
630
-
631
-
632
- def _epic_child_evidence(repo: str, kind: str, number: int) -> str:
633
- """Verify one child against GitHub's live Issue/PR state."""
634
- raw = run_gh_read_command(["gh", "api", f"repos/{repo}/issues/{number}"])
635
- item = json.loads(raw)
636
- if not isinstance(item, dict):
637
- raise ValueError(f"child #{number} response is not an object")
638
- is_pr = "pull_request" in item
639
- if kind == "issue" and is_pr:
640
- raise ValueError(f"child #{number} declared as Issue but is a PR")
641
- if kind == "pr" and not is_pr:
642
- raise ValueError(f"child #{number} declared as PR but is an Issue")
643
- if is_pr:
644
- pr = json.loads(run_gh_read_command(["gh", "api", f"repos/{repo}/pulls/{number}"]))
645
- if not isinstance(pr, dict) or pr.get("merged") is not True:
646
- raise ValueError(f"child PR #{number} is not merged")
647
- return f"PR #{number} merged"
648
- if item.get("state") != "closed":
649
- raise ValueError(f"child Issue #{number} is not closed")
650
- return f"Issue #{number} closed"
651
-
652
-
653
586
  # The repository permissions that mean "this author can write here"
654
587
  # (Issue #1806). GitHub reports the effective permission of the user on
655
588
  # the endpoint — `maintain` arrives as `write` and `triage` as `read`
@@ -700,30 +633,34 @@ def apply_label_patch(number: int, *, repo: str, event: str,
700
633
  ready_label: str | None = None) -> None:
701
634
  """Compute the deterministic label patch for `event` and apply it.
702
635
 
703
- `current_labels` is the Issue's current label names (read once by the
704
- caller). The patch comes from `delivery_labels.label_patch` — the
705
- single source of truth for the transition rules — so the
706
- same current labels and event always produce the same idempotent
707
- patch. `ready_label` is the repository's resolved claim label (Issue
708
- #1775), passed through to that one decision. The patch is applied
709
- through `edit_issue`: one call for the add plus the first remove, then
710
- one call per extra remove (the pre-#175 kwargs). A no-op patch applies
711
- nothing; after the last write `notify.patch_applied` (Issues #1673,
636
+ `current_labels` (read once by the caller) and `ready_label` (the
637
+ resolved claim label, Issue #1775) feed `delivery_labels.label_patch`,
638
+ the one transition decision. A TERMINAL patch (merged / blocked)
639
+ removes every old state label first and adds the terminal label LAST,
640
+ so the timeline ends on the new state (Issue #2357); a failed write
641
+ restores what it removed. Other events keep the pre-#2357 writes. A
642
+ no-op patch applies nothing; `notify.patch_applied` (Issues #1673,
712
643
  #2287) sends an ordinary handoff's message, never a stop's.
713
644
  """
714
645
  ready_label = delivery_labels.queue_label(ready_label)
715
646
  to_add, to_remove = label_patch(event, current_labels, ready_label)
716
647
  if not to_add and not to_remove:
717
648
  return
718
- first_remove = to_remove[0] if to_remove else None
719
- kwargs: dict = {"repo": repo}
720
- if to_add:
721
- kwargs["add"] = to_add[0]
722
- if first_remove is not None:
723
- kwargs["remove"] = first_remove
724
- edit_issue(number, **kwargs)
725
- for label in to_remove[1:]:
726
- edit_issue(number, repo=repo, remove=label)
649
+ if event in (delivery_labels.EVENT_MERGED, delivery_labels.EVENT_BLOCKED):
650
+ terminal_labels.apply_terminal_patch(
651
+ number, repo=repo, to_add=to_add, to_remove=to_remove,
652
+ edit_issue=edit_issue, read_labels=issue_labels,
653
+ )
654
+ else:
655
+ first_remove = to_remove[0] if to_remove else None
656
+ kwargs: dict = {"repo": repo}
657
+ if to_add:
658
+ kwargs["add"] = to_add[0]
659
+ if first_remove is not None:
660
+ kwargs["remove"] = first_remove
661
+ edit_issue(number, **kwargs)
662
+ for label in to_remove[1:]:
663
+ edit_issue(number, repo=repo, remove=label)
727
664
  # Notifying the person is a pure bypass owned by `notify` (Issues
728
665
  # #1673/#1691): it decides from the event, the added labels and the
729
666
  # current labels, and reads the title lazily through the callable --
@@ -37,6 +37,13 @@ FAILURE_MESSAGES: dict[str, tuple[str, str]] = {
37
37
  "the run produced no commit and this Issue needs a change",
38
38
  "本次运行没有产生提交,这个 Issue 需要修改",
39
39
  ),
40
+ # Issue #2358: the empty-tree stop names what happened instead of asking
41
+ # for a ticket change: the commits changed no file, and the Issue may
42
+ # already be satisfied — its action below gives the reader both paths.
43
+ "failure.disposition_no_file_change": (
44
+ "the run changed no file, so nothing was delivered",
45
+ "本次运行没有改动任何文件,因此没有交付内容",
46
+ ),
40
47
  "failure.disposition_ticket_change": (
41
48
  "this Issue needs a change before Orbi can deliver it",
42
49
  "这个 Issue 需要修改,Orbi 才能继续交付",
@@ -114,6 +121,18 @@ FAILURE_MESSAGES: dict[str, tuple[str, str]] = {
114
121
  "重新加上 `ai-ready`(你们仓库的排队标签)——Orbi 会按更新后的"
115
122
  "正文重新交付这个 Issue。",
116
123
  ),
124
+ "failure.terminal_no_file_change": (
125
+ "If the session's explanation in the failure evidence below shows "
126
+ "this Issue is already satisfied, close the Issue — nothing else is "
127
+ "needed. If something is still missing, write it into the Issue "
128
+ "body, then replace `ai-blocked` with `ai-ready` (your repository's "
129
+ "queue label) — Orbi delivers this Issue again from the updated "
130
+ "body.",
131
+ "如果下面失败证据里的会话说明表明这个 Issue 已经达成,请直接关闭它"
132
+ "——无需其他操作。如果还缺少信息,请写进 Issue 正文,然后去掉 "
133
+ "`ai-blocked`、重新加上 `ai-ready`(你们仓库的排队标签)——Orbi "
134
+ "会按更新后的正文重新交付这个 Issue。",
135
+ ),
117
136
  "failure.terminal_check_credentials": (
118
137
  "Verify the GitHub/provider credential this run needed — it must be "
119
138
  "valid, unexpired and carry the permission the reason names — then "
@@ -8,6 +8,7 @@ machine row (run marker, `run_id=`, `repo_config:`, `failure:`, receipt
8
8
  rows) has an entry here.
9
9
  """
10
10
  from orbi.language_terms_criteria import CRITERIA_MESSAGES
11
+ from orbi.language_terms_epic import EPIC_MESSAGES
11
12
  from orbi.language_terms_fix import BASE_CI_FIX_MESSAGES
12
13
 
13
14
  DISPLAY_TERMS: dict[str, tuple[str, str]] = {
@@ -347,7 +348,7 @@ SPLIT_MESSAGES: dict[str, tuple[str, str]] = {
347
348
  EXTRA_MESSAGES: dict[str, tuple[str, str]] = {
348
349
  **DISPLAY_TERMS, **BASE_CI_RED_MESSAGES, **CHECK_PERMISSION_MESSAGES,
349
350
  **CLARIFY_SUGGESTION_MESSAGES, **SPLIT_MESSAGES,
350
- **CRITERIA_MESSAGES, **BASE_CI_FIX_MESSAGES,
351
+ **CRITERIA_MESSAGES, **BASE_CI_FIX_MESSAGES, **EPIC_MESSAGES,
351
352
  # The rejection a NO-ARGUMENT in-ticket command owes its author
352
353
  # (Issue #1922): the shared "write exactly one {label}" wording would
353
354
  # contradict the usage line printed beside it for an arity-0 command