seamlock

mcp
Guvenlik Denetimi
Basarisiz
Health Uyari
  • License — License: Apache-2.0
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 5 GitHub stars
Code Basarisiz
  • spawnSync — Synchronous process spawning in crates/seamlock-cli/src/opencode_plugin.js
Permissions Gecti
  • Permissions — No dangerous permissions requested

Bu listing icin henuz AI raporu yok.

SUMMARY

Contract-level coherence for parallel AI coding agents: symbol-level coordination, contract-change notices and speculative integration (Rust)

README.md

Seamlock — Contract-level coherence and smart merging for parallel AI coding agents

CI Latest Release npm PyPI crates.io License

Quick Start · Why Seamlock · Benchmarks · MCP Server · CLI · Architecture · Comparison · Changelog


Seamlock is a local Rust orchestration engine and MCP 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):

# 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:

# 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:

# 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

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

Benchmarks

Seamlock vs AI Merge Integrator across 4 multi-agent suites

Evaluated in 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).

Latest Benchmarks (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). The coordination engine has been unchanged since v0.3.1 (v0.3.2–v0.3.4 added npm/PyPI/crates.io packaging, native Windows support, and 8-client auto-setup). 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 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 (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, Seamlock is 37% faster, uses 22% fewer tokens, and costs 14% less than an AI merge integrator. On the 6-agent polyglot full-stack suite, the current engine 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

Version-by-version progression (v0.1 → v0.3.4)

Each milestone was validated empirically on 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)
v0.3.1 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)
v0.3.2 – v0.3.4 (current) Multi-registry distribution (npm, PyPI, crates.io, Homebrew, MCP Registry), native Windows support (x86_64-pc-windows-msvc + install.ps1), and 8-client seamlock setup (OpenCode, Claude Code, Codex CLI, Cursor, Windsurf, Gemini CLI, VS Code, Antigravity). Same coordination engine as v0.3.1 Same coordination engine as v0.3.1
Pre-registered statistical studies (hy4-flash-free, n = 3 and n = 5)

All pre-registered protocols, raw logs, bootstrap CIs, and Mann–Whitney U / Cliff's δ tests live in seamlock-bench.

1. Lean Seamlock vs. AI Integrator (opencode-go/hy4-flash-free, n = 3 interleaved; report):

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):

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.

Static evaluation: CooperBench 560 gold patch pairs (RQ1)

On all 560 Python feature pairs of 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.


MCP Integration

Seamlock runs locally next to your repository as a 12-tool MCP server.

Connect Your Client

  • Automatic (auto-detects OpenCode, Claude Code, Codex CLI, Cursor, Windsurf, Gemini CLI, VS Code / Copilot, Antigravity):
    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):
    seamlock setup --client codex
    
  • OpenCode (CLI):
    opencode mcp add --global seamlock -- seamlock mcp --agent-cli opencode
    
  • Claude Code (plugin with MCP server + seamlock-team skill):
    /plugin marketplace add lucas-rus/seamlock
    /plugin install seamlock@lucas-rus-seamlock
    
  • Antigravity (~/.gemini/config/mcp_config.json, then restart):
    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).

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

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
View demo output (cross-file breaking parameter detection)
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

Watch a Team Live

seamlock watch live terminal dashboard coordinating 12 parallel agents

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)
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 into any GitHub Actions workflow to cross-check concurrently open pull requests for silent contract breaks:

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

Architecture

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 Symbols, contract/body change classification, coherence protocol (leases, duplicate-symbol guard, negotiation, finish gate), pairwise analysis, exhaustive BFS model checker Complete
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 Git plumbing: tree reading, in-memory merge-tree, patience/diff3 verified insertion-union, worktree snapshots and listing Complete
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 · Tech Stack · Roadmap · Related Work · Contributing · Security


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 File (textual merge) Observed diffs No Pre-edit warning
Grove File, hunk, symbol, import Observed diffs Imports/exports Advisory score
Weave / Aura AST entities Declared MCP claims No (same-file entity merge) Entity claim conflict
Claim Plane Declared intents/regions Declared by planner Partially Admission (96.7% serialized)
Gas Town 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 or MIT license at your option.

Yorumlar (0)

Sonuc bulunamadi