Skip to main content
Glama
caslatch-mcp
by slchy

caslatch

Lightweight optimistic-lock TDD gate & heterogeneous multi-agent audit CLI + stdio MCP server.

Zero third-party runtime dependencies (pure Node.js >= 22 ESM). Designed for coordinator-led multi-agent development with one projection direction: Slice Spec → Tests → Implementation.

Core Ideas

  1. Optimistic Lock (CAS): Concurrent worker agents write to disjoint file whitelists directly in the workspace (no heavy worktrees, no intermediate lock commits). At merge points, caslatch check deterministically verifies spec/test locks and write boundaries.

  2. Mechanical Double Locks + 1+1 Spot-Check: Spec and accepted test files are SHA-256 locked in .dsh/lock.json. When caslatch check passes, it automatically selects 1 random changed file (RANDOM_SPOT_CHECK) so the coordinator always reviews 1 random + 1 highest-risk diff (never zero diff, never full-diff token bloat).

  3. Heterogeneous First-Class Audit: caslatch audit / caslatch_audit is a one-shot action enforcing three independence invariants:

    • Model-ID mutual exclusion (auditor_model !== author_model, e.g. grok-4.7-xhigh-fast auditing deepseek-flash);

    • Mutually invisible auditors (isolated short-lived sessions & distinct report files);

    • Read-only + workspace snapshot comparison (any side-effect write marks SNAPSHOT: DIRTY and blocks).

    • Returns AUDIT: PASS | BLOCK | UNAVAILABLE. If AUDIT: UNAVAILABLE (unconfigured, quota/auth/network error, or spawn failure), the coordinator decides whether to review directly, dispatch read-only dsh, or use another auditor.

  4. Dual Interface (CLI + MCP):

    • MCP (caslatch-mcp): 5 compact tools (caslatch_lock, caslatch_check, caslatch_snap, caslatch_gate, caslatch_audit) for the coordinator—mount globally once and use across every repo.

    • CLI (caslatch): Direct terminal/CI invocation and per-repo agents/gate.mjs shim.

Related MCP server: Zof MCP server

CLI Usage

caslatch lock spec agents/specs/my-slice.md
caslatch lock test tests/my-slice.test.ts
caslatch check --allow src/module-a.ts src/module-b.ts
caslatch run typecheck -- npm run typecheck
caslatch gate
caslatch snap
caslatch audit --stage gate2 --author-model deepseek-flash --model grok-4.7-xhigh-fast --spec agents/specs/my-slice.md

MCP Configuration Example

Register caslatch-mcp once in your host's mcp_config.json:

{
  "mcpServers": {
    "caslatch": {
      "command": "node",
      "args": ["C:/caslatch/bin/caslatch-mcp.mjs"]
    }
  }
}

Consuming in Any Repository

Keep each consuming repo minimal with agents/:

  • agents/caslatch.json — project gate commands & default author/auditor models

  • agents/gate.mjs — tiny shim pulling https://github.com/slchy/caslatch.git into gitignored agents/.upstream/

  • Add .dsh/ and agents/.upstream/ to .gitignore

See docs/WORKFLOW.md (Chinese) or docs/WORKFLOW.en.md (English) for the complete governance specification.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Gives a compatible coding agent read-only access to bounded local verification of changes inside a single host-chosen workspace, exposing six stdio tools that inspect capabilities, static checks, impact analysis, policy evaluation, evidence generation, and suggested tests without shell access, plugin loading, or repository upload.
      22 npm
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to inspect local Git repositories through five focused, read-only tools for repository trees, literal text search, numbered file reads, bounded git diffs, and project summaries while confining paths, skipping secret-like and binary files, and enforcing output limits.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Exposes ten tools that let agents and humans coordinate through a deterministic control plane: starting tasks, acquiring and releasing typed file leases, writing and searching permissioned memory, requesting approvals, polling structured events, and submitting work through a merge gate. Every action is checked against signed mandates and policy before it succeeds, so multi-agent teams can share a repo and an audit trail without a supervisor model watching every session.
      MIT