Skip to content

fix(coordinator): add routing enforcement refusal rule - #890

Merged
tamirdresher merged 2 commits into
devfrom
squad/853-coordinator-routing-enforcement
Apr 12, 2026
Merged

tamirdresher merged 2 commits into
devfrom
squad/853-coordinator-routing-enforcement

Conversation

@diberry

@diberry diberry commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Closes #853

Problem

The coordinator sometimes does domain work itself instead of dispatching to team members. Some models interpret existing refusal rules loosely.

Fix

Added explicit refusal rule:

You may NOT do work yourself — ALWAYS delegate to a team member, even for small tasks. The only exception is Direct Mode (answering factual questions already in context).

Also confirmed the Init Mode 3-state check (zero roster entries) was already present in all copies — no change needed.

Files Changed

  • .github/agents/squad.agent.md — added 4th refusal rule (canonical)
  • templates/squad.agent.md.template — synced
  • packages/squad-cli/templates/squad.agent.md.template — synced
  • packages/squad-sdk/templates/squad.agent.md.template — synced
  • .squad-templates/squad.agent.md — synced (5th tracked copy)
  • .squad/agents/procedures/history.md — session learnings

Working as Procedures (Prompt Engineer)

@diberry diberry added the bug Something isn't working label Apr 7, 2026
Copilot AI review requested due to automatic review settings April 7, 2026 02:29
@github-actions

github-actions Bot commented Apr 7, 2026 •

Copy link
Copy Markdown
Contributor

🟠 Impact Analysis — PR #890

Risk tier: 🟠 HIGH

📊 Summary

Metric Count
Files changed 5
Files added 0
Files modified 5
Files deleted 0
Modules touched 5

🎯 Risk Factors

  • 5 files changed (≤5 → LOW)
  • 5 modules touched (5-8 → HIGH)

📦 Modules Affected

ci-workflows (1 file)
  • .github/agents/squad.agent.md
root (1 file)
  • templates/squad.agent.md.template
squad-cli (1 file)
  • packages/squad-cli/templates/squad.agent.md.template
squad-sdk (1 file)
  • packages/squad-sdk/templates/squad.agent.md.template
templates (1 file)
  • .squad-templates/squad.agent.md

This report is generated automatically for every PR. See #733 for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an explicit refusal rule to strengthen coordinator routing enforcement so the coordinator delegates work to team members rather than performing domain work inline.

Changes:

  • Added a 4th refusal rule requiring delegation (except Direct Mode factual answers already in context).
  • Synced the updated coordinator prompt across all tracked template copies.
  • Recorded the change and rationale in Procedures history.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
.github/agents/squad.agent.md Adds the new refusal rule to the canonical coordinator agent prompt.
templates/squad.agent.md.template Syncs the refusal rule into the root template copy.
packages/squad-cli/templates/squad.agent.md.template Syncs the refusal rule into the CLI-distributed template copy.
packages/squad-sdk/templates/squad.agent.md.template Syncs the refusal rule into the SDK-distributed template copy.
.squad-templates/squad.agent.md Syncs the refusal rule into the .squad-templates tracked copy.
.squad/agents/procedures/history.md Documents the routing-enforcement hardening and lists updated files.

Comment thread .github/agents/squad.agent.md Resolved
Comment thread templates/squad.agent.md.template Resolved
Comment thread .squad-templates/squad.agent.md Resolved
Comment thread .squad/agents/procedures/history.md Resolved
Comment thread .squad/agents/procedures/history.md Resolved
@diberry
diberry force-pushed the squad/853-coordinator-routing-enforcement branch from 23889f3 to 1fdeac2 Compare April 8, 2026 14:25
@diberry diberry added the skip-changelog Skip changelog enforcement for this PR label Apr 8, 2026
@diberry
diberry force-pushed the squad/853-coordinator-routing-enforcement branch from 1fdeac2 to d2d3066 Compare April 8, 2026 15:54
@diberry
diberry force-pushed the squad/853-coordinator-routing-enforcement branch from d2d3066 to 745c705 Compare April 8, 2026 16:42
@diberry

diberry commented Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

🔍 Squad Review — Kaylee (Engineering)

# Check Status Notes
1 Changelog entry ✅ skip-changelog label present
2 Squashed to 1 commit ✅ 1 commit
3 CI green ✅ All checks pass (test, policy-gates, exports-map, samples-build, export-smoke-test, etc.)
4 Copilot comments resolved ✅ 7 threads — all resolved (formatting fixes acknowledged, .squad/ leak removed)
5 No .squad/ files ✅ Clean — .squad/agents/procedures/history.md was removed from commit
6 No unrelated files ✅ All 5 files are coordinator prompt synced across template locations
7 Tests for changes ✅ Markdown prompt-only change — no testable code
8 Not a duplicate/reversal ✅ Unique scope (closes #853)

Verdict: ✅ Ready to merge


Review by Squad AI team (Kaylee — Engineering) · requested by Dina Berry

@diberry

diberry commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

✅ CI validation passed on fork: diberry#144 — 7/7 checks green

@tamirdresher
tamirdresher merged commit 2dabcea into dev Apr 12, 2026
@tamirdresher
tamirdresher deleted the squad/853-coordinator-routing-enforcement branch April 12, 2026 10:34
tamirdresher pushed a commit that referenced this pull request Apr 21, 2026
Co-authored-by: Dina Berry <diberry@users.noreply.github.com>
martinopedal referenced this pull request in martinopedal/FinOps-assessment May 12, 2026
Adopts the routing-enforcement clause from upstream squad-cli v0.9.4
(PR bradygaster/squad#890) as anti-pattern #6 in
.github/agents/squad.agent.md. Bumps version stamp v0.8.25 → v0.8.25+local
to reflect the local-cherry-pick posture; full v0.9.4 wholesale upgrade
remains out of scope per the squad-cli audit (issue #26 / decisions.md).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
martinopedal referenced this pull request in martinopedal/FinOps-assessment May 12, 2026
* chore(squad): adopt routing-enforcement refusal rule (#35)

Adopts the routing-enforcement clause from upstream squad-cli v0.9.4
(PR bradygaster/squad#890) as anti-pattern #6 in
.github/agents/squad.agent.md. Bumps version stamp v0.8.25 → v0.8.25+local
to reflect the local-cherry-pick posture; full v0.9.4 wholesale upgrade
remains out of scope per the squad-cli audit (issue #26 / decisions.md).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* update(squad/sam): append learning from issue #35 completion

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working skip-changelog Skip changelog enforcement for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Coordinator is doing work instead of routing work

3 participants