orbi-cli 0.7.55__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.55/src/orbi_cli.egg-info → orbi_cli-0.7.57}/PKG-INFO +1 -1
  2. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/pyproject.toml +1 -1
  3. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/__init__.py +1 -1
  4. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/claim.py +10 -7
  5. {orbi_cli-0.7.55 → 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.55 → orbi_cli-0.7.57}/src/orbi/failure.py +9 -25
  8. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/failure_evidence.py +72 -9
  9. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/failure_report.py +19 -3
  10. orbi_cli-0.7.57/src/orbi/failure_stop.py +131 -0
  11. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/github.py +35 -98
  12. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/language_failure.py +93 -2
  13. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/language_terms.py +2 -1
  14. orbi_cli-0.7.57/src/orbi/language_terms_epic.py +48 -0
  15. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/progress.py +9 -4
  16. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/progress_outcome.py +21 -22
  17. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/release_closeout.py +10 -10
  18. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/release_comments.py +3 -41
  19. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/resume_verification.py +7 -22
  20. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/review_merge.py +16 -16
  21. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/runner.py +1 -1
  22. orbi_cli-0.7.57/src/orbi/terminal_labels.py +56 -0
  23. {orbi_cli-0.7.55 → orbi_cli-0.7.57/src/orbi_cli.egg-info}/PKG-INFO +1 -1
  24. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi_cli.egg-info/SOURCES.txt +5 -0
  25. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_apply_label_patch.py +105 -0
  26. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_blocked_comment.py +4 -1
  27. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_bootstrap_adapters.py +0 -75
  28. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_bootstrap_delivery.py +113 -62
  29. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_bootstrap_release.py +191 -52
  30. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_claim_resume.py +4 -5
  31. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_failure_report.py +15 -6
  32. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_outcome.py +47 -17
  33. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_reconcile.py +162 -61
  34. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_tickets.py +14 -9
  35. orbi_cli-0.7.57/tests/test_epic_reconciliation.py +283 -0
  36. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_failure.py +169 -2
  37. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_failure_report.py +382 -6
  38. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_fix_needed_loop.py +48 -33
  39. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_git_merge_smoke.py +6 -4
  40. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_message_language.py +0 -46
  41. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_notify.py +7 -2
  42. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_pr_verification.py +8 -6
  43. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_progress_wiring.py +41 -35
  44. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_public_helpers.py +9 -1
  45. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_release_extraction.py +4 -3
  46. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_resume_e2e.py +28 -24
  47. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_resume_pr.py +102 -137
  48. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_review_merge.py +22 -17
  49. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_user_acceptance_contract.py +23 -0
  50. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/LICENSE +0 -0
  51. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/README.md +0 -0
  52. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/docs/licenses/sustainable-use-license.md +0 -0
  53. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/setup.cfg +0 -0
  54. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/acceptance_section.py +0 -0
  55. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/amend_command.py +0 -0
  56. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/answer.py +0 -0
  57. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/base_ci_fix.py +0 -0
  58. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/base_ci_red.py +0 -0
  59. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/blocked_comment.py +0 -0
  60. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/blocked_record.py +0 -0
  61. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/blocked_scan.py +0 -0
  62. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/body_steering.py +0 -0
  63. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/branch_reclaim.py +0 -0
  64. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/check_permission.py +0 -0
  65. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/checks.py +0 -0
  66. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/claim_race.py +0 -0
  67. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/clarify.py +0 -0
  68. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/clarify_proposal.py +0 -0
  69. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/clarify_stop.py +0 -0
  70. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/cli.py +0 -0
  71. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/cli_commands.py +0 -0
  72. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/cli_doctor.py +0 -0
  73. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/cli_parser.py +0 -0
  74. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/cli_source.py +0 -0
  75. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/cli_status.py +0 -0
  76. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/cli_ticket_command.py +0 -0
  77. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/command_line.py +0 -0
  78. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/comment_kind.py +0 -0
  79. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/comment_rest_id.py +0 -0
  80. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/comment_trust.py +0 -0
  81. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/config.py +0 -0
  82. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/config_hint.py +0 -0
  83. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/delivery_comment.py +0 -0
  84. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/delivery_push.py +0 -0
  85. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/delivery_scene.py +0 -0
  86. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/draft.py +0 -0
  87. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/draft_cli.py +0 -0
  88. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/draft_document.py +0 -0
  89. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/draft_marker.py +0 -0
  90. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/draft_validate.py +0 -0
  91. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/engine_source.py +0 -0
  92. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/example_config.toml +0 -0
  93. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/extensions/clarify_verdict.ts +0 -0
  94. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/extensions/draft_tools.ts +0 -0
  95. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/gh_response.py +0 -0
  96. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/git_identity.py +0 -0
  97. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/git_transport.py +0 -0
  98. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/github_feedback.py +0 -0
  99. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/gitops.py +0 -0
  100. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/human_review.py +0 -0
  101. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/implementation_delivery.py +0 -0
  102. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/journal.py +0 -0
  103. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/labels.py +0 -0
  104. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/labels.toml +0 -0
  105. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/language.py +0 -0
  106. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/language_terms_criteria.py +0 -0
  107. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/language_terms_fix.py +0 -0
  108. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/launchd_deploy.py +0 -0
  109. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/merge_blocked.py +0 -0
  110. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/merge_exec.py +0 -0
  111. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/merge_gate.py +0 -0
  112. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/merge_handoff.py +0 -0
  113. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/milestone.py +0 -0
  114. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/milestone_command.py +0 -0
  115. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/milestone_errors.py +0 -0
  116. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/notify.py +0 -0
  117. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/notify_text.py +0 -0
  118. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/ops_delivery.py +0 -0
  119. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/pi_activity.py +0 -0
  120. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/pi_command.py +0 -0
  121. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/pi_exec.py +0 -0
  122. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/pi_idle.py +0 -0
  123. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/pi_process.py +0 -0
  124. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/pi_recovery.py +0 -0
  125. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/pi_session.py +0 -0
  126. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/pi_stream_log.py +0 -0
  127. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/pilot_setup.py +0 -0
  128. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/pilot_slots.py +0 -0
  129. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/plan_milestone.py +0 -0
  130. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/pr_head_sync.py +0 -0
  131. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/pr_verification.py +0 -0
  132. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/progress_display.py +0 -0
  133. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/progress_summary.py +0 -0
  134. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/provider_balance.py +0 -0
  135. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/question.py +0 -0
  136. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/recoverable_failure.py +0 -0
  137. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/release.py +0 -0
  138. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/release_declaration.py +0 -0
  139. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/release_git.py +0 -0
  140. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/release_notes.py +0 -0
  141. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/release_run.py +0 -0
  142. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/repo_config.py +0 -0
  143. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/requeue.py +0 -0
  144. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/restart_scan.py +0 -0
  145. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/resume_scan.py +0 -0
  146. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/review_ci_status.py +0 -0
  147. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/review_rounds.py +0 -0
  148. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/review_verdict.py +0 -0
  149. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/review_wait.py +0 -0
  150. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/run_fields.py +0 -0
  151. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/run_state.py +0 -0
  152. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/runner_health.py +0 -0
  153. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/runner_marker.py +0 -0
  154. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/runner_source.py +0 -0
  155. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/scene.py +0 -0
  156. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/scheduler.py +0 -0
  157. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/scheduler_units.py +0 -0
  158. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/session_command.py +0 -0
  159. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/setup_checks.py +0 -0
  160. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/setup_config.py +0 -0
  161. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/source_pool.py +0 -0
  162. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/split_apply.py +0 -0
  163. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/split_command.py +0 -0
  164. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/status_observe.py +0 -0
  165. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/steering.py +0 -0
  166. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/stop_comment.py +0 -0
  167. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/stopped_scans.py +0 -0
  168. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/suggest.py +0 -0
  169. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/systemd_deploy.py +0 -0
  170. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/terminal_stops.py +0 -0
  171. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/tick_reads.py +0 -0
  172. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/ticket_command.py +0 -0
  173. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/ticket_command_registry.py +0 -0
  174. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/ticket_criteria.py +0 -0
  175. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/user_summary.py +0 -0
  176. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/waiting_checks.py +0 -0
  177. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi/worktree_retention.py +0 -0
  178. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi_cli.egg-info/dependency_links.txt +0 -0
  179. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi_cli.egg-info/entry_points.txt +0 -0
  180. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/src/orbi_cli.egg-info/top_level.txt +0 -0
  181. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_agents_md.py +0 -0
  182. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_amend_command.py +0 -0
  183. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_answer.py +0 -0
  184. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_base_branch_failure.py +0 -0
  185. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_base_ci_red.py +0 -0
  186. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_body_steering.py +0 -0
  187. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_bootstrap_pi.py +0 -0
  188. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_bootstrap_preflight.py +0 -0
  189. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_main.py +0 -0
  190. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_milestone.py +0 -0
  191. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_prompt.py +0 -0
  192. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_bootstrap_runner_session.py +0 -0
  193. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_branch_reclaim.py +0 -0
  194. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_check_permission.py +0 -0
  195. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_ci_macos_workflow.py +0 -0
  196. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_ci_workflow.py +0 -0
  197. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_claim_race.py +0 -0
  198. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_clarify.py +0 -0
  199. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_claude_plugin.py +0 -0
  200. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_cli_golden.py +0 -0
  201. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_cli_install.py +0 -0
  202. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_cli_milestone.py +0 -0
  203. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_cli_packaging.py +0 -0
  204. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_cli_source.py +0 -0
  205. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_cli_ticket_commands.py +0 -0
  206. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_command_receipt_contract.py +0 -0
  207. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_comment_identity.py +0 -0
  208. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_comment_readers_contract.py +0 -0
  209. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_comment_rest_id.py +0 -0
  210. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_comment_trust.py +0 -0
  211. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_concurrency_e2e.py +0 -0
  212. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_constitution.py +0 -0
  213. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_coverage_gate.py +0 -0
  214. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_deliver_pr_fakes.py +0 -0
  215. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_delivery_branch_delete.py +0 -0
  216. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_delivery_labels.py +0 -0
  217. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_delivery_scene.py +0 -0
  218. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_docker_docs.py +0 -0
  219. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_docker_entrypoint.py +0 -0
  220. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_docker_image_workflow.py +0 -0
  221. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_docs_i18n.py +0 -0
  222. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_docs_issue_shapes.py +0 -0
  223. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_docs_labels.py +0 -0
  224. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_docs_mermaid.py +0 -0
  225. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_docs_releases.py +0 -0
  226. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_docs_safety_matrix.py +0 -0
  227. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_docs_single_source.py +0 -0
  228. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_docs_site.py +0 -0
  229. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_draft.py +0 -0
  230. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_draft_repo_view.py +0 -0
  231. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_draft_validate.py +0 -0
  232. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_engine_source.py +0 -0
  233. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_gh_read_retry.py +0 -0
  234. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_gh_response.py +0 -0
  235. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_git_base_smoke.py +0 -0
  236. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_git_network_retry.py +0 -0
  237. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_git_transport.py +0 -0
  238. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_github.py +0 -0
  239. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_github_fakes.py +0 -0
  240. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_gitops.py +0 -0
  241. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_gitops_fakes.py +0 -0
  242. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_human_review.py +0 -0
  243. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_import_graph.py +0 -0
  244. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_install_sh.py +0 -0
  245. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_issue_1367.py +0 -0
  246. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_issue_461.py +0 -0
  247. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_issue_template_config.py +0 -0
  248. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_journal.py +0 -0
  249. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_journal_events.py +0 -0
  250. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_labels.py +0 -0
  251. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_launchd_deploy.py +0 -0
  252. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_license.py +0 -0
  253. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_merge_exec_extraction.py +0 -0
  254. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_milestone_command.py +0 -0
  255. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_ops_e2e.py +0 -0
  256. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_orbi.py +0 -0
  257. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_orbi_dashboard.py +0 -0
  258. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_orbi_exporter.py +0 -0
  259. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_patch_ratchet.py +0 -0
  260. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_pi_activity.py +0 -0
  261. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_pi_child_reap.py +0 -0
  262. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_pi_command.py +0 -0
  263. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_pi_exec.py +0 -0
  264. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_pi_extensions.py +0 -0
  265. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_pi_provider_templates.py +0 -0
  266. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_pi_recovery.py +0 -0
  267. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_pi_session.py +0 -0
  268. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_pilot_setup.py +0 -0
  269. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_pilot_slots.py +0 -0
  270. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_pr_issue_link_workflow.py +0 -0
  271. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_prerequisite_check.py +0 -0
  272. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_progress.py +0 -0
  273. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_prompt_contract.py +0 -0
  274. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_public_contracts.py +0 -0
  275. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_publish_workflow.py +0 -0
  276. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_question.py +0 -0
  277. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_question_resume.py +0 -0
  278. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_release_docs_workflow.py +0 -0
  279. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_release_ticket_templates.py +0 -0
  280. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_repo_config.py +0 -0
  281. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_resume_continue_e2e.py +0 -0
  282. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_resume_other_executor.py +0 -0
  283. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_review_verdict.py +0 -0
  284. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_review_waiting.py +0 -0
  285. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_run_artifacts.py +0 -0
  286. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_run_fields.py +0 -0
  287. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_run_id_e2e.py +0 -0
  288. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_run_id_fixture.py +0 -0
  289. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_runner_config.py +0 -0
  290. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_runner_health.py +0 -0
  291. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_runner_source_freshness.py +0 -0
  292. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_scene.py +0 -0
  293. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_scheduler.py +0 -0
  294. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_seam.py +0 -0
  295. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_setup_output_golden.py +0 -0
  296. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_size_ratchet.py +0 -0
  297. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_split_command.py +0 -0
  298. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_src_layout.py +0 -0
  299. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_status_observe.py +0 -0
  300. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_steering_review.py +0 -0
  301. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_suggest.py +0 -0
  302. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_suggest_repo_view.py +0 -0
  303. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_suite_hygiene.py +0 -0
  304. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_systemd_deploy.py +0 -0
  305. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_systemd_timer.py +0 -0
  306. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_tick_reads.py +0 -0
  307. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_ticket_command.py +0 -0
  308. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_ticket_command_registration.py +0 -0
  309. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_user_summary.py +0 -0
  310. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_versioned_comment_block.py +0 -0
  311. {orbi_cli-0.7.55 → orbi_cli-0.7.57}/tests/test_waiting_checks.py +0 -0
  312. {orbi_cli-0.7.55 → 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.55
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.55"
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.55"
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})"
@@ -27,7 +27,10 @@ import re
27
27
  import subprocess
28
28
 
29
29
  from orbi import gh_response, language, provider_balance, user_summary
30
+ # Issue #2351: the stop wording moved to its own module (this one is at its
31
+ # size-ratchet ceiling); it is re-exported here for its existing callers.
30
32
  from orbi.comment_kind import parse_versioned_block
33
+ from orbi.failure_stop import stop_wording, terminal_action # noqa: F401
31
34
 
32
35
  SCHEMA_VERSION = 1
33
36
 
@@ -480,28 +483,6 @@ def workflow_permission_action(
480
483
  )
481
484
 
482
485
 
483
- def terminal_action(record: Failure,
484
- language_code: str, *,
485
- base_branch: str | None = None) -> str:
486
- """The reader action for the implement-phase terminal handler.
487
-
488
- An unrecognized failure says the cause could not be determined
489
- instead of implying the Issue text is the problem (Issue #1651); a
490
- missing base branch names the branch and both repairs — create it, or
491
- pick an existing one where the repository was set up — plus how to
492
- restart the Issue (Issue #1749, #1753); every other recognized
493
- terminal failure keeps the existing generic action.
494
- """
495
- if record.reason_code == "unclassified":
496
- return language.text(language_code, "failure.terminal_unclassified")
497
- if record.reason_code == "base_branch_missing":
498
- return language.text(
499
- language_code, "failure.terminal_base_branch_missing",
500
- base_branch=base_branch or "-",
501
- )
502
- return language.text(language_code, "failure.terminal_generic")
503
-
504
-
505
486
  def terminal_reason(detail: str, record: Failure, *,
506
487
  base_branch: str | None, language_code: str) -> str:
507
488
  """The reader-facing reason of the implement-phase terminal handler.
@@ -632,9 +613,12 @@ def failure_comment_body(*, outcome: str, action: str, reason: str,
632
613
  def message(key: str, **fields: object) -> str:
633
614
  return language.text(language_code, key, **fields)
634
615
 
635
- headline = message(
636
- "failure.headline_fix_needed" if retrying
637
- else "failure.headline_blocked",
616
+ # The blocked headline is the ONE wording function's verdict for this
617
+ # record (Issue #2351): the action the record carries decides it, so the
618
+ # headline never promises a decision the action does not ask for.
619
+ headline = (
620
+ message("failure.headline_fix_needed") if retrying
621
+ else stop_wording(failure_record, language_code)[0]
638
622
  )
639
623
  parts = [render(failure_record), headline]
640
624
  # The task identity and the optional fixed project status link sit
@@ -1,12 +1,12 @@
1
1
  """The bounded evidence of one failure comment (Issue #2202).
2
2
 
3
3
  The failure report copies what survives a terminal worktree cleanup into
4
- ONE comment: the tail of the failing command's streams, a structural
5
- summary of the Pi session log and the tail of `.orbi/test.log`. This module
6
- owns that rendering — the segment caps, the de-colouring, the session
7
- summary and the shrink-to-fit loop that keeps an oversized comment inside
8
- `FAILURE_COMMENT_MAX_CHARS` by shrinking ONLY the evidence, never its
9
- structure (Issue #1711).
4
+ ONE comment: the tail of the failing command's streams, the session's own
5
+ final explanation, a structural summary of the Pi session log and the tail
6
+ of `.orbi/test.log`. This module owns that rendering — the segment caps, the
7
+ de-colouring, the session summary and the shrink-to-fit loop that keeps an
8
+ oversized comment inside `FAILURE_COMMENT_MAX_CHARS` by shrinking ONLY the
9
+ evidence, never its structure (Issue #1711).
10
10
 
11
11
  A verbatim extraction out of `orbi.failure_report` (Article 3.5, Issue
12
12
  #2202): that module sits at the 1,000-line cap the size ratchet freezes, so
@@ -71,8 +71,10 @@ def _session_summary(session_file: Path,
71
71
  """Structured summary of the last session records.
72
72
 
73
73
  One line per parsed record — timestamp, type, role, tool name and
74
- content-block kinds; the record text itself never enters the comment
75
- (the full log path is named next to the segment). A record whose
74
+ content-block kinds; THIS summary never carries the record text (the
75
+ session's own final explanation is quoted in its own segment,
76
+ `session_explanation`, Issue #2351, and the full log path is named next
77
+ to the segment). A record whose
76
78
  text blocks repeat the previous record's is skipped: pi logs the
77
79
  final assistant text twice (once inside the full message, once
78
80
  standalone), which used to duplicate whole paragraphs in the
@@ -136,6 +138,54 @@ def _session_summary(session_file: Path,
136
138
  EVIDENCE_SEGMENT_CAP = 4000
137
139
  _EVIDENCE_CAP_STEP = 500
138
140
 
141
+ # The session-log tail a read inspects (the same window the summary reads):
142
+ # the closing assistant text sits at the end of the file.
143
+ _SESSION_WINDOW_BYTES = 65536
144
+
145
+
146
+ def session_explanation(session_file: Path | None) -> str | None:
147
+ """The text of the session's last assistant message, or None.
148
+
149
+ Issue #2351: the sentence that explains why a run stopped is written
150
+ nowhere but the session's own final response, so the failure comment
151
+ quotes it (bounded, fenced and redacted like every other comment text)
152
+ instead of keeping every session record metadata-only. A partial
153
+ trailing line — a killed session mid-write — is skipped, and the final
154
+ record pi logs twice is read ONCE because only the newest assistant text
155
+ is read at all.
156
+ """
157
+ if session_file is None:
158
+ return None
159
+ try:
160
+ with session_file.open("rb") as handle:
161
+ handle.seek(0, os.SEEK_END)
162
+ size = handle.tell()
163
+ window = min(size, _SESSION_WINDOW_BYTES)
164
+ handle.seek(size - window)
165
+ content = handle.read(window).decode("utf-8", errors="replace")
166
+ except (OSError, UnicodeError):
167
+ return None
168
+ for line in reversed(content.splitlines()):
169
+ try:
170
+ record = json.loads(line)
171
+ except ValueError:
172
+ continue
173
+ if not isinstance(record, dict):
174
+ continue
175
+ message = record.get("message")
176
+ if not isinstance(message, dict) or message.get("role") != "assistant":
177
+ continue
178
+ blocks = message.get("content")
179
+ if not isinstance(blocks, list):
180
+ continue
181
+ text = "".join(
182
+ block.get("text", "") for block in blocks
183
+ if isinstance(block, dict) and block.get("type") == "text"
184
+ ).strip()
185
+ if text:
186
+ return text
187
+ return None
188
+
139
189
 
140
190
  def _failure_evidence(worktree: Path | None, exc: BaseException, *,
141
191
  language_code: str,
@@ -146,7 +196,9 @@ def _failure_evidence(worktree: Path | None, exc: BaseException, *,
146
196
  test log are read before cleanup and only bounded, fenced segments are
147
197
  copied into the failure comment: raw output stays literal on GitHub,
148
198
  the session tail is a structural summary whose duplicates are removed,
149
- and the full session log is named for the deep-dive. The
199
+ and the full session log is named for the deep-dive. The session's
200
+ final explanation is the ONE session text the comment quotes (Issue
201
+ #2351) — a stop's cause is written nowhere else. The
150
202
  failure reason itself stays the readable head of the comment.
151
203
 
152
204
  `cap` bounds each segment, so every fence closes (Issue #1711).
@@ -173,8 +225,19 @@ def _failure_evidence(worktree: Path | None, exc: BaseException, *,
173
225
  test_path = worktree / ".orbi" / "test.log"
174
226
  if test_path.is_file():
175
227
  test_log = _tail_text(test_path)
228
+ # Issue #2351: the session's own closing words lead the evidence, in
229
+ # their own bounded segment; a session that left none says so plainly.
230
+ explanation = session_explanation(session_file)
231
+ explanation_segment = (
232
+ f"{language.text(language_code, 'failure.evidence.session_explanation')}\n"
233
+ f"{fenced(redact_local_paths(explanation), cap=cap)}"
234
+ if explanation is not None
235
+ else language.text(
236
+ language_code, "failure.evidence.no_session_explanation")
237
+ )
176
238
  return (
177
239
  f"\n\n{language.text(language_code, 'failure.evidence.heading')}\n"
240
+ f"{explanation_segment}\n"
178
241
  f"exit_code={return_code if return_code is not None else '<unknown>'}\n"
179
242
  f"\nstderr_tail:\n{fenced(redact_local_paths(stderr), cap=cap)}\n"
180
243
  f"\nstdout_tail:\n{fenced(redact_local_paths(stdout), cap=cap)}\n"
@@ -39,6 +39,7 @@ from orbi.comment_rest_id import rest_comment_id
39
39
  from orbi.comment_trust import latest_run_marker, trusted_comments
40
40
  from orbi.delivery_labels import EVENT_FIX_NEEDED
41
41
  from orbi import delivery_labels
42
+ from orbi import failure_stop
42
43
  from orbi.failure import (
43
44
  failure_comment_body, failure_detail, failure_summary,
44
45
  redact_local_paths, terminal_action,
@@ -582,6 +583,21 @@ def _typed_failure_wording(
582
583
  return False, False, None
583
584
 
584
585
 
586
+ def _stop_headline(record: failure.Failure, language_code: str,
587
+ outcome: str, red: object) -> str | None:
588
+ """The stop headline the failure comment carries, or None.
589
+
590
+ Issue #2351: the terminal progress comment shows the SAME sentence as the
591
+ failure comment, through the ONE wording function of the record. A
592
+ recoverable (`fix_needed`) outcome keeps the progress comment's own
593
+ retry headline, and the base-branch-red scene renders its own body (a
594
+ ready line and its paused scene), so both keep their own text.
595
+ """
596
+ if outcome != "blocked" or red is not None:
597
+ return None
598
+ return failure_stop.stop_wording(record, language_code)[0]
599
+
600
+
585
601
  def report_delivery_failure(
586
602
  exc: BaseException, *, issue: dict, source_repo: str,
587
603
  run_id: str | None, pr_url: str | None, worktree: Path | None,
@@ -945,8 +961,8 @@ def report_delivery_failure(
945
961
  ),
946
962
  priority=priority, detail=finish_failure,
947
963
  next_step=next_step, outcome=finish_outcome,
948
- source_repo=source_repo, action=action,
949
- reason=reason, diagnosis=diagnosis,
950
- language_code=language_code, status_url=status_url,
964
+ source_repo=source_repo, action=action, reason=reason,
965
+ diagnosis=diagnosis, language_code=language_code,
966
+ status_url=status_url, headline=_stop_headline(failure_record, language_code, outcome, red),
951
967
  )))
952
968
  return outcome