Skip to content

Bug: squad-main-guard.yml blocks .squad/ commits on main for solo developers #99

@diberry

Description

@diberry

Scope: This is a Squad product bug affecting solo developers who work directly on main. The main-guard workflow shipped with Squad contradicts Scribe's commit behavior.

Bug: squad-main-guard.yml blocks .squad/ on protected branches but Squad commits .squad/ to working branch

Squad version: 0.9.1
Reporter: Wayne Berry (@WayneWalterBerry)
Repo: https://github.com/WayneWalterBerry/MMO

Problem

The squad-main-guard.yml workflow (shipped with Squad) blocks ALL .squad/ files from being pushed to main, preview, and insider branches. However, Squad's Scribe agent commits .squad/ state (decisions.md, history.md, orchestration logs, skills) to the current working branch -- which for solo developers working directly on main means every Scribe commit triggers a guard failure.

This creates a contradiction:

  1. Squad's Scribe is instructed to git add .squad/ && git commit after every agent batch
  2. Squad's guard workflow rejects any push containing .squad/ files to main
  3. Solo developers (the primary Squad audience) typically work on main

Result: Every commit to main shows a red X in the GitHub Actions tab, even though the work is correct. The guard fires on push events too (not just PRs), so direct pushes to main always fail the check.

Expected Behavior

One of:

  1. Guard should only run on PRs, not on direct pushes -- solo devs pushing to main should not be penalized
  2. Guard should be aware of Squad's own state files -- .squad/ is expected content on working branches; the guard should distinguish between "dev branch merged to main via PR" (block) vs "working directly on main" (allow)
  3. Scribe should respect branch-awareness -- if on a protected branch, Scribe should skip the git commit step or use a different strategy (stash, separate branch)
  4. Guard should be opt-in, not default -- or at minimum, the workflow should document this conflict in its comments

Reproduction Steps

  1. Install Squad v0.9.1 on a repo
  2. Work directly on main (common for solo projects)
  3. Run any Squad skill that triggers Scribe (virtually all of them)
  4. Scribe commits .squad/ changes and pushes to main
  5. squad-main-guard.yml fires on the push event and fails

Error output:

## Forbidden files detected in PR to main

The following files must NOT be merged into main.
.squad/ are runtime team state -- they belong on dev branches only.

Forbidden files found:
- .squad/agents/bart/history.md
- .squad/agents/brockman/history.md
- .squad/decisions.md
- .squad/skills/engine-code-review/SKILL.md
- .squad/skills/goodnight/SKILL.md
...

Workflow Source

File: .github/workflows/squad-main-guard.yml

on:
  pull_request:
    branches: [main, preview, insider]
  push:
    branches: [main, preview, insider]  # <-- This catches direct pushes too

The forbidden path check:

if (f.startsWith('.squad/')) return true;  // Blocks ALL .squad/ files

Impact

  • Every push to main shows red X in the repo's commit history and Actions tab
  • Misleading CI status -- the red X suggests broken code, but it's just Squad state files
  • Solo devs get no value from this guard -- the guard is designed for team workflows where .squad/ should stay on feature branches, but solo devs work on main

Suggested Fixes

Option A: Remove push trigger (minimal change)

on:
  pull_request:
    branches: [main, preview, insider]
  # Remove: push trigger

This preserves PR protection while allowing direct pushes (the solo dev workflow).

Option B: Add .squad/ to allowlist when on working branch

The guard could check if the push is from the repo's default branch workflow and skip .squad/ files in that case.

Option C: Make guard configurable via config.json

Read from .squad/config.json whether the guard should block .squad/ files:

{
  "ci": {
    "mainGuardBlockSquadFiles": false
  }
}

This ties into the config-driven separation architecture from #98.

Option D: Document the conflict

At minimum, add a comment to the workflow template explaining that solo devs working on main should either:

  • Remove the push trigger
  • Or use feature branches for all work

Analysis

This bug is related to the broader upgrade/workflow architecture in #98:

Related

  • Squad product: Default workflows burn too many Actions minutes for multi-repo customers #98 -- Squad product: Default workflows burn too many Actions minutes (upgrade safety, config-driven separation)
  • Squad v0.9.1 Scribe commit behavior (spawn template: git add .squad/ && commit)
  • .gitattributes merge=union driver for .squad/ files (designed for branch merging)
  • Worktree-local vs main-checkout strategy (the guard assumes worktree-local, but solo devs use main-checkout)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions