Skip to content

feat: Squad 2.0 decoupled backend and multi-host client adapters (Claude, Kiro, OpenCode, Cursor, Codex, Antigravity) - #2238

Closed
tamirdresher wants to merge 47 commits into
github:devfrom
tamirdresher:squad/2.0-client-adapters-pr
Closed

tamirdresher wants to merge 47 commits into
github:devfrom
tamirdresher:squad/2.0-client-adapters-pr

Conversation

@tamirdresher

@tamirdresher tamirdresher commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Squad 2.0: decoupled backend + multi-host client adapters

Squad can now run natively in Claude Code, Kiro, OpenCode, Cursor, OpenAI Codex and Google Antigravity (plus Copilot), with the host client decoupled from the state/backend. Hosts own native bootstrap/projection and capability declaration; conversation semantics, routing, durable state and authorization stay in the shared backend contract. MCP (squad_state) is a local tool transport bridge behind that contract, not the wire contract.

This branch is the integrated Squad 2.0 line (over dev), so it carries the earlier backend/spec work as well as the client adapters.

Reviewer map (suggested order: spec → interfaces → backend → projections → CLI → tests → docs)

  1. Spec (what must hold): docs/specification/client-backend-decoupling-v0.2.md, docs/specification/client-harness-adapters-v0.2.md, docs/specification/adr-001-client-control-execution-boundary.md, normative fixtures test-fixtures/spec/suite-v0.2/capability-matrix.json and test-fixtures/spec/suite-v0.2/golden-trace.json.
  2. Interfaces (the contracts): packages/squad-sdk/src/backend/types.ts (SquadBackend, envelope/cursor/error/capability types, HarnessAdapter SPI) and packages/squad-sdk/src/client/adapter-contract.ts (ClientAdapter facade, AdapterUnboundError, createClientAdapter).
  3. Backend: packages/squad-sdk/src/backend/local-backend.ts, durable-http-backend.ts, harness-registry.ts, index.ts (createSquadBackend); the MCP transport adapter packages/squad-cli/src/cli/core/backend-mcp.ts wired through packages/squad-cli/src/cli/commands/state-mcp.ts.
  4. Projections (per-host files and config merges): packages/squad-sdk/src/client/adapters/{types,adapters,capabilities,apply,portable,coordinator}.ts; casting-registry repair/backfill in packages/squad-sdk/src/casting/handwritten-registry.ts.
  5. CLI: packages/squad-cli/src/cli/core/clients.ts, init.ts, upgrade.ts, packages/squad-cli/src/cli-entry.ts, packages/squad-cli/src/cli/commands/cast.ts.
  6. Tests: test/specification-suite.test.ts, test/backend.test.ts, test/clients.test.ts, test/clients-real-cli.test.ts, test/squad-20-security-contracts.test.ts, test/squad-20-all-scenarios.e2e.test.ts, test/squad-20-real-clients-stdio.e2e.test.ts, test/docs-build.test.ts, test/cli-command-wiring.test.ts.
  7. Docs: docs/SQUAD-2.0-OVERVIEW.md, docs/tutorials/multi-client-quickstart.md, docs/tutorials/durable-backend-and-custom-harness.md, docs/src/content/docs/concepts/squad-2-0-architecture.md, docs/src/content/docs/scenarios/using-squad-across-clients.md, docs/proposals/squad-2.0-security-and-isolation.md.

What's in it

  • Backend and security (packages/squad-sdk/src/backend/): decoupled backend, harness SPI, MCP bridge, security/conformance contracts, RC1-to-stable exit-criteria tests.
  • Client adapters (packages/squad-sdk/src/client/):
    • HostProjection: pure workspace projection for copilot, claude, kiro, opencode, cursor, codex, antigravity (no runtime dependency).
    • ClientAdapter (adapter-contract.ts): thin spec-compliant facade (describe, projectWorkspace, getCapabilities; submit/subscribe/cancel/respondApproval delegate to a bound runtime, otherwise AdapterUnboundError).
    • Canonical string[] capability tokens are authoritative; boolean ClientCapabilities flags are a derived view (conflicts throw). Advertised vs negotiated (effectiveCapabilities = client ∩ backend ∩ policy) kept separate.
    • Deprecated @bradygaster/squad-sdk/clients re-exports the same symbols.
    • Host-agnostic coordinator core prompt plus per-host dispatch section; JSON/TOML config merges only touch Squad's own keys, so user settings in .mcp.json, .kiro/settings/mcp.json, opencode.json, .cursor/mcp.json, .codex/config.toml survive squad upgrade.
  • CLI: squad init --client <list|all> and squad upgrade --client, persisted in .squad/config.json clients[] (portable ids only; credentials/paths rejected). Hosts use only the coordinator file plus .squad/agents/<name>/charter.md (no per-member subagent files).
  • Docs/spec: docs/specification/*, docs/SQUAD-2.0-OVERVIEW.md, multi-client tutorials.

Verification

  • All 9 suites pass: 488 passed, 0 failed (npx vitest run over test/cli-command-wiring.test.ts, test/specification-suite.test.ts, test/backend.test.ts, test/clients.test.ts, test/clients-real-cli.test.ts, test/squad-20-security-contracts.test.ts, test/squad-20-all-scenarios.e2e.test.ts (126 tests), test/squad-20-real-clients-stdio.e2e.test.ts, test/docs-build.test.ts; 17 conditional skips).
  • test/clients-real-cli.test.ts runs the real claude, opencode, kiro, codex, agy and cursor-agent binaries against the generated config (run it alone if the machine is under load); squad-20-real-clients-stdio.e2e spawns the real state-mcp over stdio from each host's generated config.
  • Live interactive sessions (cli-tunnel, fresh repo, init -> cast -> parallel build -> tests): Claude (also issues + "Ralph, go" until PRs merged, 34/34), opencode (reviewer rejection, lockout, revision, approval, 24/24; fresh-session recovery + Scribe merge), Codex (10/10; fresh-session recovery + Scribe merge), Antigravity (casting verified; build hit a per-model quota), Cursor (cast, build 16/16, issues filed; Ralph blocked by the free-plan usage limit). Kiro: config loading and agent discovery verified; no live model run (free-tier monthly limit).
  • Non-normative live-demo evidence (sanitized off the PR branch): screenshots and raw PTY transcripts are not part of this PR or of any public branch because they contain local paths. They live in a separate private repo, https://github.com/tamirdresher/squad-2-0-demos (available to reviewers on request).
  • All demo runs used permissive/bypass permissions: controlled integration demos, not the production security model.

Known issues / caveats

  • Update: test/cli-command-wiring.test.ts is fixed: the internal backend-mcp helper moved from commands/ to cli/core/backend-mcp.ts (it is imported by state-mcp, not a CLI command). The spec deltas (7 hosts, HostProjection, capability tokens) are now in client-harness-adapters-v0.2.md and suite-v0.2/capability-matrix.json.
  • This branch also adds casting-registry repair/backfill for LLM-handwritten registries (casting/handwritten-registry.ts), non-TTY-safe squad init prompts, and .gitignore entries for .claude/worktrees/ and NUL.
  • The full repo suite also shows pre-existing timeouts/failures unrelated to clients (gh-aw, state-backend, OTel).
  • npm run build reports pre-existing @github/copilot-sdk typing errors in src/adapter/client.ts; tsc still emits.
  • An old published squad (0.13.x) on PATH has a stub cast --name; the local build must come first on PATH. squad init links repos to a personal squad when one exists (existing behaviour; set SQUAD_NO_PERSONAL=1 for clean demos).
  • Not demonstrated: Kiro/Cursor live runs, restart recovery on Antigravity, non-bypass permission mode.

Copilot and others added 30 commits October 17, 2026 22:15
Add SquadBackend contract with versioned envelope protocol, local and durable-http backends, harness registry, capability negotiation, versioned approvals, cancel-by-runId, and squad_backend_* MCP transport adapter.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Add security/isolation proposal and executable contract suite covering path/MCP/epoch guards, configured-vs-negotiated capabilities, versioned approvals with runId cancellation, loss-tolerant projection, and the golden cross-adapter conformance trace. Include packages/squad-sdk tests in vitest config.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Add ClientAdapter/ProjectionFile architecture in squad-sdk (copilot, claude,
kiro, opencode, cursor) with host-agnostic coordinator core, per-host dispatch
sections, declared ClientCapabilities, resolveEffectiveCapabilities, and
portable clients[] sanitization. Non-clobbering JSON/marker-block merging.

CLI: --client <list|all> on init and upgrade, persisted to .squad/config.json
clients[]; upgrade refreshes configured clients. Tests in test/clients.test.ts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Bring Brady's specification suite updates into the Squad 2.0 worktree, add the new v0.2 client/backend and client/harness protocol specs, and freeze the rc1 protocol baseline with ADR and immutable fixtures.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…store clobbered spec docs

Backend capabilities now use the v0.2 capability-matrix vocabulary; lastAcceptedSeq is the last accepted event sequence; conversation.created no longer leaks the lease epoch; MCP send_message accepts typed parts without content. Restore Charter/Core/Ceremony/Governance/Interop/README/inventory docs that the spec branch regressed to older revisions, keeping only the v0.2 profile additions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…ebase

Covers client projections, capability intersection vs capability-matrix.json, LocalSquadBackend across 5 harnesses, DurableHttpSquadBackend against a mock DurableSquad, the MCP bridge on local and durable-http, and the normative golden trace.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Closes github#2069

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

Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…tion, clean-room)

Add uninstallClients/removeProjection for clean rollback of client projections, make harness event delivery idempotent (duplicate/out-of-order), and rehydrate harness subscriptions for in-flight turns after a broker restart. New e2e tests cover v0.1 upgrade+rollback, partial/duplicate/shuffled delivery and restart with an approval in flight, and a clean-room client+harness checked against golden-trace.json and capability-matrix.json.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Project claude/opencode/kiro configs, parse them from disk, spawn state-mcp as a real child process over stdio JSON-RPC and exercise squad_state_* and all squad_backend_* tools including process restart and resume. Smoke-test installed claude/opencode/kiro binaries against the workspaces when present on PATH.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…I tests

Real Kiro CLI resolves agent `resources` file:// paths against the workspace
root (only `prompt` is relative to the agent config), so use
file://.squad/team.md rather than ../../. Skip the Coordinator row when
projecting Claude member subagents (it produced a bogus squad-squad agent).
Add real-binary tests (claude, opencode, kiro-cli) that skip when absent.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…I tests

Real Kiro CLI resolves agent `resources` file:// paths against the workspace
root (only `prompt` is relative to the agent config), so use
file://.squad/team.md rather than ../../. Skip the Coordinator row when
projecting Claude member subagents (it produced a bogus squad-squad agent).
Add real-binary tests (claude, opencode, kiro-cli) that skip when absent.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Codex: AGENTS.md managed block (id-scoped), .codex/config.toml
[mcp_servers.squad_state] via a non-destructive TOML table merge (startup
timeout defaulted to 60s for cold npx), .codex/agents/squad-<member>.toml.
Antigravity: .agents/agents/squad.md (+ member subagents, mcpServers
frontmatter) and a GEMINI.md block. Block markers can carry an id so several
clients share one file. Real-binary tests for codex and agy; verified against
codex-cli 0.163 and agy 1.4.0.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…le state

Found with real models: opencode's Glob skipped .squad/ so the coordinator concluded no team existed and re-cast it over the real team; models also tried squad_state_write for team.md/routing.md/charters, which the state tools reject. Add a guarded Init Mode that decides via squad_state_read, never re-casts an existing team, and document static config as ordinary files.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…tigravity to capability matrix

Make removeProjection handle text (TOML) projections and block ids introduced with the codex/antigravity adapters, add both clients to the v0.2 capability matrix fixture, and generalize the all-scenarios projection assertions to every client.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…e in shared prompt

opencode now projects .opencode/agent/squad-<member>.md (mode: subagent); claude/opencode/codex/antigravity member agents accept an optional model from .squad/config.json clientModels (per client, per member slug, '*' wildcard; values validated). Shared coordinator prompt gains host-agnostic Ralph mode (coordinator-driven gh scan/route/PR loop).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…lot prompt

Shared prompt now carries Response Mode Selection, Scribe drop-box protocol, reviewer rejection + strict lockout, Rai traffic light, Fact Checker + devil's advocate, ceremonies, 5-root skill-aware routing, memory/state handshake, GitHub Issues + PRD mode, cross-squad delegation, human/@copilot members, anti-patterns, Ralph mode, and a guarded Init Mode (auto-confirm, no glob on .squad, scratch dir, cast via 'squad cast', never hand-edit the checksummed casting registry, stop after casting).

Verified live with Claude Code: headless 'proceed' now casts in one turn, Scribe merges the inbox; hand-written casting registry broke 'squad upgrade', hence the cast-CLI rule.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…y image name

Found in live Claude demos: Ralph ran taskkill /IM node.exe (killed its own proxy) and Claude left embedded worktree repos that broke git add.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
- squad cast --sync registers hand-written team.md members in the checksummed casting registry (idempotent); prompt uses it when 'cast --name' is unavailable (old npx-cached squad).
- Antigravity agents declare tools (omitted list = none: agent had no shell, Ralph could not use gh).
- Member slugs normalize diacritics consistently in adapters and cast.

Found in live Kiro/Antigravity/interactive-Claude (cli-tunnel) runs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…idence, claude --mcp-config note

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…s, explicit fallback

From reviewer feedback on live runs: model asked for squad_state_read but hosts expose prefixed names; directory keys read as files (EISDIR); Scribe/Ralph/Rai/Fact Checker subagents missing when team.md was rewritten; silent owner substitution.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…shed via claude-sonnet-4-6 model, per-model quota)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Default is now a single coordinator file per host, like Copilot. Member
subagent files are projected only with --member-agents, config.json
memberAgents: true, or when clientModels is configured.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Copilot and others added 10 commits October 18, 2026 15:04
Hosts now use only .squad/agents/<name>/charter.md (inlined into generic
subagent spawns), like Copilot. Removes member/clientModels projection,
--member-agents, roster parsing and the accent-stripping slug change.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
… evidence

--sync was added in this branch and is not needed: the coordinator registers
members with squad cast --name. Screenshots show the interactive Claude
session (via cli-tunnel) casting, building in parallel and Scribe merging.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…igravity

Fresh repos, squad init --client X, casting with squad cast --name, parallel
build. Antigravity's build step hit the per-model quota; Kiro is unavailable
(monthly limit).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…ames

Adds phase captions and a permissive-mode disclaimer to the interactive
screenshots, plus restart/recovery + Scribe-merge frames for opencode and
Codex (replacing the mid-"Working" Codex ending).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…issues, Ralph)

Fresh private repo tamirdresher/squad-ralph-claude: init -> cast for the
project -> parallel build -> two squad-labelled issues -> "Ralph, go" until
both PRs merged (34/34 tests on main).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
… layout, capability tokens

Per Bubu's green light on the spec-alignment questions:
- HostProjection is the pure workspace projection (no runtime dependency);
  ClientAdapter (client/adapter-contract.ts) is the thin spec-compliant facade
  (describe, projectWorkspace, getCapabilities; submit/subscribe/cancel/
  respondApproval delegate to a bound runtime, else AdapterUnboundError).
- Canonical home is packages/squad-sdk/src/client/{adapter-contract.ts,adapters/};
  src/clients re-exports the exact same symbols (deprecated).
- Canonical string[] capability tokens are authoritative; boolean flags are a
  derived view; conflicting token+flag input throws. Advertised capabilities
  stay separate from negotiated effective capabilities.
- Update stale e2e tests for coordinator-only projection and prompt wording.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…alph blocked by usage limit)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…he fork branch)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
Copilot AI balanced review requested due to automatic review settings October 18, 2026 17:27
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🔴 Impact Analysis — PR #2238

Risk tier: 🔴 CRITICAL

📊 Summary

Metric Count
Files changed 58
Files added 35
Files modified 23
Files deleted 0
Modules touched 5
Critical files 7

🎯 Risk Factors

  • 58 files changed (>50 → CRITICAL)
  • 5 modules touched (5-8 → HIGH)
  • Critical files touched: packages/squad-sdk/package.json, packages/squad-sdk/src/backend/index.ts, packages/squad-sdk/src/casting/index.ts, packages/squad-sdk/src/client/adapters/index.ts, packages/squad-sdk/src/client/index.ts, packages/squad-sdk/src/clients/index.ts, packages/squad-sdk/src/index.ts

📦 Modules Affected

docs (15 files)
  • docs/SQUAD-2.0-OVERVIEW.md
  • docs/proposals/squad-2.0-security-and-isolation.md
  • docs/specification/README.md
  • docs/specification/adr-001-client-control-execution-boundary.md
  • docs/specification/client-backend-decoupling-v0.2.md
  • docs/specification/client-harness-adapters-v0.2.md
  • docs/src/content/docs/concepts/squad-2-0-architecture.md
  • docs/src/content/docs/reference/cli.md
  • docs/src/content/docs/reference/config.md
  • docs/src/content/docs/reference/sdk.md
  • docs/src/content/docs/scenarios/client-compatibility.md
  • docs/src/content/docs/scenarios/using-squad-across-clients.md
  • docs/src/navigation.ts
  • docs/tutorials/durable-backend-and-custom-harness.md
  • docs/tutorials/multi-client-quickstart.md
root (8 files)
  • .changeset/squad-2-0-multi-host-clients.md
  • CONTRIBUTING.md
  • README.md
  • cspell.json
  • test-fixtures/spec/suite-v0.1/index.json
  • test-fixtures/spec/suite-v0.2/capability-matrix.json
  • test-fixtures/spec/suite-v0.2/golden-trace.json
  • vitest.config.ts
squad-cli (7 files)
  • packages/squad-cli/src/cli-entry.ts
  • packages/squad-cli/src/cli/commands/state-mcp.ts
  • packages/squad-cli/src/cli/core/backend-mcp.ts
  • packages/squad-cli/src/cli/core/clients.ts
  • packages/squad-cli/src/cli/core/command-help.ts
  • packages/squad-cli/src/cli/core/init.ts
  • packages/squad-cli/src/cli/core/upgrade.ts
squad-sdk (20 files)
  • packages/squad-sdk/package.json
  • packages/squad-sdk/src/backend/durable-http-backend.ts
  • packages/squad-sdk/src/backend/harness-registry.ts
  • packages/squad-sdk/src/backend/index.ts
  • packages/squad-sdk/src/backend/local-backend.ts
  • packages/squad-sdk/src/backend/types.ts
  • packages/squad-sdk/src/casting/handwritten-registry.ts
  • packages/squad-sdk/src/casting/index.ts
  • packages/squad-sdk/src/client/adapter-contract.ts
  • packages/squad-sdk/src/client/adapters/adapters.ts
  • packages/squad-sdk/src/client/adapters/apply.ts
  • packages/squad-sdk/src/client/adapters/capabilities.ts
  • packages/squad-sdk/src/client/adapters/coordinator.ts
  • packages/squad-sdk/src/client/adapters/index.ts
  • packages/squad-sdk/src/client/adapters/portable.ts
  • packages/squad-sdk/src/client/adapters/types.ts
  • packages/squad-sdk/src/client/index.ts
  • packages/squad-sdk/src/clients/index.ts
  • packages/squad-sdk/src/config/init.ts
  • packages/squad-sdk/src/index.ts
tests (8 files)
  • test/backend.test.ts
  • test/clients-real-cli.test.ts
  • test/clients.test.ts
  • test/docs-build.test.ts
  • test/specification-suite.test.ts
  • test/squad-20-all-scenarios.e2e.test.ts
  • test/squad-20-real-clients-stdio.e2e.test.ts
  • test/squad-20-security-contracts.test.ts

⚠️ Critical Files

  • packages/squad-sdk/package.json
  • packages/squad-sdk/src/backend/index.ts
  • packages/squad-sdk/src/casting/index.ts
  • packages/squad-sdk/src/client/adapters/index.ts
  • packages/squad-sdk/src/client/index.ts
  • packages/squad-sdk/src/clients/index.ts
  • packages/squad-sdk/src/index.ts

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

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 0377874

PR Scope: 📦🔧 Mixed (product + infrastructure)

⚠️ 4 item(s) to address before review

Status Check Details
❌ Single commit 47 commits — consider squashing before review
✅ Not in draft Ready for review
✅ Branch up to date Up to date with dev
❌ Copilot review No Copilot review yet — it may still be processing
✅ Changeset present Changeset file found
✅ Scope clean ⚠️ PR includes 1 docs/proposals/ file(s) — ensure these are intentional
✅ No merge conflicts No merge conflicts
❌ Copilot threads resolved 3 unresolved Copilot thread(s) — fix and resolve before merging
❌ CI passing 6 check(s) still running

Files Changed (58 files, +10685 −16)

File +/−
.changeset/squad-2-0-multi-host-clients.md +6 −0
CONTRIBUTING.md +11 −0
README.md +13 −2
cspell.json +3 −0
docs/SQUAD-2.0-OVERVIEW.md +333 −0
docs/proposals/squad-2.0-security-and-isolation.md +103 −0
docs/specification/README.md +6 −0
docs/specification/adr-001-client-control-execution-boundary.md +59 −0
docs/specification/client-backend-decoupling-v0.2.md +487 −0
docs/specification/client-harness-adapters-v0.2.md +481 −0
docs/src/content/docs/concepts/squad-2-0-architecture.md +145 −0
docs/src/content/docs/reference/cli.md +2 −0
docs/src/content/docs/reference/config.md +2 −0
docs/src/content/docs/reference/sdk.md +9 −0
docs/src/content/docs/scenarios/client-compatibility.md +2 −0
docs/src/content/docs/scenarios/using-squad-across-clients.md +127 −0
docs/src/navigation.ts +2 −0
docs/tutorials/durable-backend-and-custom-harness.md +390 −0
docs/tutorials/multi-client-quickstart.md +361 −0
packages/squad-cli/src/cli-entry.ts +22 −2
packages/squad-cli/src/cli/commands/state-mcp.ts +20 −5
packages/squad-cli/src/cli/core/backend-mcp.ts +201 −0
packages/squad-cli/src/cli/core/clients.ts +101 −0
packages/squad-cli/src/cli/core/command-help.ts +2 −0
packages/squad-cli/src/cli/core/init.ts +30 −2
packages/squad-cli/src/cli/core/upgrade.ts +36 −2
packages/squad-sdk/package.json +8 −0
packages/squad-sdk/src/backend/durable-http-backend.ts +232 −0
packages/squad-sdk/src/backend/harness-registry.ts +47 −0
packages/squad-sdk/src/backend/index.ts +27 −0
packages/squad-sdk/src/backend/local-backend.ts +620 −0
packages/squad-sdk/src/backend/types.ts +415 −0
packages/squad-sdk/src/casting/handwritten-registry.ts +261 −0
packages/squad-sdk/src/casting/index.ts +10 −0
packages/squad-sdk/src/client/adapter-contract.ts +201 −0
packages/squad-sdk/src/client/adapters/adapters.ts +334 −0
packages/squad-sdk/src/client/adapters/apply.ts +363 −0
packages/squad-sdk/src/client/adapters/capabilities.ts +120 −0
packages/squad-sdk/src/client/adapters/coordinator.ts +108 −0
packages/squad-sdk/src/client/adapters/index.ts +6 −0
packages/squad-sdk/src/client/adapters/portable.ts +49 −0
packages/squad-sdk/src/client/adapters/types.ts +82 −0
packages/squad-sdk/src/client/index.ts +5 −0
packages/squad-sdk/src/clients/index.ts +9 −0
packages/squad-sdk/src/config/init.ts +4 −1
packages/squad-sdk/src/index.ts +3 −0
test-fixtures/spec/suite-v0.1/index.json +38 −0
test-fixtures/spec/suite-v0.2/capability-matrix.json +155 −0
test-fixtures/spec/suite-v0.2/golden-trace.json +63 −0
test/backend.test.ts +791 −0
... +8 more files

Total: +10685 −16


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🏗️ Architectural Review

Authoritative evidence: base-controlled pull_request_target reporter.

⚠️ Architectural review: 3 warning(s).

Severity Category Finding Files
🟡 warning bootstrap-area 5 file(s) in the bootstrap area (packages/squad-cli/src/cli/core/) were modified. These files must maintain zero external dependencies. Review carefully. packages/squad-cli/src/cli/core/backend-mcp.ts, packages/squad-cli/src/cli/core/clients.ts, packages/squad-cli/src/cli/core/command-help.ts, packages/squad-cli/src/cli/core/init.ts, packages/squad-cli/src/cli/core/upgrade.ts
🟡 warning export-surface Package entry point(s) modified with 181 new/changed export(s). New public API surface requires careful review for backward compatibility. packages/squad-sdk/src/index.ts
🟡 warning sweeping-refactor This PR touches 58 files (58 modified/added, 0 deleted). Large PRs are harder to review — consider splitting if possible. —

Automated architectural review — informational only.

…c/capability-matrix updates, casting registry repair/backfill, 126-test e2e suite)

Tree equals squad/2.0 (e74920c) minus docs/demos/squad-2.0-clients/ (kept off the upstream PR). Fixes test/cli-command-wiring.test.ts by moving the internal backend-mcp helper to cli/core/.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9

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.

🟡 Changes recommended

Unresolved filesystem confinement, lease fencing, lifecycle recovery, and concurrent persistence defects block safe adoption.

19 open issues
What changed in this PR

Introduces Squad 2.0’s shared backend contract and native projections for seven client hosts, separating host integration from conversation state and execution.

Changes:

  • Adds backend contracts, local/HTTP implementations, and MCP transport tools.
  • Adds host adapters and persistent --client support for initialization and upgrades.
  • Adds specifications, conformance fixtures, CLI checks, and tutorials.
File Description
vitest.config.ts Resolves SDK source and includes SDK tests.
test/​specification-suite.test.ts Registers new specification documents.
test/​docs-build.test.ts Adds expected documentation pages.
test/​clients-real-cli.test.ts Checks projections with installed host CLIs.
test-fixtures/​spec/​suite-v0.2/​golden-trace.json Defines recovery and cancellation trace.
test-fixtures/​spec/​suite-v0.2/​capability-matrix.json Defines capability negotiation baseline.
test-fixtures/​spec/​suite-v0.1/​index.json Registers draft profiles.
packages/​squad-sdk/​src/​index.ts Exports backend APIs.
packages/​squad-sdk/​src/​clients/​index.ts Provides compatibility re-exports.
packages/​squad-sdk/​src/​client/​index.ts Exports client adapter APIs.
packages/​squad-sdk/​src/​client/​adapters/​types.ts Defines host projection types.
packages/​squad-sdk/​src/​client/​adapters/​portable.ts Normalizes portable client identifiers.
packages/​squad-sdk/​src/​client/​adapters/​index.ts Exports projection utilities.
packages/​squad-sdk/​src/​client/​adapters/​coordinator.ts Adds shared and host-specific instructions.
packages/​squad-sdk/​src/​client/​adapters/​capabilities.ts Defines capabilities and intersection helpers.
packages/​squad-sdk/​src/​client/​adapters/​apply.ts Applies and removes projected files.
packages/​squad-sdk/​src/​client/​adapters/​adapters.ts Implements seven host projections.
packages/​squad-sdk/​src/​client/​adapter-contract.ts Defines runtime-bound client adapters.
packages/​squad-sdk/​src/​backend/​types.ts Defines backend and harness contracts.
packages/​squad-sdk/​src/​backend/​local-backend.ts Implements local conversation persistence and lifecycle.
packages/​squad-sdk/​src/​backend/​index.ts Exports APIs and backend factory.
packages/​squad-sdk/​src/​backend/​harness-registry.ts Registers harnesses and validates extensions.
packages/​squad-sdk/​src/​backend/​durable-http-backend.ts Implements remote HTTP backend client.
packages/​squad-sdk/​package.json Exposes clients and backend entrypoints.
packages/​squad-cli/​src/​cli/​core/​upgrade.ts Refreshes configured client projections.
packages/​squad-cli/​src/​cli/​core/​init.ts Projects requested clients during initialization.
packages/​squad-cli/​src/​cli/​core/​command-help.ts Documents client flags.
packages/​squad-cli/​src/​cli/​core/​clients.ts Parses, persists, and synchronizes clients.
packages/​squad-cli/​src/​cli/​commands/​state-mcp.ts Exposes backend tools through MCP.
packages/​squad-cli/​src/​cli/​commands/​backend-mcp.ts Translates MCP calls into backend operations.
packages/​squad-cli/​src/​cli-entry.ts Wires client options into CLI commands.
docs/​tutorials/​multi-client-quickstart.md Explains multi-host setup.
docs/​tutorials/​durable-backend-and-custom-harness.md Demonstrates backend and harness integration.
docs/​src/​navigation.ts Links new documentation pages.
docs/​src/​content/​docs/​scenarios/​using-squad-across-clients.md Adds multi-client walkthroughs.
docs/​src/​content/​docs/​scenarios/​client-compatibility.md Links Squad 2.0 guidance.
docs/​src/​content/​docs/​concepts/​squad-2-0-architecture.md Explains architectural boundaries.
docs/​SQUAD-2.0-OVERVIEW.md Summarizes architecture and conformance goals.
docs/​specification/​README.md Registers profiles and dependencies.
docs/​specification/​client-harness-adapters-v0.2.md Specifies adapter responsibilities.
docs/​specification/​client-backend-decoupling-v0.2.md Specifies portable backend semantics.
docs/​specification/​adr-001-client-control-execution-boundary.md Records architectural decisions.
docs/​proposals/​squad-2.0-security-and-isolation.md Defines proposed security and isolation gates.

Review effort: Balanced

Copilot and others added 3 commits October 18, 2026 20:37
- move squad-20-security-contracts test under test/ so eslint's project service finds it
- add changeset (Policy Gates: changelog) and cspell words (kiro, affordances, Bubu, resumability)
- docs: --client in README, CLI/config/SDK references, scenarios page (Codex, Antigravity, troubleshooting, no per-member files), quickstart tutorials, CONTRIBUTING adapter checklist

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…e fixtures from docs/tests

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…ngeset

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
@tamirdresher
tamirdresher force-pushed the squad/2.0-client-adapters-pr branch from cd92b26 to cb86aef Compare October 18, 2026 17:48
Copilot and others added 3 commits October 18, 2026 20:53
- containment guard (no ../, absolute or symlinked components) for install/uninstall
- forward --client on 'init --mode remote'
- never overwrite a malformed .squad/config.json when persisting clients
- reject wrong-typed MCP containers/entries instead of replacing them
- TOML: replace multiline arrays whole, tolerant headers, remove sub-tables on uninstall
- keep the shared .mcp.json entry while another host still uses it (uninstallClients keep)
- apply squadDir to the dispatch section as well

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…11 comments)

Symlink-safe file store, cross-process lock + single-transaction state changes, epoch fencing for harness events and omitted epochs, retryable approval/cancel delivery, run-identity lookups, approval cancel versioning, idempotent HTTP createConversation, per-conversation learned epochs. 10 regression tests; fix duplicate imports in test/clients.test.ts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
…, restart, lost response, per-conversation epochs, symlink parents)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
@tamirdresher

Copy link
Copy Markdown
Collaborator Author

Superseded by #2239 (same commits, moved to the in-repo branch squad/2.0-preview). Copilot's 19 review comments on this PR are all addressed there. Closing this one.

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