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