Skip to content

🔧 Fetch origin before mission dispatch and enforce rebase-only policy#72

Merged
Robdel12 merged 2 commits intomainfrom
mission/robdel12-orbitdock#70
Mar 22, 2026
Merged

🔧 Fetch origin before mission dispatch and enforce rebase-only policy#72
Robdel12 merged 2 commits intomainfrom
mission/robdel12-orbitdock#70

Conversation

@Robdel12
Copy link
Owner

Summary

  • Orchestration: Mission dispatch now runs git fetch origin before creating the worktree and bases it on origin/<base_branch> instead of the (potentially stale) local branch.
  • Agent instructions: Added a "Git Workflow" section to mission_agent_instructions() enforcing rebase-only / no-merge-commit policy for all headless mission sessions.
  • Default template: Added a "Sync with latest main" workflow step and rebase/no-merge rules to the default MISSION.md template used for new missions.
  • Live MISSION.md: Updated with the same sync step and rebase policy.

Answers to issue questions

Question Answer
Is the worktree guaranteed fresh? Before: No — used local main. After: Yes — fetches origin first, bases on origin/main.
If local repo is stale? Before: Silently stale worktree. After: Fetch ensures freshness; warns on fetch failure but still creates worktree.
Should Mission Control auto-sync? Yes — implemented via git fetch origin in dispatch flow.
Safest implementation point? mission_dispatch.rs, right before create_tracked_worktree().
How to prevent merge commits? Both layers: orchestration (remote base ref) + prompt (rebase instructions).

Test plan

  • make rust-ci passes (fmt, clippy, tests)
  • Manual: dispatch a fresh mission and verify the worktree is based on latest origin/main
  • Manual: confirm agent follows rebase instructions in rendered prompt

Closes #70

--permission-prompt-tool stdio routes ALL permission decisions through the
control protocol, bypassing the CLI's internal --permission-mode auto-accept
logic. This caused edit tools to still require manual approval even when
the session was set to acceptEdits.

Fix: when permission_mode is "acceptEdits", automatically include Edit,
Write, and NotebookEdit in --allowedTools so the CLI pre-approves them.
Mission worktrees were created from the local base branch, which could be
stale. Now the dispatch flow fetches from origin first and bases the
worktree on origin/<base_branch> to guarantee freshness.

Also adds rebase-only / no-merge-commit instructions at both the
orchestration layer (git fetch + remote base ref) and the prompt layer
(agent instructions, default template, and live MISSION.md).
@Robdel12 Robdel12 merged commit d000b0b into main Mar 22, 2026
3 checks passed
@Robdel12 Robdel12 deleted the mission/robdel12-orbitdock#70 branch March 22, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🔬 Scope fresh mission rebasing and no-merge-commit policy

1 participant