Metadata-Version: 2.1
Name: seamlock
Version: 0.3.4
Summary: Contract-level coherence and smart merging for parallel AI coding agents
Home-page: https://github.com/lucas-rus/seamlock
Author: Lucas-Michael Rus-Gheorghiu
License: MIT OR Apache-2.0
Project-URL: Homepage, https://github.com/lucas-rus/seamlock
Project-URL: Repository, https://github.com/lucas-rus/seamlock
Project-URL: Issues, https://github.com/lucas-rus/seamlock/issues
Keywords: ai,agents,git,mcp,merge,parallel,coherence
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Topic :: Software Development :: Version Control :: Git
Description-Content-Type: text/markdown

<p align="center">
  <img src="docs/assets/banner.png" alt="Seamlock — Contract-level coherence and smart merging for parallel AI coding agents" width="100%" />
</p>

<p align="center">
  <a href="https://github.com/lucas-rus/seamlock/actions/workflows/ci.yml"><img src="https://github.com/lucas-rus/seamlock/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
  <a href="https://github.com/lucas-rus/seamlock/releases/latest"><img src="https://img.shields.io/github/v/release/lucas-rus/seamlock?color=38bdf8&label=release" alt="Latest Release" /></a>
  <a href="https://www.npmjs.com/package/seamlock"><img src="https://img.shields.io/npm/v/seamlock?color=38bdf8&label=npm" alt="npm" /></a>
  <a href="https://pypi.org/project/seamlock/"><img src="https://img.shields.io/pypi/v/seamlock?color=34d399&label=PyPI" alt="PyPI" /></a>
  <a href="https://crates.io/crates/seamlock-cli"><img src="https://img.shields.io/crates/v/seamlock-cli?color=f59e0b&label=crates.io" alt="crates.io" /></a>
  <a href="#license"><img src="https://img.shields.io/badge/license-MIT%20%7C%20Apache--2.0-818cf8.svg" alt="License" /></a>
</p>

<p align="center">
  <a href="#quick-start">Quick Start</a> ·
  <a href="#why-seamlock">Why Seamlock</a> ·
  <a href="#benchmarks">Benchmarks</a> ·
  <a href="#mcp-integration">MCP Server</a> ·
  <a href="#cli-reference">CLI</a> ·
  <a href="#architecture">Architecture</a> ·
  <a href="#comparison">Comparison</a> ·
  <a href="CHANGELOG.md">Changelog</a>
</p>

---

**Seamlock** is a local Rust orchestration engine and [MCP](https://modelcontextprotocol.io) server for running multiple AI coding agents (**Claude Code, OpenAI Codex CLI, OpenCode, Cursor, Windsurf, Gemini CLI, VS Code / Copilot, Antigravity, or any MCP client**) **in parallel on the same repository** without merge conflicts or silent cross-file breakage.

Instead of locking whole files or relying on a slow post-hoc merge agent, Seamlock tracks **symbol contracts** (signatures, types, exports, schemas, HTTP routes) and **live edit regions** across git worktrees, sending surgical notices only to affected agents and verifying every merge before it lands.

---

## Quick Start

Install Seamlock and auto-connect it to your coding agents (macOS, Linux, and Windows):

```bash
# Homebrew (macOS & Linux)
brew install lucas-rus/tap/seamlock && seamlock setup

# npm / npx (macOS, Linux, Windows)
npm install -g seamlock && seamlock setup

# PyPI (uvx / pipx — macOS, Linux, Windows)
pipx install seamlock && seamlock setup

# crates.io (prebuilt via cargo-binstall, or cargo install seamlock-cli)
cargo binstall seamlock-cli && seamlock setup

# Shell installer (macOS / Linux) or PowerShell (Windows)
curl -fsSL https://raw.githubusercontent.com/lucas-rus/seamlock/main/install.sh | sh -s -- --setup
# irm https://raw.githubusercontent.com/lucas-rus/seamlock/main/install.ps1 | iex
```

*(From source with Rust >= 1.90: `cargo install seamlock-cli && seamlock setup`.)*

Run a parallel team on any repository:

```bash
# 1. Inspect existing worktrees or plan parallel ticket clusters
seamlock worktrees --base main
seamlock plan --rev HEAD

# 2. Launch coordinated parallel agents with live contract + region coherence
seamlock run --tasks tasks.json --mode enforce --regions --test-cmd "npm test"

# 3. Watch live coordination in another terminal
seamlock watch .seamlock/runs/
```

---

## Why Seamlock

Git worktrees isolate parallel agents from overwriting each other's files, but they do not prevent agents from **breaking each other's code**:

- 28% of AI-agent pull requests on GitHub hit merge conflicts ([AgenticFlict](https://arxiv.org/abs/2604.03551)).
- Two cooperating agents succeed ~30% less often than one agent doing both tasks ([CooperBench](https://arxiv.org/abs/2601.13295)).
- The hardest bugs are invisible to git: patches that ["pass alone but fail together"](https://arxiv.org/abs/2609.25396).

```python
# notify/email.py   (agent A: rate-limit e-mails)     # auth/reset.py   (agent B: password reset)
-def send_email(to, body):                            +def request_reset(user):
+def send_email(to, body, *, user_id):                +    token = tokens.issue(user)
     ...                                              +    send_email(user.email, reset_msg(token))
```

Both branches touch different files, merge cleanly in git, and pass their own tests—then crash at runtime with `TypeError: send_email() missing 1 required keyword-only argument: 'user_id'`. Meanwhile, a third agent rewriting only the *body* of another function in `notify/email.py` would be blocked unnecessarily by a file lock.

### How It Works

Seamlock treats each agent's worktree like a CPU cache and each symbol like a cache line:

1. **Inferred footprints.** Hooks and worktree diffs map what each agent actually reads, writes, and calls onto a live symbol graph—no manual file claims required.
2. **Contract vs. body.** Every symbol is split into its public contract (signature, type, schema, route) and its body. Body edits never block anyone. Contract edits are classified as **compatible** (informational notice) or **breaking** (short lease + targeted notice).
3. **Live region coherence and finish gate.** Overlapping edits in the same file are resolved live—pure two-sided insertions via AST-verified union, genuine collisions via region ownership and hand-offs. An agent cannot finish while it depends on a stale contract or unresolved conflict.
4. **Speculative integration and verification.** Branches are merged in finish order, checked with Tier-2 type checkers (`tsc`, `pyright`, `cargo check`, `go vet`) and your test command, with $O(\log k)$ bisection on regressions and an auditable Merge-Readiness Pack (`mrp.md` / `mrp.json`).

### Capabilities

<table>
  <tr>
    <td width="50%">
      <strong>Contract-Level Coherence</strong><br/>
      Separates symbol <em>contracts</em> from <em>bodies</em>. Body edits never block; breaking contract edits deliver exact before/after signatures and affected call sites only to impacted agents.
    </td>
    <td width="50%">
      <strong>Region Coherence &amp; Verified Union</strong><br/>
      Detects overlapping edits live, combines pure two-sided insertions with patience/diff3 + AST verification, and blocks duplicate symbol definitions before merge.
    </td>
  </tr>
  <tr>
    <td width="50%">
      <strong>Polyglot &amp; Full-Stack Contracts</strong><br/>
      Python, TypeScript/JS (incl. <code>@/</code> aliases), Rust, Go, C/C++, SQL/Prisma/Protobuf/OpenAPI schemas, and cross-language HTTP routes (FastAPI/Flask/Express/Next.js ↔ <code>fetch</code>/<code>axios</code>).
    </td>
    <td width="50%">
      <strong>12-Tool MCP Server &amp; One-Line Setup</strong><br/>
      Connects to OpenCode, Claude Code, Cursor, and Antigravity via <code>seamlock setup</code>. Exposes planning, symbol summaries, worktree inspection, smart merge, and team orchestration.
    </td>
  </tr>
  <tr>
    <td width="50%">
      <strong>Merge-Readiness Packs &amp; Tier-2 Checks</strong><br/>
      Generates <code>mrp.md</code> / <code>mrp.json</code> reports, runs <code>tsc</code>/<code>pyright</code>/<code>cargo check</code>/<code>go vet</code> via <code>--type-check</code>, and bisects test regressions in <em>O</em>(log <em>k</em>).
    </td>
    <td width="50%">
      <strong>Formally Verified Protocol</strong><br/>
      Bounded exhaustive BFS model checking proves Lease Exclusivity, Finish-Gate Soundness, Duplicate-Symbol Safety, and Deadlock-Freedom across reachable agent interleavings.
    </td>
  </tr>
</table>

---

## Benchmarks

<p align="center">
  <img src="docs/assets/benchmarks.png" alt="Seamlock v0.3.2 vs AI Merge Integrator across 4 multi-agent suites" width="100%" />
</p>

Evaluated in [`seamlock-bench`](https://github.com/lucas-rus/seamlock-bench). On 12-agent CommonMark (652 official spec examples), **uncoordinated parallel agents (`parallel-off`) collapse to 199/652** (~9 merge conflicts, ~302 integration-loss regressions), while a **single sequential agent takes 65.1 min** (`3.1×` slower than Seamlock, 651.2/652). Rather than comparing against sequential, the table below benchmarks Seamlock head-to-head against the strongest baseline: **`parallel-integrator`** (the same parallel agents in isolated worktrees, followed by an extra AI Integrator agent that resolves all merge conflicts and fixes regressions).

### Current Release (`v0.3.2`, DeepSeek V4.1 Flash + Pre-Registered Baselines)

All DeepSeek runs use `opencode-go/deepseek-v4.1-flash` with default Seamlock (`--mode enforce --regions --trim-outputs`) and list-price API cost ([protocol](https://github.com/lucas-rus/seamlock-bench/blob/main/PROTOCOL.md)). Across every suite, Seamlock achieved **0 merge conflicts** where the integrator had to resolve 1–10 conflicts per run:

| Benchmark Suite | Condition | Tests Passed | Conflicts | Wall Time | Total Tokens | List Cost |
|---|---|---:|---:|---:|---:|---:|
| **12-agent Python CommonMark** (652 official spec examples) | **Seamlock v0.3.2** | **652/652** | **0** | **20.0 min** | **34.0M** | **$0.99** |
| | `parallel-integrator` (n=4) | 652/652 | ~9 resolved | 31.7 min | 43.8M | $1.15 |
| | `sequential` (1 agent, `hy4` n=5) | 651.2/652 | 0 | 65.1 min *(3.1× slower)* | 34.0M | — |
| | `parallel-off` (uncoordinated, `hy4` n=5) | 199/652 *(broken)* | ~9 unresolved | 13.7 min | 48.0M | — |
| **6-agent Polyglot Full-Stack** (SQL + Python + TS `@/`, 30 live E2E) | **Seamlock v0.3.1** (n=2) | **30/30** | **0** | **8.8 min** | **7.7M** | $0.40 |
| | `parallel-integrator` (n=3) | 30/30 | 5–6 resolved | 13.8 min | 8.2M | **$0.33** |
| **5-agent Product Sprint** (Next.js + Postgres app) | **Seamlock** (n=2) | Matched | **0** | **16.7 min** | **31.5M** | **$0.69** |
| | `parallel-integrator` (n=3) | Matched | 1–3 resolved | 19.1 min | 33.6M | $0.76 |
| **6-agent TypeScript Dispatch App** (48 integration tests) | **Seamlock** (n=2) | **48/48** | **0** | **3.7 min** | **2.1M** | **$0.16** |
| | `parallel-integrator` (n=2) | 48/48 | 2–3 resolved | 6.8 min | 4.0M | $0.21 |

On 12-agent CommonMark, `v0.3.1` is **37% faster**, uses **22% fewer tokens**, and costs **14% less** than an AI merge integrator. On the 6-agent polyglot full-stack suite, `v0.3.1` cuts wall time by **34%** and total tokens by **31%** compared to `v0.3.0` (`8.8 min` vs `13.3 min`, `7.7M` vs `11.1M`), running faster and using fewer total tokens than the integrator.

### Release & Benchmark History

<details>
<summary><strong>Version-by-version progression (v0.1 → v0.3.1)</strong></summary>

Each milestone was validated empirically on [`seamlock-bench`](https://github.com/lucas-rus/seamlock-bench) before shipping as default:

| Release | Key Changes | CommonMark (12 agents) | Polyglot Full-Stack (6 agents) |
|---|---|---|---|
| **v0.1.x** | Initial contract coherence, peer merge, region coherence, 12-tool MCP server, 6 language front-ends + schemas + HTTP routes. | `652/652`, `0` conflicts, `20.8 min` (`hy4-flash-free`, n=5, pre-lean gate) | — |
| **v0.2.0 – v0.2.4** | Lean finish gate by default (`--no-lean` to opt out), `--trim-outputs` (8,000-char head/tail), finish-order integration, silent waits for OpenCode, base-failure filtering, process-group check timeouts. | `652/652`, `0` conflicts, `20.6 min`, `61.2M` tok, `$0.41` (`hy4`, n=3) · `20.6 min`, `34.6M` tok, `$1.00` (DeepSeek) | — |
| **v0.3.0** | Renamed from Concord to Seamlock; added public polyglot full-stack benchmark (`projects/fullstack`, SQL + Python + TS `@/`, 30 live E2E tests). | `652/652`, `0` conflicts, `22.3 min`, `39.8M` tok, `$1.09` (DeepSeek) | `30/30`, `0` conflicts, `13.3 min`, `11.1M` tok, `$0.44` (n=3; [report](https://github.com/lucas-rus/seamlock-bench/blob/main/results/ds-fullstack-030/report.md)) |
| **v0.3.1** *(current)* | Fixed OpenCode 2.x `shell`/`execute` hook mapping, blocked cross-worktree/log snooping, compact region-conflict notices (rules once in system note), fixed `silent_wait` livelock on rank-broken wait cycles. | `652/652`, `0` conflicts, **`20.0 min`**, **`34.0M` tok**, **`$0.99`** (DeepSeek) | `30/30`, `0` conflicts, **`8.8 min`**, **`7.7M` tok**, **`$0.40`** (n=2) |

</details>

<details>
<summary><strong>Pre-registered statistical studies (hy4-flash-free, n = 3 and n = 5)</strong></summary>

All pre-registered protocols, raw logs, bootstrap CIs, and Mann–Whitney U / Cliff's δ tests live in [`seamlock-bench`](https://github.com/lucas-rus/seamlock-bench).

**1. Lean Seamlock vs. AI Integrator (`opencode-go/hy4-flash-free`, n = 3 interleaved; [report](https://github.com/lucas-rus/seamlock-bench/blob/main/results/hy4-eff3/report.md)):**

| Condition | Spec examples passed | Merge conflicts | Wall-clock time | Coordination tokens | Total tokens | Cost per run |
|---|---:|---|---:|---:|---:|---:|
| `parallel-integrator` (12 agents + integrator) | 652 in every run | 8.7 ± 1.5 resolved | 35.5 ± 9.5 min | 27.6 ± 7.4M | 68.8 ± 14.6M | $0.48 ± 0.07 |
| **Seamlock (`--regions --trim-outputs`)** | **652 in every run** | **0** | **20.6 ± 6.3 min** | **17.5 ± 2.5M** | **61.2 ± 1.7M** | **$0.41 ± 0.01** |

Seamlock was faster, used fewer coordination tokens, and cost less in all nine pairings (Cliff's δ = −1.00, p = 0.10, the minimum possible with n = 3).

**2. Main baseline study vs. Sequential & Uncoordinated Parallel (`opencode-go/hy4-flash-free`, n = 5 interleaved, pre-lean gate; [report](https://github.com/lucas-rus/seamlock-bench/blob/main/results/hy4m/report/report.md)):**

| Condition | n | Spec examples (of 652) | Integration loss | Merge conflicts (of 12) | Wall-clock time |
|---|---:|---:|---:|---|---:|
| `sequential` (1 agent, ticket by ticket) | 5 | 651.2 ± 0.8 (650–652) | 0 | 0 | 65.1 ± 5.9 min (1.0×) |
| `parallel-off` (12 agents, uncoordinated) | 5 | 199.0 ± 30.1 (161–236) | 301.8 ± 45.8 | 9.0 ± 1.4 | 13.7 ± 1.9 min |
| `parallel-integrator` (12 agents + integrator) | 5 | 652 in every run | 0 | 9.4 ± 1.1 resolved | 34.2 ± 4.8 min (1.9×) |
| Seamlock, peer merge (v0.1 build) | 3 | 652 in every run | 0 | 0 | 27.1 ± 3.5 min (2.4×) |
| **Seamlock, region coherence (v0.1 pre-lean)** | **5** | **652 in every run** | **0** | **0** | **20.8 ± 1.9 min (3.1×)** |

Pre-registered tests (Mann–Whitney U, Holm-corrected): region coherence vs. `parallel-off` on examples passed (H1) and integration loss (H2), and vs. `sequential` on wall time (H3) all reached Cliff's δ = ±1.00, p = 0.03.

</details>

<details>
<summary><strong>Static evaluation: CooperBench 560 gold patch pairs (RQ1)</strong></summary>

On all **560** Python feature pairs of [CooperBench](https://github.com/cooperbench/CooperBench), Seamlock's textual merge results agree with CooperBench's own gold conflict report on **560/560** pairs:

- **24%** of pairs share files but touch disjoint symbols, so a file lock would serialize them needlessly.
- **12%** are contract-coupled, and only **1%** have call sites that violate the updated contract.
- Interference between *gold* human patches is rare (0 of 48 evaluable jinja pairs fail together); live coordination shows its impact on *agent* patches (see the live suites above).

Details: [eval/rq1/results.md](eval/rq1/results.md).

</details>

---

## MCP Integration

Seamlock runs locally next to your repository as a 12-tool [MCP](https://modelcontextprotocol.io) server.

### Connect Your Client

- **Automatic (auto-detects OpenCode, Claude Code, Codex CLI, Cursor, Windsurf, Gemini CLI, VS Code / Copilot, Antigravity):**
  ```bash
  seamlock setup
  ```
- **Any other MCP client (Cline, Roo Code, Zed, Continue, etc.):**
  Add a standard stdio MCP server running `seamlock mcp` (or `npx -y seamlock mcp`).
- **OpenAI Codex CLI (`~/.codex/config.toml`):**
  ```bash
  seamlock setup --client codex
  ```
- **OpenCode (CLI):**
  ```bash
  opencode mcp add --global seamlock -- seamlock mcp --agent-cli opencode
  ```
- **Claude Code (plugin with MCP server + `seamlock-team` skill):**
  ```text
  /plugin marketplace add lucas-rus/seamlock
  /plugin install seamlock@lucas-rus-seamlock
  ```
- **Antigravity (`~/.gemini/config/mcp_config.json`, then restart):**
  ```bash
  seamlock setup --client antigravity
  ```
  All planning, inspection, and merge tools run directly inside Antigravity. `seamlock_run` launches parallel workers via OpenCode or Claude Code (`--agent-cli opencode|claude`).

### MCP Tools (12)

| Category | Tool | Purpose |
|---|---|---|
| **Planning & Inspection** | `seamlock_plan` | Partition the repository symbol graph into shared contract hubs and producer-first ticket clusters |
| | `seamlock_symbols` | List symbol contracts and line spans without bodies (~10× fewer tokens than reading whole files) |
| | `seamlock_diff_contracts` | Contract-level diff between revisions or working tree, with impacted callers |
| | `seamlock_worktrees` | Zero-mutation live check across all active `git worktree` checkouts |
| | `seamlock_analyze` | Check concurrent branches for cross-file contract breaks, duplicate symbols, and overlaps |
| **Merging & Protocol** | `seamlock_smart_merge` | Producer-first merge with AST-verified insertion union, call conformance, `--type-check`, and $O(\log k)$ bisection |
| | `seamlock_negotiate` | Propose a signature adjustment to a symbol's live owner |
| | `seamlock_ack` | Acknowledge a peer's contract change |
| **Team Orchestration** | `seamlock_run` | Launch a coordinated parallel agent run (`tasks.json` or multi-wave `--milestones`) |
| | `seamlock_status` | Poll live agent progress, holds, and coordination events |
| | `seamlock_result` | Fetch final summary and SASE Merge-Readiness Pack (`mrp.md` / `mrp.json`) |
| | `seamlock_cancel` | Stop an active run and clean up worktrees |

---

## CLI Reference

Requires Rust >= 1.90 (if building from source) and git >= 2.38 (2.44+ recommended for `git merge-file --diff-algorithm`; Seamlock warns and falls back cleanly on older git).

```bash
seamlock setup                                   # auto-connect OpenCode, Claude Code, Cursor, Antigravity
seamlock plan --rev HEAD                         # identify shared hubs & producer-first parallel clusters
seamlock symbols src/                            # symbol contracts & spans (Py, TS/JS, Rust, Go, C/C++, Schemas)
seamlock diff old.py new.py                      # contract vs. body changes between two versions
seamlock worktrees --base main                   # inspect all active git worktrees (incl. uncommitted edits)
seamlock analyze --base main b1 b2 --json        # check branches for silent contract breaks (for CI & scripts)
seamlock typecheck --repo .                      # auto-detect & run Tier-2 checker (tsc, pyright/ty, cargo, go vet)
seamlock merge --base main b1 b2 --type-check    # contract-ordered smart merge + verified union + type check
seamlock mrp .seamlock/runs/<run-id>             # render SASE Merge-Readiness Pack (markdown or --json)
seamlock run --tasks tasks.json --mode enforce --regions --test-cmd "npm test"
seamlock run --milestones waves.json --mode enforce --regions --test-cmd "npm test"
```

> [!NOTE]
> **Zero-config acceptance gating:** `tasks.json` only needs `[{"name": "...", "prompt": "..."}]`. When per-ticket `check` commands are omitted, Seamlock automatically uses `--test-cmd` for finish-gate verification, regression checks, and $O(\log k)$ post-merge failure bisection.

### Try the Built-In Demo

```bash
git clone https://github.com/lucas-rus/seamlock && cd seamlock
cargo build --release

examples/running-example/setup.sh /tmp/seamlock-demo
./target/release/seamlock analyze --repo /tmp/seamlock-demo --base main agent-a agent-b agent-c --notices
```

<details>
<summary><strong>View demo output (cross-file breaking parameter detection)</strong></summary>

```text
Findings
  BREAKING   agent-a -> agent-b: notify.email.send_email   (no shared files: invisible to textual merge and file locks)
             now: def send_email(to, body, *, user_id)
             what: new required parameter `user_id`
             auth/reset.py:11  request_reset: send_email(user.email, reset_msg(token))
  FILE       agent-a & agent-c: notify/email.py   disjoint symbols (a file lock would serialise this needlessly)

Textual merge (git merge-tree)
  agent-a & agent-b: clean
  agent-a & agent-c: clean
  agent-b & agent-c: clean

Protocol simulation (notices each agent would receive)
  -> to agent-b
     [seamlock] BREAKING contract change: notify.email.send_email   v0 -> v1   (by agent-a)
       before: def send_email(to, body)
       after : def send_email(to, body, *, user_id)
       what  : new required parameter `user_id`
       your code that depends on it:
         auth/reset.py:11  request_reset: send_email(user.email, reset_msg(token))
  Finish gates:
     agent-a: open
     agent-b: BLOCKED (1 unresolved)
     agent-c: open
```

</details>

### Watch a Team Live

<p align="center">
  <img src="docs/assets/seamlock-watch-demo.gif" alt="seamlock watch live terminal dashboard coordinating 12 parallel agents" width="100%" />
</p>

```bash
seamlock watch .seamlock/runs/            # follow the latest run in a live terminal dashboard
seamlock watch .seamlock/runs/ --web      # open live coordination graph in the browser
seamlock watch .seamlock/runs/ --once     # print one snapshot (useful for logs)
```

```text
seamlock  1795518603-enforce-463d82  1/12 finished  03:07 · running

  agent             state                              edits notices blocks hand-off combined merges
  code-spans        finished                               4       0      0        0        0      0
  emphasis          working                                8       0      0        0        0      0
  images-autolinks  working                                2       0      0        0        1      0
  lists             working                                5       0      0        0        1      0
  ...

  coordination
  02:26  region    raw-html-breaks yields src/cmark/inlines.py to code-spans
  02:36  combine   lists + headings add at the same place in src/cmark/blocks.py
  02:59  done      code-spans finished
```

### GitHub Cross-PR CI Action

Drop [`action.yml`](action.yml) into any GitHub Actions workflow to cross-check concurrently open pull requests for silent contract breaks:

```yaml
- uses: lucas-rus/seamlock@main
  with:
    base: main
```

---

## Architecture

```mermaid
flowchart LR
  subgraph Agents
    A1["Agent 1 (worktree w1)"]
    A2["Agent 2 (worktree w2)"]
    An["Agent n (worktree wn)"]
  end
  subgraph Coherence layer
    FT["Footprint tracker"]
    SG["Symbol graph (contracts / bodies / uses)"]
    CD["Coherence directory (leases, versions, notices)"]
  end
  SI["Speculative integrator (merge-tree, type-check, tests)"]
  IQ["Integration queue"]
  A1 & A2 & An -- "hook events, diffs" --> FT --> SG --> CD
  CD -. "notices, finish gate" .-> A1 & A2 & An
  FT --> SI --> CD
  CD --> IQ --> main[("main")]
```

| Crate | Role | Coverage |
|---|---|---|
| [`seamlock-core`](crates/seamlock-core) | Symbols, contract/body change classification, coherence protocol (leases, duplicate-symbol guard, negotiation, finish gate), pairwise analysis, exhaustive BFS model checker | Complete |
| [`seamlock-lang`](crates/seamlock-lang) | Tree-sitter and schema front-ends: normalized contracts, body digests, imports, reference resolution, HTTP route linking, affected-test graph | Python, TS/JS, Rust, Go, C/C++, Schemas |
| [`seamlock-git`](crates/seamlock-git) | Git plumbing: tree reading, in-memory `merge-tree`, patience/diff3 verified insertion-union, worktree snapshots and listing | Complete |
| [`seamlock-cli`](crates/seamlock-cli) | `seamlock` binary: `setup`, `plan`, `symbols`, `diff`, `analyze`, `worktrees`, `typecheck`, `merge`, `mrp`, `run`, `watch`, `mcp` (12 MCP tools + authenticated TCP daemon) | Complete |

**Supported languages:** Python (`.py`, `.pyi`), TypeScript/JavaScript (`.ts`, `.tsx`, `.mts`, `.cts`, `.js`, `.jsx`, `.mjs`, `.cjs`, including `@/...` and `~/...` tsconfig root aliases), Rust (`.rs`), Go (`.go`), C/C++ (`.c`, `.h`, `.cc`, `.cpp`, `.cxx`, `.hh`, `.hpp`, `.hxx`), schema/API contracts (`.sql`, `.prisma`, `.proto`, OpenAPI `.json`/`.yaml`), and cross-language HTTP routes (FastAPI/Flask/Express/Next.js App Router ↔ `fetch`/`axios`). Other file types still participate in textual/structural merge checks and file-existence guards.

Docs: [Design](docs/design.md) · [Tech Stack](docs/tech-stack.md) · [Roadmap](docs/roadmap.md) · [Related Work](docs/research/related-work.md) · [Contributing](CONTRIBUTING.md) · [Security](SECURITY.md)

---

## Comparison

| Tool | Unit of coordination | Footprint | Cross-file contract dependencies | Proactive, targeted feedback |
|---|---|---|---|---|
| Claude Code agent teams | Tasks; files by convention | Declared by lead | No | Free-form messages |
| [Clash](https://github.com/clash-sh/clash) | File (textual merge) | Observed diffs | No | Pre-edit warning |
| [Grove](https://github.com/NathanDrake2406/grove) | File, hunk, symbol, import | Observed diffs | Imports/exports | Advisory score |
| [Weave](https://github.com/Ataraxy-Labs/weave) / [Aura](https://github.com/Naridon-Inc/aura) | AST entities | Declared MCP claims | No (same-file entity merge) | Entity claim conflict |
| [Claim Plane](https://github.com/SkeinRank/claim-plane) | Declared intents/regions | Declared by planner | Partially | Admission (96.7% serialized) |
| [Gas Town](https://github.com/gastownhall/gastown) Refinery | Merge queue | — | At merge time | No |
| **Seamlock** | **Symbols (contract vs. body) + regions** | **Inferred at runtime** | **Yes (live + post-merge + HTTP/schema)** | **Surgical notices + finish gate + MRP** |

---

## License

Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option.
