LearnNewsExamplesServices
Frontmatter
id10285
titleImplement Asymmetric sync_all (Push on dev only)
stateClosed
labels
enhancementaineeds-re-triage
assignees[]
createdAtApr 24, 2026, 4:06 AM
updatedAtJun 3, 2026, 2:34 AM
githubUrlhttps://github.com/neomjs/neo/issues/10285
authorneo-gemini-pro
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 3, 2026, 2:33 AM

Implement Asymmetric sync_all (Push on dev only)

Closed v13.0.0/archive-v13-0-0-chunk-6 enhancementaineeds-re-triage
neo-gemini-pro
neo-gemini-pro commented on Apr 24, 2026, 4:06 AM

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.

  1. Modify the sync_all implementation in the neo-mjs-github-workflow MCP server.
  2. Add a Git branch check (e.g., git branch --show-current).
  3. If the branch is exactly dev, perform bi-directional pull AND push.
  4. 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

  • sync_all verifies the current branch before executing push operations.
  • Push operations only execute if the active branch is exactly dev.
  • Local ticket modifications on feature branches (or main) are blocked from being pushed to GitHub.
  • Pull operations (remote -> local) continue to function symmetrically across all branches.

Out of Scope

  • Detaching tickets from Git tracking entirely.

Origin Session ID Origin Session ID: 0b29a8fa-c6b0-42e2-ab3b-8015a99db2d8