Context
The sync_all MCP tool performs bi-directional synchronization of issues, PRs, and discussions. It pulls remote changes into local Markdown files, and pushes local modifications back to GitHub.
The Problem
Because ticket and discussion Markdown files (resources/content/issues/ etc.) are tracked in Git, checking out a feature branch often reverts these files to an older state. If an agent or human runs sync_all while on a feature branch to fetch a new PR or discussion, the tool misinterprets the older ticket state on that branch as a deliberate "local modification." It then pushes this stale state to GitHub, silently overwriting and corrupting the active remote tickets.
The Architectural Reality
The sync_all logic in the neo-mjs-github-workflow MCP server (located in ai/mcp/server/github-workflow/) lacks branch awareness. It hashes the local file content and compares it to the remote, assuming any local edits should be pushed.
The Fix
The sync_all push logic must be structurally prevented from executing unless the active Git branch is strictly dev. main is strictly forbidden (reserved for atomic releases), and feature branches (agent/* etc.) must only pull.
- Modify the
sync_all implementation in the neo-mjs-github-workflow MCP server.
- Add a Git branch check (e.g.,
git branch --show-current).
- If the branch is exactly
dev, perform bi-directional pull AND push.
- If the branch is anything else (including
main or feature branches), perform PULL ONLY. Skip the push phase entirely and log a clear warning: "Push disabled on non-dev branches to protect remote state."
Acceptance Criteria
Out of Scope
- Detaching tickets from Git tracking entirely.
Origin Session ID
Origin Session ID: 0b29a8fa-c6b0-42e2-ab3b-8015a99db2d8
Context The
sync_allMCP tool performs bi-directional synchronization of issues, PRs, and discussions. It pulls remote changes into local Markdown files, and pushes local modifications back to GitHub.The Problem Because ticket and discussion Markdown files (
resources/content/issues/etc.) are tracked in Git, checking out a feature branch often reverts these files to an older state. If an agent or human runssync_allwhile on a feature branch to fetch a new PR or discussion, the tool misinterprets the older ticket state on that branch as a deliberate "local modification." It then pushes this stale state to GitHub, silently overwriting and corrupting the active remote tickets.The Architectural Reality The
sync_alllogic in theneo-mjs-github-workflowMCP server (located inai/mcp/server/github-workflow/) lacks branch awareness. It hashes the local file content and compares it to the remote, assuming any local edits should be pushed.The Fix The
sync_allpush logic must be structurally prevented from executing unless the active Git branch is strictlydev.mainis strictly forbidden (reserved for atomic releases), and feature branches (agent/*etc.) must only pull.sync_allimplementation in theneo-mjs-github-workflowMCP server.git branch --show-current).dev, perform bi-directional pull AND push.mainor feature branches), perform PULL ONLY. Skip the push phase entirely and log a clear warning: "Push disabled on non-dev branches to protect remote state."Acceptance Criteria
sync_allverifies the current branch before executing push operations.dev.main) are blocked from being pushed to GitHub.Out of Scope
Origin Session ID Origin Session ID: 0b29a8fa-c6b0-42e2-ab3b-8015a99db2d8