orbi-cli 0.7.58__tar.gz → 0.7.60__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 (321) hide show
  1. {orbi_cli-0.7.58/src/orbi_cli.egg-info → orbi_cli-0.7.60}/PKG-INFO +2 -2
  2. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/README.md +1 -1
  3. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/pyproject.toml +1 -1
  4. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/__init__.py +1 -1
  5. orbi_cli-0.7.60/src/orbi/attachments.py +499 -0
  6. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/clarify.py +2 -2
  7. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/cli_commands.py +1 -1
  8. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/draft.py +117 -137
  9. orbi_cli-0.7.60/src/orbi/draft_author.py +68 -0
  10. orbi_cli-0.7.60/src/orbi/draft_cli.py +150 -0
  11. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/draft_document.py +63 -4
  12. orbi_cli-0.7.60/src/orbi/draft_interactive.py +146 -0
  13. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/draft_marker.py +27 -60
  14. orbi_cli-0.7.60/src/orbi/draft_prompt.py +133 -0
  15. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/extensions/draft_tools.ts +6 -0
  16. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/failure.py +6 -0
  17. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/failure_report.py +22 -2
  18. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/failure_stop.py +7 -0
  19. orbi_cli-0.7.60/src/orbi/issue_images.py +248 -0
  20. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/journal.py +1 -0
  21. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/language_failure.py +16 -0
  22. orbi_cli-0.7.60/src/orbi/model_catalog.py +102 -0
  23. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/pi_session.py +48 -36
  24. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/review_merge.py +1 -1
  25. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/split_apply.py +34 -5
  26. {orbi_cli-0.7.58 → orbi_cli-0.7.60/src/orbi_cli.egg-info}/PKG-INFO +2 -2
  27. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi_cli.egg-info/SOURCES.txt +8 -0
  28. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_docs_site.py +7 -5
  29. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_draft.py +21 -11
  30. orbi_cli-0.7.60/tests/test_draft_attachments.py +931 -0
  31. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_draft_validate.py +24 -0
  32. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_failure.py +5 -4
  33. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_github_fakes.py +34 -0
  34. orbi_cli-0.7.60/tests/test_issue_images.py +488 -0
  35. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_pi_provider_templates.py +12 -0
  36. orbi_cli-0.7.58/src/orbi/draft_cli.py +0 -250
  37. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/LICENSE +0 -0
  38. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/docs/licenses/sustainable-use-license.md +0 -0
  39. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/setup.cfg +0 -0
  40. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/acceptance_section.py +0 -0
  41. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/amend_command.py +0 -0
  42. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/answer.py +0 -0
  43. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/base_ci_fix.py +0 -0
  44. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/base_ci_red.py +0 -0
  45. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/blocked_comment.py +0 -0
  46. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/blocked_record.py +0 -0
  47. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/blocked_scan.py +0 -0
  48. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/body_steering.py +0 -0
  49. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/branch_reclaim.py +0 -0
  50. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/check_permission.py +0 -0
  51. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/checks.py +0 -0
  52. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/claim.py +0 -0
  53. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/claim_race.py +0 -0
  54. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/clarify_proposal.py +0 -0
  55. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/clarify_stop.py +0 -0
  56. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/cli.py +0 -0
  57. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/cli_doctor.py +0 -0
  58. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/cli_parser.py +0 -0
  59. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/cli_source.py +0 -0
  60. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/cli_status.py +0 -0
  61. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/cli_ticket_command.py +0 -0
  62. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/command_line.py +0 -0
  63. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/comment_kind.py +0 -0
  64. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/comment_rest_id.py +0 -0
  65. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/comment_trust.py +0 -0
  66. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/config.py +0 -0
  67. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/config_hint.py +0 -0
  68. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/delivery_comment.py +0 -0
  69. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/delivery_labels.py +0 -0
  70. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/delivery_push.py +0 -0
  71. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/delivery_scene.py +0 -0
  72. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/draft_validate.py +0 -0
  73. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/engine_source.py +0 -0
  74. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/epic_reconciliation.py +0 -0
  75. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/example_config.toml +0 -0
  76. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/extensions/clarify_verdict.ts +0 -0
  77. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/failure_evidence.py +0 -0
  78. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/gh_response.py +0 -0
  79. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/git_identity.py +0 -0
  80. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/git_transport.py +0 -0
  81. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/github.py +0 -0
  82. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/github_feedback.py +0 -0
  83. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/gitops.py +0 -0
  84. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/human_review.py +0 -0
  85. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/implementation_delivery.py +0 -0
  86. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/labels.py +0 -0
  87. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/labels.toml +0 -0
  88. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/language.py +0 -0
  89. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/language_terms.py +0 -0
  90. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/language_terms_criteria.py +0 -0
  91. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/language_terms_epic.py +0 -0
  92. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/language_terms_fix.py +0 -0
  93. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/launchd_deploy.py +0 -0
  94. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/merge_blocked.py +0 -0
  95. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/merge_exec.py +0 -0
  96. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/merge_gate.py +0 -0
  97. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/merge_handoff.py +0 -0
  98. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/milestone.py +0 -0
  99. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/milestone_command.py +0 -0
  100. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/milestone_errors.py +0 -0
  101. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/notify.py +0 -0
  102. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/notify_text.py +0 -0
  103. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/ops_delivery.py +0 -0
  104. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/pi_activity.py +0 -0
  105. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/pi_command.py +0 -0
  106. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/pi_exec.py +0 -0
  107. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/pi_idle.py +0 -0
  108. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/pi_process.py +0 -0
  109. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/pi_recovery.py +0 -0
  110. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/pi_stream_log.py +0 -0
  111. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/pilot_setup.py +0 -0
  112. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/pilot_slots.py +0 -0
  113. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/plan_milestone.py +0 -0
  114. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/pr_head_sync.py +0 -0
  115. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/pr_verification.py +0 -0
  116. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/progress.py +0 -0
  117. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/progress_display.py +0 -0
  118. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/progress_outcome.py +0 -0
  119. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/progress_summary.py +0 -0
  120. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/provider_balance.py +0 -0
  121. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/question.py +0 -0
  122. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/recoverable_failure.py +0 -0
  123. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/release.py +0 -0
  124. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/release_closeout.py +0 -0
  125. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/release_comments.py +0 -0
  126. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/release_declaration.py +0 -0
  127. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/release_git.py +0 -0
  128. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/release_notes.py +0 -0
  129. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/release_run.py +0 -0
  130. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/repo_config.py +0 -0
  131. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/requeue.py +0 -0
  132. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/restart_scan.py +0 -0
  133. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/resume_scan.py +0 -0
  134. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/resume_verification.py +0 -0
  135. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/review_ci_status.py +0 -0
  136. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/review_rounds.py +0 -0
  137. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/review_verdict.py +0 -0
  138. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/review_wait.py +0 -0
  139. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/run_fields.py +0 -0
  140. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/run_state.py +0 -0
  141. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/runner.py +0 -0
  142. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/runner_health.py +0 -0
  143. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/runner_marker.py +0 -0
  144. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/runner_source.py +0 -0
  145. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/scene.py +0 -0
  146. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/scheduler.py +0 -0
  147. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/scheduler_units.py +0 -0
  148. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/session_command.py +0 -0
  149. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/setup_checks.py +0 -0
  150. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/setup_config.py +0 -0
  151. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/source_pool.py +0 -0
  152. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/split_command.py +0 -0
  153. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/status_observe.py +0 -0
  154. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/steering.py +0 -0
  155. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/stop_comment.py +0 -0
  156. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/stopped_scans.py +0 -0
  157. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/suggest.py +0 -0
  158. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/systemd_deploy.py +0 -0
  159. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/terminal_labels.py +0 -0
  160. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/terminal_stops.py +0 -0
  161. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/tick_reads.py +0 -0
  162. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/ticket_command.py +0 -0
  163. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/ticket_command_registry.py +0 -0
  164. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/ticket_criteria.py +0 -0
  165. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/user_summary.py +0 -0
  166. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/waiting_checks.py +0 -0
  167. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi/worktree_retention.py +0 -0
  168. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi_cli.egg-info/dependency_links.txt +0 -0
  169. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi_cli.egg-info/entry_points.txt +0 -0
  170. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/src/orbi_cli.egg-info/top_level.txt +0 -0
  171. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_agents_md.py +0 -0
  172. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_amend_command.py +0 -0
  173. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_answer.py +0 -0
  174. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_apply_label_patch.py +0 -0
  175. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_base_branch_failure.py +0 -0
  176. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_base_ci_red.py +0 -0
  177. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_blocked_comment.py +0 -0
  178. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_body_steering.py +0 -0
  179. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_bootstrap_adapters.py +0 -0
  180. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_bootstrap_delivery.py +0 -0
  181. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_bootstrap_pi.py +0 -0
  182. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_bootstrap_preflight.py +0 -0
  183. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_bootstrap_release.py +0 -0
  184. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_bootstrap_runner_claim_resume.py +0 -0
  185. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_bootstrap_runner_failure_report.py +0 -0
  186. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_bootstrap_runner_main.py +0 -0
  187. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_bootstrap_runner_milestone.py +0 -0
  188. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_bootstrap_runner_outcome.py +0 -0
  189. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_bootstrap_runner_prompt.py +0 -0
  190. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_bootstrap_runner_reconcile.py +0 -0
  191. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_bootstrap_runner_session.py +0 -0
  192. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_bootstrap_runner_tickets.py +0 -0
  193. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_branch_reclaim.py +0 -0
  194. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_check_permission.py +0 -0
  195. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_ci_macos_workflow.py +0 -0
  196. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_ci_workflow.py +0 -0
  197. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_claim_race.py +0 -0
  198. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_clarify.py +0 -0
  199. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_claude_plugin.py +0 -0
  200. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_cli_golden.py +0 -0
  201. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_cli_install.py +0 -0
  202. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_cli_milestone.py +0 -0
  203. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_cli_packaging.py +0 -0
  204. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_cli_source.py +0 -0
  205. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_cli_ticket_commands.py +0 -0
  206. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_command_receipt_contract.py +0 -0
  207. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_comment_identity.py +0 -0
  208. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_comment_readers_contract.py +0 -0
  209. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_comment_rest_id.py +0 -0
  210. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_comment_trust.py +0 -0
  211. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_concurrency_e2e.py +0 -0
  212. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_constitution.py +0 -0
  213. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_coverage_gate.py +0 -0
  214. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_deliver_pr_fakes.py +0 -0
  215. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_delivery_branch_delete.py +0 -0
  216. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_delivery_labels.py +0 -0
  217. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_delivery_scene.py +0 -0
  218. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_docker_docs.py +0 -0
  219. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_docker_entrypoint.py +0 -0
  220. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_docker_image_workflow.py +0 -0
  221. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_docs_i18n.py +0 -0
  222. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_docs_issue_shapes.py +0 -0
  223. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_docs_labels.py +0 -0
  224. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_docs_mermaid.py +0 -0
  225. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_docs_releases.py +0 -0
  226. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_docs_safety_matrix.py +0 -0
  227. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_docs_single_source.py +0 -0
  228. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_draft_repo_view.py +0 -0
  229. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_engine_source.py +0 -0
  230. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_epic_reconciliation.py +0 -0
  231. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_failure_report.py +0 -0
  232. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_fix_needed_loop.py +0 -0
  233. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_gh_read_retry.py +0 -0
  234. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_gh_response.py +0 -0
  235. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_git_base_smoke.py +0 -0
  236. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_git_merge_smoke.py +0 -0
  237. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_git_network_retry.py +0 -0
  238. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_git_transport.py +0 -0
  239. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_github.py +0 -0
  240. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_gitops.py +0 -0
  241. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_gitops_fakes.py +0 -0
  242. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_human_review.py +0 -0
  243. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_import_graph.py +0 -0
  244. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_install_sh.py +0 -0
  245. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_issue_1367.py +0 -0
  246. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_issue_461.py +0 -0
  247. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_issue_template_config.py +0 -0
  248. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_journal.py +0 -0
  249. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_journal_events.py +0 -0
  250. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_labels.py +0 -0
  251. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_launchd_deploy.py +0 -0
  252. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_license.py +0 -0
  253. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_merge_exec_extraction.py +0 -0
  254. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_message_language.py +0 -0
  255. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_milestone_command.py +0 -0
  256. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_notify.py +0 -0
  257. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_ops_e2e.py +0 -0
  258. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_orbi.py +0 -0
  259. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_orbi_dashboard.py +0 -0
  260. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_orbi_exporter.py +0 -0
  261. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_patch_ratchet.py +0 -0
  262. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_pi_activity.py +0 -0
  263. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_pi_child_reap.py +0 -0
  264. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_pi_command.py +0 -0
  265. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_pi_exec.py +0 -0
  266. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_pi_extensions.py +0 -0
  267. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_pi_recovery.py +0 -0
  268. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_pi_session.py +0 -0
  269. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_pilot_setup.py +0 -0
  270. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_pilot_slots.py +0 -0
  271. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_pr_issue_link_workflow.py +0 -0
  272. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_pr_verification.py +0 -0
  273. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_prerequisite_check.py +0 -0
  274. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_progress.py +0 -0
  275. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_progress_wiring.py +0 -0
  276. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_prompt_contract.py +0 -0
  277. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_public_contracts.py +0 -0
  278. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_public_helpers.py +0 -0
  279. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_publish_workflow.py +0 -0
  280. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_question.py +0 -0
  281. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_question_resume.py +0 -0
  282. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_release_docs_workflow.py +0 -0
  283. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_release_extraction.py +0 -0
  284. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_release_ticket_templates.py +0 -0
  285. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_repo_config.py +0 -0
  286. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_resume_continue_e2e.py +0 -0
  287. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_resume_e2e.py +0 -0
  288. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_resume_other_executor.py +0 -0
  289. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_resume_pr.py +0 -0
  290. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_review_merge.py +0 -0
  291. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_review_verdict.py +0 -0
  292. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_review_waiting.py +0 -0
  293. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_run_artifacts.py +0 -0
  294. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_run_fields.py +0 -0
  295. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_run_id_e2e.py +0 -0
  296. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_run_id_fixture.py +0 -0
  297. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_runner_config.py +0 -0
  298. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_runner_health.py +0 -0
  299. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_runner_source_freshness.py +0 -0
  300. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_scene.py +0 -0
  301. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_scheduler.py +0 -0
  302. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_seam.py +0 -0
  303. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_setup_output_golden.py +0 -0
  304. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_size_ratchet.py +0 -0
  305. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_split_command.py +0 -0
  306. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_src_layout.py +0 -0
  307. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_status_observe.py +0 -0
  308. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_steering_review.py +0 -0
  309. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_suggest.py +0 -0
  310. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_suggest_repo_view.py +0 -0
  311. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_suite_hygiene.py +0 -0
  312. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_systemd_deploy.py +0 -0
  313. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_systemd_timer.py +0 -0
  314. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_tick_reads.py +0 -0
  315. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_ticket_command.py +0 -0
  316. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_ticket_command_registration.py +0 -0
  317. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_user_acceptance_contract.py +0 -0
  318. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_user_summary.py +0 -0
  319. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_versioned_comment_block.py +0 -0
  320. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/tests/test_waiting_checks.py +0 -0
  321. {orbi_cli-0.7.58 → orbi_cli-0.7.60}/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.58
3
+ Version: 0.7.60
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
@@ -45,7 +45,7 @@ Want just the CLI? It's on PyPI as [`orbi-cli`](https://pypi.org/project/orbi-cl
45
45
  ### Ready check (before setup)
46
46
 
47
47
  - `uv`: `uv --version`; Pi and its provider: `pi --version`, then `pi --print "reply with the single word: ok"`
48
- - GitHub CLI ≥ 2.94 ([official repository](https://github.com/cli/cli/blob/trunk/docs/install_linux.md) — Ubuntu 24.04's package 2.45.0 is too old): run `gh auth login` once, then verify `gh auth status`
48
+ - GitHub CLI ≥ 2.99 ([official repository](https://github.com/cli/cli/blob/trunk/docs/install_linux.md) — Ubuntu 24.04's package 2.45.0 is too old): run `gh auth login` once, then verify `gh auth status`
49
49
  - Linux — systemd user session: `systemctl --user status`
50
50
  - macOS — launchd GUI session: `launchctl print gui/$(id -u)` (not yet verified on real hardware; reports welcome)
51
51
 
@@ -29,7 +29,7 @@ Want just the CLI? It's on PyPI as [`orbi-cli`](https://pypi.org/project/orbi-cl
29
29
  ### Ready check (before setup)
30
30
 
31
31
  - `uv`: `uv --version`; Pi and its provider: `pi --version`, then `pi --print "reply with the single word: ok"`
32
- - GitHub CLI ≥ 2.94 ([official repository](https://github.com/cli/cli/blob/trunk/docs/install_linux.md) — Ubuntu 24.04's package 2.45.0 is too old): run `gh auth login` once, then verify `gh auth status`
32
+ - GitHub CLI ≥ 2.99 ([official repository](https://github.com/cli/cli/blob/trunk/docs/install_linux.md) — Ubuntu 24.04's package 2.45.0 is too old): run `gh auth login` once, then verify `gh auth status`
33
33
  - Linux — systemd user session: `systemctl --user status`
34
34
  - macOS — launchd GUI session: `launchctl print gui/$(id -u)` (not yet verified on real hardware; reports welcome)
35
35
 
@@ -44,7 +44,7 @@ build-backend = "setuptools.build_meta"
44
44
 
45
45
  [project]
46
46
  name = "orbi-cli"
47
- version = "0.7.58"
47
+ version = "0.7.60"
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.58"
21
+ __version__ = "0.7.60"
@@ -0,0 +1,499 @@
1
+ #!/usr/bin/env python3
2
+ """The files a person attaches to a draft (Issue #2364).
3
+
4
+ One list per draft: the round document and the creation document carry the
5
+ same 'attachments: [{name, src}]', where 'src' is a local path or an
6
+ http(s) address and the type follows from the extension. This module owns
7
+ everything that list means:
8
+
9
+ - the bounds a person can act on: 10 files, 10 MB each, and all HTML and text
10
+ of one draft together at most 50,000 characters, so they still fit in the
11
+ new Issue's body (65,536) beside the request itself;
12
+ - staging: every file is copied or downloaded into the session directory as
13
+ '.pi-session/attachments/<n>.<ext>', never under its own name, so a name
14
+ carrying '../' cannot leave the directory;
15
+ - what the session gets: the ONE context line naming the files and the
16
+ '@<path>' arguments — an image only when the run's model declares image
17
+ input (Pi sends no image otherwise, orbi.model_catalog), the HTML and text
18
+ only for the tool-less fidelity pass, because the drafting session reads
19
+ them with 'read';
20
+ - what a NEW Issue gets: the Attachments section after the draft marker, a
21
+ local image uploaded through 'gh issue create --attach' and an http(s) one
22
+ written as its own address and never requested, so a creation does not
23
+ depend on that address being reachable (Issue #2374).
24
+
25
+ The extension is the only type signal. Every other type is refused with its
26
+ reason, and so is a file over a bound: the person reads why, in one sentence.
27
+ """
28
+ from __future__ import annotations
29
+
30
+ import contextlib
31
+ import re
32
+ import tempfile
33
+ import urllib.request
34
+ from dataclasses import dataclass
35
+ from pathlib import Path
36
+ from typing import Iterator, Sequence
37
+
38
+ IMAGE_SUFFIXES = frozenset({".png", ".jpg", ".jpeg", ".gif", ".webp"})
39
+ TEXT_SUFFIXES = frozenset(
40
+ {".htm", ".html", ".txt", ".md", ".csv", ".tsv", ".json", ".log"}
41
+ )
42
+ MAX_FILES = 10
43
+ MAX_FILE_BYTES = 10 * 1024 * 1024
44
+ MAX_TEXT_CHARACTERS = 50_000
45
+ DOWNLOAD_TIMEOUT_SECONDS = 60
46
+ # The staged files live in the session directory's own subdirectory, so a
47
+ # caller accounting the session (docs/public-contracts.mdx) finds them there.
48
+ DIRECTORY = "attachments"
49
+ SECTION_HEADING = "## Attachments"
50
+ _URL_RE = re.compile(r"^https?://", re.IGNORECASE)
51
+ _TICK_RUN_RE = re.compile("[\u0060]+")
52
+ _ATTACHMENTS_HEADING_RE = re.compile(
53
+ r"^##[ \t]+Attachments[ \t]*$", re.MULTILINE,
54
+ )
55
+ # One block of a written section: an image line, or a folded text file.
56
+ _BLOCK_RE = re.compile(
57
+ r"^!\[[^\]]*\]\([^)]*\)[ \t]*$|<details>.*?</details>",
58
+ re.MULTILINE | re.DOTALL,
59
+ )
60
+
61
+
62
+ class AttachmentError(RuntimeError):
63
+ """One file, or the list itself, the engine refuses; str() is the reason."""
64
+
65
+
66
+ @dataclass(frozen=True)
67
+ class Attachment:
68
+ """One entry of the draft's attachments list."""
69
+
70
+ name: str
71
+ src: str
72
+
73
+
74
+ @dataclass(frozen=True)
75
+ class StagedFile:
76
+ """One attachment as it sits in the session or the filing directory."""
77
+
78
+ name: str # the generated name, '<n>.<ext>'
79
+ source: str # the person's own name
80
+ image: bool
81
+ path: Path
82
+ address: str = "" # the http(s) src of a downloaded file
83
+
84
+
85
+ @dataclass(frozen=True)
86
+ class Attached:
87
+ """The files one draft carries, and whether its model can view images."""
88
+
89
+ files: tuple[StagedFile, ...] = ()
90
+ viewable: bool = False
91
+
92
+ def naming(self) -> str:
93
+ """The ONE context line naming every file, or "" with none.
94
+
95
+ '<n>.<ext> = <the person's name>' pairs, then where the files are and
96
+ what the session must do with them. An image of a session whose model
97
+ declares no image input is named as not viewable: it is not sent.
98
+ """
99
+ if not self.files:
100
+ return ""
101
+ pairs = ", ".join(
102
+ f"{file.name} = {file.source}" for file in self.files
103
+ )
104
+ notes = [f"they are in {self.files[0].path.parent}"]
105
+ if any(not file.image for file in self.files):
106
+ notes.append("read the HTML and text files with read")
107
+ line = f"The person attached: {pairs} ({'; '.join(notes)})"
108
+ unreadable = [
109
+ file.name for file in self.files
110
+ if file.image and not self.viewable
111
+ ]
112
+ if unreadable:
113
+ line += (
114
+ "\nThis session's model declares no image input, so "
115
+ f"{', '.join(unreadable)} cannot be viewed: ask the person "
116
+ "to describe it when it matters."
117
+ )
118
+ return line
119
+
120
+ def arguments(self, *, text: bool = False) -> list[str]:
121
+ """The Pi '@<path>' arguments this session receives.
122
+
123
+ A viewable image and, with 'text', every HTML and text file travel as
124
+ file arguments: Pi expands a text file into the first prompt, which is
125
+ the only way the tool-less fidelity pass reads one.
126
+ """
127
+ return [
128
+ f"@{file.path}" for file in self.files
129
+ if (file.image and self.viewable) or (text and not file.image)
130
+ ]
131
+
132
+
133
+ @dataclass(frozen=True)
134
+ class Filing:
135
+ """The attachments one creation writes into every NEW Issue."""
136
+
137
+ directory: Path
138
+ files: tuple[StagedFile, ...] = ()
139
+
140
+ def select(self, numbers: "Sequence[int] | None") -> "Filing":
141
+ """This filing restricted to the numbers one Issue uses.
142
+
143
+ Each drafted Issue carries 'attachments: [n]' (absent = all of
144
+ them), so a split writes only what each Issue uses; a number the
145
+ draft does not have is refused with the reason.
146
+ """
147
+ return Filing(
148
+ directory=self.directory,
149
+ files=_chosen(self.files, numbers, "draft"),
150
+ )
151
+
152
+ def arguments(self) -> list[str]:
153
+ """'gh issue create --attach' for every image with a local src."""
154
+ return [
155
+ item for file in self.files
156
+ if file.image and not file.address
157
+ for item in ("--attach", f"./{file.name}")
158
+ ]
159
+
160
+ def section(self) -> str:
161
+ """The Attachments section: the images, then each text file folded."""
162
+ return _render(tuple(
163
+ _image_block(file) if file.image else _text_block(file)
164
+ for file in self.files
165
+ ))
166
+
167
+ def unuploaded(self, body: object) -> tuple[str, ...]:
168
+ """The local images gh did not upload, by the person's own name.
169
+
170
+ 'gh issue create --attach' rewrites '![name](./<n>.<ext>)' to the
171
+ uploaded asset; a reference still written as './<n>.<ext>' is the
172
+ image gh refused — it creates the Issue with the rest and exits
173
+ non-zero.
174
+ """
175
+ text = body if isinstance(body, str) else ""
176
+ return tuple(
177
+ file.source for file in self.files
178
+ if file.image and not file.address
179
+ and f"](./{file.name})" in text
180
+ )
181
+
182
+
183
+ @dataclass(frozen=True)
184
+ class Copied:
185
+ """The Attachments of an existing Issue, copied into a child.
186
+
187
+ The '/orbi split' outcome does not upload the draft's files: a child
188
+ carries the links the original Issue already has, restricted to the
189
+ numbers that child uses (Issue #2364).
190
+ """
191
+
192
+ blocks: tuple[str, ...] = ()
193
+
194
+ def select(self, numbers: "Sequence[int] | None") -> "Copied":
195
+ """These blocks restricted to the numbers one child uses."""
196
+ return Copied(_chosen(self.blocks, numbers, "original Issue"))
197
+
198
+ def section(self) -> str:
199
+ """The child's own Attachments section, or "" with none."""
200
+ return _render(self.blocks)
201
+
202
+
203
+ def copied(body: object) -> Copied:
204
+ """The attachment blocks of one existing Issue body, in order."""
205
+ text = body if isinstance(body, str) else ""
206
+ heading = _ATTACHMENTS_HEADING_RE.search(text)
207
+ if heading is None:
208
+ return Copied()
209
+ return Copied(tuple(
210
+ match.group(0).strip()
211
+ for match in _BLOCK_RE.finditer(text[heading.end():])
212
+ ))
213
+
214
+
215
+ def section(source: "Filing | Copied | None") -> str:
216
+ """The Attachments section one new Issue carries, or "" with no file."""
217
+ return "" if source is None else source.section()
218
+
219
+
220
+ def source(
221
+ numbers: "Sequence[int] | None", position: int, *,
222
+ filed: "Filing | None", copied: "Copied | None",
223
+ ) -> "Filing | Copied | None":
224
+ """The attachments ONE drafted Issue uses, or None.
225
+
226
+ A new-Issue creation selects from the draft's staged files; a split
227
+ selects the links of the original Issue's body; no source and no
228
+ selection keeps the exact pre-#2364 create.
229
+ """
230
+ if filed is not None:
231
+ return filed.select(numbers)
232
+ if copied is not None:
233
+ return copied.select(numbers)
234
+ if numbers is not None:
235
+ raise AttachmentError(
236
+ f"Issue {position}: attachments names files this creation does "
237
+ "not have"
238
+ )
239
+ return None
240
+
241
+
242
+ def parse(value: object) -> tuple[Attachment, ...]:
243
+ """The document's attachments list; an unusable entry is refused."""
244
+ if value is None:
245
+ return ()
246
+ if not isinstance(value, list):
247
+ raise AttachmentError("attachments must be a list of {name, src}")
248
+ entries: list[Attachment] = []
249
+ for position, entry in enumerate(value, start=1):
250
+ if not isinstance(entry, dict):
251
+ raise AttachmentError(f"attachment {position} is not an object")
252
+ name = entry.get("name")
253
+ src = entry.get("src")
254
+ if not isinstance(name, str) or not name.strip():
255
+ raise AttachmentError(f"attachment {position} has no name")
256
+ if not isinstance(src, str) or not src.strip():
257
+ raise AttachmentError(f"attachment {position} has no src")
258
+ entries.append(Attachment(name=name.strip(), src=src.strip()))
259
+ return tuple(entries)
260
+
261
+
262
+ def from_paths(paths: Sequence[str]) -> list[dict]:
263
+ """The '--attach <path>' arguments as document entries.
264
+
265
+ The person's own file name is the display name and the src is the path
266
+ as the person gave it ('~' expanded), so the local draft shows the file
267
+ where they see it; the same process reads it moments later.
268
+ """
269
+ return [
270
+ {"name": Path(path).name, "src": str(Path(path).expanduser())}
271
+ for path in paths
272
+ ]
273
+
274
+
275
+ def with_paths(payload: dict, paths: Sequence[str]) -> dict:
276
+ """One document plus the '--attach <path>' files, after its own list.
277
+
278
+ The document (a caller such as Orbi Cloud fills it) and the flag are the
279
+ same list (Issue #2364): both become {name, src} entries the round
280
+ stages, and a refusal names the file either way.
281
+ """
282
+ if not paths:
283
+ return payload
284
+ entries = payload.get("attachments")
285
+ if entries is None:
286
+ entries = []
287
+ elif not isinstance(entries, list):
288
+ entries = [entries]
289
+ return {**payload, "attachments": [*entries, *from_paths(paths)]}
290
+
291
+
292
+ def stage(value: object, destination: Path, *, viewable: bool) -> Attached:
293
+ """Stage one draft's attachments; a refusal is a person-readable reason."""
294
+ return Attached(
295
+ files=_staged(parse(value), Path(destination)), viewable=viewable,
296
+ )
297
+
298
+
299
+ @contextlib.contextmanager
300
+ def filing(value: object) -> Iterator[Filing | None]:
301
+ """Stage one creation's attachments; nothing is left behind.
302
+
303
+ None when the draft carries no file, so a draft without attachments keeps
304
+ the exact pre-#2364 creation: no section, no '--attach', no download.
305
+ """
306
+ entries = parse(value)
307
+ if not entries:
308
+ yield None
309
+ return
310
+ with tempfile.TemporaryDirectory(prefix="orbi-filing-") as directory:
311
+ yield Filing(
312
+ directory=Path(directory),
313
+ files=_staged(entries, Path(directory), download=False),
314
+ )
315
+
316
+
317
+ def with_arguments(command: list[str], arguments: Sequence[str]) -> list[str]:
318
+ """One argv with 'arguments' in front of its LAST element.
319
+
320
+ The context file is every role's last argument and stays last
321
+ (tests/test_pi_command.py pins it); Pi's '@<path>' file form is how an
322
+ image or a text file enters the first prompt.
323
+ """
324
+ if not arguments:
325
+ return command
326
+ return [*command[:-1], *arguments, command[-1]]
327
+
328
+
329
+ def upload_notice(names: Sequence[str]) -> str:
330
+ """The one line naming the images gh did not upload, and the repair."""
331
+ listed = ", ".join(names)
332
+ them = "it" if len(names) == 1 else "them"
333
+ return (
334
+ f"The Issue was created without {listed}: gh did not upload {them}. "
335
+ f"Paste {them} into the Issue, or run 'gh auth login' as yourself and "
336
+ "draft again."
337
+ )
338
+
339
+
340
+ def _positions(
341
+ count: int, numbers: "Sequence[int] | None", source: str,
342
+ ) -> list[int]:
343
+ """The 1-based positions one number list selects, in its own order."""
344
+ if numbers is None:
345
+ return list(range(1, count + 1))
346
+ chosen = []
347
+ for number in numbers:
348
+ if not 1 <= number <= count:
349
+ raise AttachmentError(
350
+ f"attachment {number} does not exist: the {source} has "
351
+ f"{count}"
352
+ )
353
+ chosen.append(number)
354
+ return chosen
355
+
356
+
357
+ def _chosen(
358
+ files: tuple, numbers: "Sequence[int] | None", source: str,
359
+ ) -> tuple:
360
+ """The files one number list selects, in the list's own order."""
361
+ return tuple(files[number - 1] for number in _positions(
362
+ len(files), numbers, source,
363
+ ))
364
+
365
+
366
+ def _render(blocks: tuple[str, ...]) -> str:
367
+ """One Attachments section from its blocks, or "" with none."""
368
+ if not blocks:
369
+ return ""
370
+ return "\n\n".join([SECTION_HEADING, "", "\n\n".join(blocks)])
371
+
372
+
373
+ def _staged(
374
+ entries: tuple[Attachment, ...], destination: Path, *, download: bool = True,
375
+ ) -> tuple[StagedFile, ...]:
376
+ """Validate every entry and write it under its generated name.
377
+
378
+ With 'download' false an http(s) image is only recorded with its own
379
+ address: a new Issue writes it as a link, so reading it would make the
380
+ creation depend on that address being reachable (Issue #2374). Drafting
381
+ rounds keep downloading it, because the session receives the file.
382
+ """
383
+ if len(entries) > MAX_FILES:
384
+ raise AttachmentError(
385
+ f"at most {MAX_FILES} files per draft, got {len(entries)}"
386
+ )
387
+ destination.mkdir(parents=True, exist_ok=True)
388
+ staged: list[StagedFile] = []
389
+ characters = 0
390
+ for position, entry in enumerate(entries, start=1):
391
+ suffix, image = _kind(entry.name)
392
+ if image and not download and _URL_RE.match(entry.src):
393
+ name = f"{position}{suffix}"
394
+ staged.append(StagedFile(
395
+ name=name, source=entry.name, image=True,
396
+ path=destination / name, address=entry.src,
397
+ ))
398
+ continue
399
+ data, address = _read(entry)
400
+ megabytes = MAX_FILE_BYTES // (1024 * 1024)
401
+ if len(data) > MAX_FILE_BYTES:
402
+ raise AttachmentError(f"{entry.name} is larger than {megabytes} MB")
403
+ if not image:
404
+ characters += len(data.decode("utf-8", errors="replace"))
405
+ if characters > MAX_TEXT_CHARACTERS:
406
+ raise AttachmentError(
407
+ "the HTML and text files carry more than "
408
+ f"{MAX_TEXT_CHARACTERS} characters together"
409
+ )
410
+ path = destination / f"{position}{suffix}"
411
+ path.write_bytes(data)
412
+ staged.append(StagedFile(
413
+ name=path.name, source=entry.name, image=image, path=path,
414
+ address=address,
415
+ ))
416
+ return tuple(staged)
417
+
418
+
419
+ def staged_name(position: int, name: str) -> str:
420
+ """The generated name of one entry: its number plus its own suffix.
421
+
422
+ The ONE naming rule: staging writes '<n>.<ext>' and the local draft shows
423
+ the same name, so the number a person reads is the number the created
424
+ Issue references (Issue #2364).
425
+ """
426
+ return f"{position}{_kind(name)[0]}"
427
+
428
+
429
+ def display(
430
+ entries: "Sequence[Attachment]", numbers: "Sequence[int] | None",
431
+ ) -> list[str]:
432
+ """The files one drafted Issue uses, as the local draft lists them.
433
+
434
+ '<n>.<ext> <the person's name> <src>' per file (Issue #2364): the name
435
+ the created Issue references, the name the person gave it and where it
436
+ sits.
437
+ """
438
+ return [
439
+ f"{staged_name(position, entries[position - 1].name)} "
440
+ f"{entries[position - 1].name} {entries[position - 1].src}"
441
+ for position in _positions(len(entries), numbers, "draft")
442
+ ]
443
+
444
+
445
+ def _kind(name: str) -> tuple[str, bool]:
446
+ """One entry's generated suffix and whether it is an image."""
447
+ suffix = Path(name).suffix.lower()
448
+ if suffix in IMAGE_SUFFIXES:
449
+ return suffix, True
450
+ if suffix in TEXT_SUFFIXES:
451
+ return suffix, False
452
+ raise AttachmentError(
453
+ f"{name}: unsupported file type {suffix or '(none)'} — attach an "
454
+ f"image ({', '.join(sorted(IMAGE_SUFFIXES))}), HTML or text "
455
+ f"({', '.join(sorted(TEXT_SUFFIXES))})"
456
+ )
457
+
458
+
459
+ def _read(entry: Attachment) -> tuple[bytes, str]:
460
+ """One entry's bytes and, for a downloaded file, its address."""
461
+ if _URL_RE.match(entry.src):
462
+ try:
463
+ with urllib.request.urlopen(
464
+ entry.src, timeout=DOWNLOAD_TIMEOUT_SECONDS,
465
+ ) as response:
466
+ return response.read(), entry.src
467
+ except Exception as exc: # noqa: BLE001 - reported with its reason
468
+ raise AttachmentError(
469
+ f"{entry.name}: could not be downloaded from {entry.src}: "
470
+ f"{type(exc).__name__}"
471
+ ) from None
472
+ try:
473
+ return Path(entry.src).expanduser().read_bytes(), ""
474
+ except OSError as exc:
475
+ raise AttachmentError(
476
+ f"{entry.name}: cannot be read from {entry.src}: "
477
+ f"{exc.strerror or type(exc).__name__}"
478
+ ) from None
479
+
480
+
481
+ def _image_block(file: StagedFile) -> str:
482
+ """One image: its uploaded reference, or its own address."""
483
+ return f"![{file.source}]({file.address or f'./{file.name}'})"
484
+
485
+
486
+ def _text_block(file: StagedFile) -> str:
487
+ """One HTML or text file as a collapsed block a reader opens."""
488
+ text = file.path.read_text(encoding="utf-8", errors="replace").rstrip("\n")
489
+ fence = "\u0060" * max(3, _longest_run(text) + 1)
490
+ language = Path(file.name).suffix.lstrip(".")
491
+ return "\n".join((
492
+ f"<details><summary>{file.source}</summary>", "",
493
+ f"{fence}{language}", text, fence, "", "</details>",
494
+ ))
495
+
496
+
497
+ def _longest_run(text: str) -> int:
498
+ """The length of the longest run of fence characters in one text."""
499
+ return max((len(run) for run in _TICK_RUN_RE.findall(text)), default=0)
@@ -76,7 +76,7 @@ from dataclasses import dataclass
76
76
  from pathlib import Path
77
77
  from typing import TYPE_CHECKING
78
78
 
79
- from orbi import acceptance_section, draft_marker, language, notify
79
+ from orbi import acceptance_section, draft_author, language, notify
80
80
  from orbi import split_apply, user_summary
81
81
  # The proposal domain moved to its own leaf module (Issue #2207) because this
82
82
  # one sits at its recorded size ceiling; the names stay importable HERE, the
@@ -628,7 +628,7 @@ def enforce(issue: dict, config: RunnerConfig, source_repo: str,
628
628
  # ticket claimable, and the next tick would judge it again — the gate
629
629
  # would repeat instead of stopping.
630
630
  ready_label = delivery_labels.queue_label(config.dispatch_label)
631
- if draft_marker.own_draft_unchanged(issue):
631
+ if draft_author.own_draft_unchanged(issue):
632
632
  # Issue #2041: `orbi draft` already judged this exact body with
633
633
  # THIS function before the person ever saw it, and nobody has
634
634
  # edited it since (the marker's fingerprint still matches). Orbi
@@ -195,7 +195,7 @@ def command_draft(config: config_domain.RunnerConfig, args, parser) -> int:
195
195
  return draft_cli.run_draft(
196
196
  config, _selected_repo(config, args, parser),
197
197
  request=args.request, session_dir=args.session_dir,
198
- create=args.create,
198
+ create=args.create, attach=args.attach,
199
199
  )
200
200
 
201
201