Skip to content

feat: Distributed Mesh — Cross-Machine Squad Coordination#380

Merged
bradygaster merged 5 commits intobradygaster:devfrom
andikrueger:squad/distributed-mesh-clean
Mar 15, 2026
Merged

feat: Distributed Mesh — Cross-Machine Squad Coordination#380
bradygaster merged 5 commits intobradygaster:devfrom
andikrueger:squad/distributed-mesh-clean

Conversation

@andikrueger
Copy link
Copy Markdown
Contributor

Distributed Mesh Integration

Closes #371
Replaces #372 (closed — had a base branch mismatch that inflated the diff to 697 files)

What This Does

Adds the distributed mesh extension to Squad — enabling cross-machine squad coordination via git (Zone 2: same-org) and HTTP (Zone 3: cross-org). This complements the existing upstream inheritance model with peer-to-peer coordination capabilities.

Changes

Documentation

  • New feature page: docs/src/content/docs/features/distributed-mesh.md (298 lines)
    • Three-zone architecture (local → git → HTTP)
    • Security model and write partitioning
    • Upstream vs mesh comparison table
  • Cross-reference added to scenarios/multiple-squads.md
  • Navigation updated in docs/src/navigation.ts

Templates

  • templates/mesh/ — scaffolding for mesh setup:
    • mesh.json.example — configuration template for all 3 zones
    • sync-mesh.sh / sync-mesh.ps1 — sync scripts
    • README.md — quick-start guide
  • SKILL.md in all template directories (SDK, CLI, root) + runtime skill

Tests

  • Updated test/docs-build.test.ts — added distributed-mesh to EXPECTED_FEATURES array

Design Decisions

  • Templates + docs only — no code changes to existing SDK modules
  • Complementary to upstream — upstream = org policies flowing down (read-only), mesh = peer coordination (read-write)
  • Write partitioning — each squad owns a namespace to prevent conflicts
  • Leverages existing codesrc/sharing/ (cache, conflicts, versioning) and src/upstream/ (git resolution) provide the foundation for future code implementation

How to Test

  1. Check out this branch
  2. Run npm run build and npm test to verify docs build and test assertions pass
  3. Review the docs page at features/distributed-mesh

Working as the Squad team (Flight 🏗️ + PAO 📣 + Network 📦) with @copilot coordination

…tion

Integrates the distributed mesh pattern into Squad, enabling squads on
different machines to coordinate via git (Zone 2) and HTTP (Zone 3).

Changes:
- Add distributed-mesh skill to all template directories (SDK, CLI, root)
- Add runtime skill to .squad/skills/distributed-mesh/
- Add mesh scaffolding templates (mesh.json.example, sync scripts)
- Add docs page at features/distributed-mesh.md with upstream comparison
- Update navigation and docs build tests
- Cross-reference from multiple-squads scenario page

The distributed mesh is complementary to existing upstream inheritance
(hierarchical, read-only) by adding peer-to-peer read-write coordination.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add explicit SCOPE section defining what the skill produces (mesh.json,
decision entry, template pointer) and what it does NOT produce (no code,
no tests, no scripts). Add deterministic AGENT WORKFLOW with 5-step
process ending at STOP. Fix ambiguous language. Add decision template.
Expand anti-patterns with code generation and scope creep categories.

All 4 SKILL.md copies synced (runtime + 3 templates).
Docs page updated with Skill scope section.

Refs: bradygaster#371

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@andikrueger
Copy link
Copy Markdown
Contributor Author

Added second commit (d3835ea): Deterministic skill rewrite

  • SKILL.md now has explicit SCOPE section (produces vs. does not produce)
  • Deterministic 5-step AGENT WORKFLOW ending at STOP
  • Fixed ambiguous language ('do the task', phase advancement)
  • Added decision template inline
  • Expanded anti-patterns (code generation, scope creep)
  • All 4 SKILL.md copies synced
  • Docs page updated with 'Skill scope' section

This addresses the testing feedback where agents generated 43 tests + a validator instead of just mesh.json.

andikrueger and others added 2 commits March 14, 2026 23:05
Session: 2026-03-14T22-01-14Z-deterministic-skill
Requested by: Scribe (background agent)

Changes:
- Merged 4 distributed mesh decisions from inbox into decisions.md
- Propagated team updates to affected agents (flight, network, pao, procedures)
- Deduplicated decisions.md (0 exact duplicates, overlapping topics consolidated)
- Cleared .squad/decisions/inbox/ after merge
- Wrote orchestration logs for Procedures and PAO agents
- Wrote session log for deterministic skill pattern work

Decisions merged:
1. Deterministic skill pattern (Procedures)
2. Distributed mesh integration architecture (Flight)
3. Distributed mesh template placement (Network)
4. Distributed mesh documentation structure (PAO)

Agent histories updated with team update from Procedures, PAO, Flight, Network.
Bundle sync scripts and mesh.json.example directly into the skill
directory per the GitHub agent-skills spec. The agent now copies
scripts from its own skill dir and runs --init automatically.
Zero manual user steps after topology questions.

- Bundle sync-mesh.sh, sync-mesh.ps1, mesh.json.example in skill dir
- Update SKILL.md workflow: ASK, GENERATE, COPY, INIT, DECIDE, STOP
- Add --init flag to sync scripts for state repo scaffolding
- Sync all 4 skill locations (runtime + 3 templates)

Refs: bradygaster#371, bradygaster#380

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@andikrueger
Copy link
Copy Markdown
Contributor Author

Self-contained skill model (commit a9e9d63)

Updated the distributed-mesh skill to follow the GitHub agent-skills spec pattern:

What changed:

  • Scripts (sync-mesh.sh, sync-mesh.ps1) and mesh.json.example are now bundled inside each skill directory
  • SKILL.md workflow is now fully zero-touch: ASK → GENERATE → COPY → INIT → DECIDE → STOP
  • The agent copies scripts from its own skill directory — no manual user steps
  • Added \--init\\ flag to sync scripts for automatic state repo scaffolding

Before: Agent told user to manually copy scripts from templates/mesh/
After: Agent reads SKILL.md, copies bundled scripts itself, runs --init. Zero-touch.

20 files changed, 1362 insertions(+), 126 deletions(-)

Delete templates/mesh/ and templates/skills/distributed-mesh/ — neither
was referenced by SDK/CLI init code. The canonical source is
.squad/skills/distributed-mesh/; npm copies live in packages/*/templates/.

Add scripts/sync-skill-templates.mjs to keep package template copies
in sync with .squad/skills/ at build time.

Refs: bradygaster#371, bradygaster#380

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster
Copy link
Copy Markdown
Owner

Hey @andikrueger — heads up: the distributed-mesh feature addition introduced a test assertion drift in docs-build.test.ts (EXPECTED_FEATURES expected 33, found 34 on disk). FIDO is fixing it now on dev. No action needed from you — just letting you know for future PRs: when adding feature files, update the test assertions in the same commit. Thanks for the great contribution! 🚀

tamirdresher pushed a commit to tamirdresher/squad that referenced this pull request Mar 16, 2026
* chore(squad): quality review findings — 7 issues filed

Quality audit complete: 5 agents assessed CLI across testing, coverage, stability, accessibility, UX.
Results: 4 P0 blockers (bradygaster#365bradygaster#368), 3 P1 items (bradygaster#369bradygaster#371).
Blocking: Waingro dead sessions, ErrorBoundary, dropped input; Marquez help text consistency.

Changes:
- Logged session summary to .squad/log/2026-02-24T0205-quality-review-complete.md
- Updated .squad/identity/now.md with quality review findings and new issue numbers

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

* chore(squad): merge decision — Marquez UX audit findings

Quality assessment merged from inbox (Grade B): 11 improvements (3 P0, 4 P1, 4 P2). help text, stub commands, vocabulary, separators, roster.

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

* docs: update waingro history with hostile test coverage sprint

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

* fix: P0 quality fixes — ErrorBoundary, session eviction, input buffer, stub removal (closes bradygaster#365, closes bradygaster#366, closes bradygaster#367, closes bradygaster#371)

- Add ErrorBoundary class component wrapping App in Ink render call (bradygaster#365)
  Shows friendly message on crash, logs error to stderr
- Dead session eviction in dispatchToAgent/dispatchToCoordinator (bradygaster#366)
  Deletes dead session from Map on error so next attempt creates fresh one
- Input buffering while disabled in InputPrompt (bradygaster#367)
  Buffers keystrokes via useRef, restores on re-enable, no auto-submit
- Remove stub commands: loop, hire; wire triage/watch to real runWatch (bradygaster#371)
  Remove stub help text entries for loop and hire
- 10 new tests across repl-ux and cli-shell-comprehensive

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

---------

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants