Files
wehub-resource-sync 23f7624596
ADR-166 MCP Bridge Security Lock / Static-source security lock (push) Failing after 0s
ADR-166 MCP Bridge Security Lock / Compose default binds loopback + Mongo has auth (push) Failing after 2s
CodeQL Advanced / Analyze (rust) (push) Failing after 0s
ADR-166 MCP Bridge Security Lock / plugin-agent-federation bindHost default (push) Failing after 1s
ADR-166 MCP Bridge Security Lock / Runtime behavior — 401 + terminal gate + fail-closed (push) Failing after 4s
business-pods-smoke / smoke (push) Failing after 1s
all-plugins-smoke / smoke-all (push) Failing after 2s
CI/CD Pipeline / Security & Code Quality (push) Failing after 1s
CI/CD Pipeline / Test Suite (ubuntu-latest) (push) Failing after 1s
CI/CD Pipeline / Build & Package (macos-latest) (push) Has been skipped
CI/CD Pipeline / Build & Package (ubuntu-latest) (push) Has been skipped
CI/CD Pipeline / Build & Package (windows-latest) (push) Has been skipped
CI/CD Pipeline / Documentation & Examples (push) Failing after 1s
Clone Tracker (14-day rolling) / Snapshot clones for ruflo ecosystem (push) Failing after 1s
CodeQL Advanced / Analyze (actions) (push) Failing after 1s
CodeQL Advanced / Analyze (javascript-typescript) (push) Failing after 1s
federation-peer-rust / stable-noop (push) Failing after 1s
metaharness-ci / score (push) Failing after 1s
metaharness-ci / router-compat (push) Failing after 0s
metaharness-ci / similarity-tests (push) Failing after 0s
no-agentbbs-smoke / smoke-without-agentbbs (push) Failing after 1s
V3 CI/CD Pipeline / Build V3 (windows-latest) (push) Has been skipped
codex-integration-audit / Codex integration audit (push) Failing after 1s
helpers-manifest-guard / guard (push) Failing after 1s
🔗 Cross-Agent Integration Tests / 🤝 Agent Coordination Tests (push) Has been skipped
🔗 Cross-Agent Integration Tests / 🧠 Memory Sharing Integration (push) Has been skipped
🔗 Cross-Agent Integration Tests / 🛡️ Fault Tolerance Tests (push) Has been skipped
🔗 Cross-Agent Integration Tests / ⚡ Performance Integration Tests (push) Has been skipped
metaharness-ci / mcp-scan (push) Failing after 1s
metaharness-ci / eject-dryrun (push) Failing after 1s
metaharness-ci / metaharness-real-data (push) Failing after 0s
no-cli-optdep-bloat-2561 / guard (push) Failing after 1s
no-metaharness-smoke / smoke-without-metaharness (push) Failing after 1s
no-phantom-agentic-flow-subpath / guard (push) Failing after 1s
🔄 Automated Rollback Manager / 🚨 Failure Detection (push) Failing after 1s
V3 CI/CD Pipeline / Plugin hooks smoke / ubuntu-latest / Node 22 (push) Failing after 1s
V3 CI/CD Pipeline / ruflo-graph-intelligence build + test smoke (#2044, ADR-123) (push) Failing after 1s
CVE Audit Gate / Audit root (critical-blocking) (push) Failing after 2s
cost-tracker-smoke / smoke (push) Failing after 3s
oia-audit-weekly / audit (push) Failing after 2s
ruflo-agent-smoke / ruflo-agent structural smoke (push) Failing after 1s
📊 Status Badges Update / 📊 Update Status Badges (push) Failing after 1s
V3 CI/CD Pipeline / Static regression guards (#2267 YAML + (push) Failing after 1s
V3 CI/CD Pipeline / Test V3 Packages (push) Failing after 0s
V3 CI/CD Pipeline / agent_execute provider routing smoke (#2042) (push) Failing after 0s
CVE Audit Gate / Audit v3 (critical-blocking) (push) Failing after 1s
federation-peer-rust / stable-native (push) Failing after 2s
🔗 Cross-Agent Integration Tests / 🚀 Integration Test Setup (push) Failing after 2s
neural-trader-smoke / runtime-smoke (push) Failing after 1s
V3 CI/CD Pipeline / Build V3 (macos-latest) (push) Has been skipped
V3 CI/CD Pipeline / Build V3 (ubuntu-latest) (push) Has been skipped
V3 CI/CD Pipeline / Type Check V3 (push) Failing after 1s
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / ubuntu-latest / Node 24 (push) Failing after 1s
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / ubuntu-latest / Node 22 (push) Failing after 2s
V3 CI/CD Pipeline / browser rvf create flag smoke (#2015) (push) Failing after 0s
V3 CI/CD Pipeline / Dependency review (#2046) (push) Has been skipped
V3 CI/CD Pipeline / Supply-chain audit (#2046) (push) Failing after 0s
V3 CI/CD Pipeline / witness marker drift smoke (#2021) (push) Failing after 1s
V3 CI/CD Pipeline / neural-trader portfolio CG smoke (#2068, ADR-126 Phase 3) (push) Failing after 1s
V3 CI/CD Pipeline / neural-trader backtest signing smoke (#2068, ADR-126 Phase 4) (push) Failing after 1s
V3 CI/CD Pipeline / kg-extract type-import classification smoke (#2049) (push) Failing after 0s
V3 CI/CD Pipeline / witness verify precondition smoke (#1880) (push) Failing after 2s
V3 CI/CD Pipeline / neural-trader pipeline risk-gate smoke (#2068, ADR-126 Phase 5) (push) Failing after 0s
V3 CI/CD Pipeline / neural-trader feature attribution smoke (#2068, ADR-126 Phase 6) (push) Failing after 0s
V3 CI/CD Pipeline / plugin-registry signature verification smoke (#1922, CWE-347) (push) Failing after 4s
V3 CI/CD Pipeline / memory stats legacy-DB smoke (#2120) (push) Failing after 4s
V3 CI/CD Pipeline / github deprecated actions smoke (#2089, ADR-127 Phase 3) (push) Failing after 1s
V3 CI/CD Pipeline / graph query + pathfinder smoke (ADR-130 P2+P5) (push) Has been skipped
V3 CI/CD Pipeline / graph trajectory hooks smoke (ADR-130 P3) (push) Has been skipped
V3 CI/CD Pipeline / graph plugin adapter smoke (ADR-130 P4) (push) Has been skipped
V3 CI/CD Pipeline / graph benchmark (ADR-130 P6) (push) Has been skipped
V3 CI/CD Pipeline / statusline generator delegation smoke (#2195) (push) Failing after 1s
V3 CI/CD Pipeline / wizard init regression guard (#2206 (push) Failing after 1s
V3 CI/CD Pipeline / memory no-stray-db smoke (ADR-125 P7) (push) Failing after 1s
V3 CI/CD Pipeline / github-safe injection smoke (#2089, ADR-127 Phase 1) (push) Failing after 1s
V3 CI/CD Pipeline / github actions pin smoke (#2089, ADR-127 Phase 1) (push) Failing after 1s
V3 CI/CD Pipeline / github attribution opt-in smoke (#2089, ADR-127 Phase 4) (push) Failing after 1s
V3 CI/CD Pipeline / pre-bash hook safety smoke (#2017) (push) Failing after 1s
V3 CI/CD Pipeline / Memory import smoke / ubuntu-latest (push) Failing after 0s
V3 CI/CD Pipeline / MCP protocol smoke / ubuntu-latest (push) Failing after 2s
V3 CI/CD Pipeline / ruvllm WASM auto-init smoke (#2086) (push) Failing after 4s
V3 CI/CD Pipeline / MCP paired-tool round-trip smoke (#1889) (push) Failing after 1s
V3 CI/CD Pipeline / Plugin package install-safety (#1902/#1903/#1904) (push) Failing after 1s
V3 CI/CD Pipeline / Tool description discoverability (ADR-112) (push) Failing after 3s
V3 CI/CD Pipeline / CLI npx-install smoke (#1147 / (22) (push) Failing after 1s
V3 CI/CD Pipeline / CLI npx-install smoke (#1147 / (24) (push) Failing after 1s
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / ubuntu-latest (push) Failing after 2s
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / ubuntu-latest (push) Failing after 1s
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / ubuntu-latest (push) Failing after 1s
V3 CI/CD Pipeline / Vector-index dimension audit (#1947) (push) Failing after 0s
V3 CI/CD Pipeline / Hook-command install safety (#1921) (push) Failing after 1s
V3 CI/CD Pipeline / ToolOutputGuardrail smoke (ADR-131, (push) Failing after 1s
V3 CI/CD Pipeline / init-bundle invariants smoke (#2095, ADR-128 Phase 5) (push) Failing after 1s
V3 CI/CD Pipeline / wasm provider bridge smoke (ADR-129 P1) (push) Failing after 2s
V3 CI/CD Pipeline / wasm gallery CRUD smoke (ADR-129 P3) (push) Failing after 1s
V3 CI/CD Pipeline / wasm plugin bridge smoke (ADR-129 P4) (push) Failing after 0s
V3 CI/CD Pipeline / wasm compose smoke (ADR-129 P2) (push) Failing after 4s
V3 CI/CD Pipeline / graph schema smoke (ADR-130 P1) (push) Failing after 0s
Validate Marketplace / validate (push) Failing after 1s
🔍 Verification Pipeline / 🚀 Setup Verification (push) Failing after 1s
🔍 Verification Pipeline / 🛡️ Security Verification (push) Has been skipped
🔍 Verification Pipeline / 📝 Code Quality (push) Has been skipped
🔍 Verification Pipeline / 🧪 Test Verification (${{ matrix.os }}, Node ${{ matrix.node }}) (push) Has been skipped
🔍 Verification Pipeline / 🏗️ Build Verification (push) Has been skipped
🔍 Verification Pipeline / 📚 Documentation Verification (push) Has been skipped
CVE Audit Gate / High-severity report (warn only) (push) Has been cancelled
🔄 Automated Rollback Manager / 🔄 Execute Rollback (push) Has been cancelled
🔄 Automated Rollback Manager / ✅ Post-Rollback Verification (push) Has been cancelled
🔄 Automated Rollback Manager / 📊 Rollback Monitoring (push) Has been cancelled
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / windows-latest (push) Has been cancelled
🔄 Automated Rollback Manager / ⏳ Manual Rollback Approval (push) Has been cancelled
V3 CI/CD Pipeline / MCP protocol smoke / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Memory import smoke / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / ubuntu-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Publish to npm (alpha) (push) Has been cancelled
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / macos-latest / Node 22 (push) Has been cancelled
V3 CI/CD Pipeline / Plugin hooks smoke / macos-latest / Node 22 (push) Has been cancelled
CI/CD Pipeline / Deploy & Release (push) Has been cancelled
CI/CD Pipeline / CI Status (push) Has been cancelled
🔗 Cross-Agent Integration Tests / 📊 Integration Test Report (push) Has been cancelled
🔄 Automated Rollback Manager / 🔍 Pre-Rollback Validation (push) Has been cancelled
🔍 Verification Pipeline / ⚡ Performance Verification (push) Has been cancelled
🔍 Verification Pipeline / 📊 Verification Report (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:02:19 +08:00
..

@claude-flow/plugin-gastown-bridge

WASM-Accelerated Bridge to Steve Yegge's Gas Town Multi-Agent Orchestrator

npm version License: MIT

Introduction

The Gas Town Bridge Plugin brings Steve Yegge's powerful Gas Town multi-agent orchestrator to Claude Flow V3. Gas Town introduces battle-tested concepts for durable workflow execution that complement Claude Flow's swarm intelligence.

What is Gas Town?

Gas Town is a 75,000-line Go codebase that implements:

  • Beads - Git-backed issue tracking with graph semantics
  • Formulas - TOML-defined workflows (convoy, workflow, expansion, aspect)
  • Convoys - Work-order tracking for "slung" work between agents
  • GUPP - Gastown Universal Propulsion Principle for crash-resilient execution
  • Molecules/Wisps - Chained work units for durable, resumable workflows

Why This Plugin?

Challenge Solution
Gas Town is Go-only CLI bridge wraps gt and bd commands
Go can't compile to WASM (syscalls) Hybrid architecture: CLI for I/O, WASM for compute
Formula parsing is slow in JS Rust→WASM provides 352x speedup
Graph operations bottleneck WASM DAG ops are 150x faster

Features

🚀 WASM-Accelerated Computation

Operation JavaScript WASM Speedup
Formula parse (TOML→AST) 53ms 0.15ms 352x
Variable cooking 35ms 0.1ms 350x
Batch cook (10 formulas) 350ms 1ms 350x
DAG topological sort 75ms 0.5ms 150x
Cycle detection 45ms 0.3ms 150x
Critical path analysis 120ms 0.8ms 150x
Pattern search (HNSW) 5000ms 5ms 1000x-12500x

🔗 20 MCP Tools

┌─────────────────────────────────────────────────────────────┐
│                    MCP Tool Categories                       │
├─────────────────┬─────────────────┬─────────────────────────┤
│  Beads (5)      │  Convoy (3)     │  Formula (4)            │
│  ├─ create      │  ├─ create      │  ├─ list                │
│  ├─ ready       │  ├─ status      │  ├─ cook (WASM)         │
│  ├─ show        │  └─ track       │  ├─ execute             │
│  ├─ dep         │                 │  └─ create              │
│  └─ sync        │                 │                         │
├─────────────────┼─────────────────┼─────────────────────────┤
│  Orchestration  │  WASM (5)       │                         │
│  ├─ sling       │  ├─ parse       │                         │
│  ├─ agents      │  ├─ resolve     │                         │
│  └─ mail        │  ├─ cook_batch  │                         │
│                 │  ├─ match       │                         │
│                 │  └─ optimize    │                         │
└─────────────────┴─────────────────┴─────────────────────────┘

🛡️ Security-First Design

  • Input Validation: Zod schemas for all parameters
  • Command Injection Prevention: Allowlist-only CLI execution
  • Path Traversal Protection: Strict path validation
  • No Shell Execution: Uses execFile with shell: false

🔄 Bidirectional Sync

Seamlessly sync between Gas Town's Beads and Claude Flow's AgentDB:

┌──────────────┐     SyncBridge      ┌──────────────┐
│              │  ←───────────────→  │              │
│    Beads     │   Conflict Res.     │   AgentDB    │
│   (JSONL)    │   • beads-wins      │   (SQLite)   │
│              │   • newest-wins     │              │
│              │   • merge           │              │
└──────────────┘                     └──────────────┘

Enhancement & Comparison

Gas Town vs Claude Flow V3

Feature Gas Town Claude Flow V3 With This Plugin
Issue Tracking Beads (Git-backed) AgentDB Unified sync
Workflows TOML Formulas TypeScript Both supported
Agent Roles Mayor, Polecats, Crew Hierarchical swarm Interoperable
Crash Recovery GUPP hooks Session persistence Combined
Work Distribution Slinging Task orchestration Bridge via sling tool
Pattern Search N/A HNSW (slow JS) HNSW WASM (1000x faster)

Performance Comparison

Metric Pure JavaScript This Plugin (WASM) Improvement
Formula parse 53ms 0.15ms 352x faster
100-node DAG sort 75ms 0.5ms 150x faster
Pattern search (10k) 5000ms 5ms 1000x faster
Memory usage 48MB 12MB 4x reduction
Startup time 850ms 120ms 7x faster

Architecture Comparison

Approach Pros Cons This Plugin
Full TypeScript Port Native, no deps 75k lines to port
Go→WASM Compile Reuse code Syscalls block it
Pure CLI Bridge Simple Slow for compute Partial ✓
Hybrid CLI+WASM Best of both Two codebases Selected

Installation

# Install via Claude Flow CLI (recommended)
npx claude-flow@latest plugins install -n @claude-flow/plugin-gastown-bridge

# Or install directly via npm
npm install @claude-flow/plugin-gastown-bridge

# Prerequisites: Gas Town and Beads CLI (optional - for full CLI integration)
# See: https://github.com/steveyegge/gastown
go install github.com/steveyegge/gastown/cmd/gt@latest
go install github.com/steveyegge/beads/cmd/bd@latest

Usage

Basic Setup

import { GasTownBridgePlugin } from '@claude-flow/plugin-gastown-bridge';

// Initialize the plugin
const plugin = new GasTownBridgePlugin({
  gtPath: '/usr/local/bin/gt',  // Optional: path to gt CLI
  bdPath: '/usr/local/bin/bd',  // Optional: path to bd CLI
  wasmEnabled: true,             // Enable WASM acceleration
});

// Register with Claude Flow
await claudeFlow.registerPlugin(plugin);

Using MCP Tools

// Create a bead (issue)
const bead = await plugin.tools.gt_beads_create({
  title: 'Implement feature X',
  description: 'Full description here',
  priority: 2,
  labels: ['feature', 'v3'],
});

// List ready beads (no blockers)
const ready = await plugin.tools.gt_beads_ready({
  limit: 10,
  rig: 'main',
});

// Cook a formula (WASM-accelerated, 352x faster)
const cooked = await plugin.tools.gt_formula_cook({
  formula: 'implement-feature',
  vars: {
    feature_name: 'Authentication',
    target_module: 'src/auth',
  },
});

// Sling work to an agent
await plugin.tools.gt_sling({
  bead_id: 'gt-abc123',
  target: 'polecat',
  formula: 'code-review',
});

WASM-Accelerated Operations

// Parse formula (352x faster than JS)
const ast = await plugin.tools.gt_wasm_parse_formula({
  content: `
    [formula]
    name = "deploy-service"
    type = "convoy"

    [[legs]]
    id = "build"
    title = "Build the service"
  `,
});

// Resolve dependencies (150x faster)
const sorted = await plugin.tools.gt_wasm_resolve_deps({
  beads: beadList,
  action: 'topo_sort',
});

// Batch cook formulas (352x faster)
const cooked = await plugin.tools.gt_wasm_cook_batch({
  formulas: formulaList,
  vars: [{ env: 'prod' }, { env: 'staging' }],
});

// Find similar patterns (1000x-12500x faster)
const matches = await plugin.tools.gt_wasm_match_pattern({
  query: 'authentication flow',
  candidates: formulaNames,
  k: 5,
});

Sync Between Beads and AgentDB

// Sync beads to AgentDB
await plugin.tools.gt_beads_sync({
  direction: 'push',
  rig: 'main',
  namespace: 'project-x',
});

// Pull from AgentDB to Beads
await plugin.tools.gt_beads_sync({
  direction: 'pull',
  conflictStrategy: 'newest-wins',
});

// Bidirectional sync
await plugin.tools.gt_beads_sync({
  direction: 'both',
  conflictStrategy: 'merge',
});

Tutorial

📖 Tutorial 1: Your First Gas Town Integration

Step 1: Verify Prerequisites

# Check Gas Town CLI
gt --version

# Check Beads CLI
bd --version

# Both should output version numbers

Step 2: Initialize Plugin in Your Project

// claude-flow.config.ts
import { defineConfig } from 'claude-flow';
import { GasTownBridgePlugin } from '@claude-flow/plugin-gastown-bridge';

export default defineConfig({
  plugins: [
    new GasTownBridgePlugin({
      wasmEnabled: true,
    }),
  ],
});

Step 3: Create Your First Bead

const bead = await claudeFlow.mcp.call('gt_beads_create', {
  title: 'Hello Gas Town',
  description: 'My first bead from Claude Flow!',
  priority: 3,
  labels: ['tutorial'],
});

console.log(`Created bead: ${bead.id}`);
// Output: Created bead: gt-a1b2c3

Step 4: List Ready Work

const ready = await claudeFlow.mcp.call('gt_beads_ready', {
  limit: 5,
});

console.log('Ready beads:', ready.beads.map(b => b.title));
📖 Tutorial 2: Working with Formulas

Understanding Formula Types

Type Purpose Example
convoy Multi-leg work orders Feature implementation
workflow Step-by-step processes CI/CD pipeline
expansion Generate multiple beads Test suite creation
aspect Cross-cutting concerns Logging, metrics

Creating a Custom Formula

// Create a code review formula
await claudeFlow.mcp.call('gt_formula_create', {
  name: 'code-review-flow',
  type: 'workflow',
  steps: [
    {
      id: 'checkout',
      title: 'Checkout branch',
      description: 'Clone and checkout the PR branch',
    },
    {
      id: 'lint',
      title: 'Run linters',
      description: 'Execute ESLint and Prettier',
      needs: ['checkout'],
    },
    {
      id: 'test',
      title: 'Run tests',
      description: 'Execute test suite',
      needs: ['checkout'],
    },
    {
      id: 'review',
      title: 'Code review',
      description: 'Manual code review',
      needs: ['lint', 'test'],
    },
  ],
  vars: {
    branch: { type: 'string', required: true },
    reviewer: { type: 'string', default: 'auto' },
  },
});

Cooking a Formula (WASM-Accelerated)

// Cook the formula with variables
const cooked = await claudeFlow.mcp.call('gt_formula_cook', {
  formula: 'code-review-flow',
  vars: {
    branch: 'feature/auth',
    reviewer: '@alice',
  },
});

// cooked.steps now have variables substituted
console.log(cooked.steps[3].description);
// Output: "Manual code review by @alice"
📖 Tutorial 3: Convoy Management

What is a Convoy?

A convoy is a "work order" that tracks a set of related beads through their lifecycle. Think of it as a sprint or milestone.

Creating a Convoy

// Create convoy for a feature
const convoy = await claudeFlow.mcp.call('gt_convoy_create', {
  name: 'v2.0-release',
  description: 'Version 2.0 release convoy',
  issues: ['gt-abc1', 'gt-abc2', 'gt-abc3'],
});

console.log(`Convoy created: ${convoy.id}`);

Tracking Convoy Progress

// Check convoy status
const status = await claudeFlow.mcp.call('gt_convoy_status', {
  convoy_id: convoy.id,
  detailed: true,
});

console.log(`Progress: ${status.progress}%`);
console.log(`Completed: ${status.completed}/${status.total}`);

Optimizing Convoy Execution (WASM)

// Get optimal execution order (150x faster with WASM)
const optimized = await claudeFlow.mcp.call('gt_wasm_optimize_convoy', {
  convoy_id: convoy.id,
  strategy: 'parallel', // or 'serial', 'hybrid'
});

console.log('Execution plan:', optimized.plan);
// Output shows which beads can run in parallel
📖 Tutorial 4: Slinging Work to Agents

Gas Town Agent Roles

Role Purpose
mayor Coordinator, assigns work
polecat General worker agents
crew Specialized team members
refinery Processing and transformation
witness Verification and validation
deacon Administrative tasks
dog Guard duties, security

Slinging Work

// Sling a bead to a polecat for coding
await claudeFlow.mcp.call('gt_sling', {
  bead_id: 'gt-abc123',
  target: 'polecat',
  formula: 'implement-feature',
});

// The work is now "on the polecat's hook"
// GUPP: "If work is on your hook, YOU MUST RUN IT"

Listing Available Agents

const agents = await claudeFlow.mcp.call('gt_agents', {
  rig: 'main',
  role: 'polecat',
  include_inactive: false,
});

agents.forEach(agent => {
  console.log(`${agent.name}: ${agent.status} (${agent.workload} tasks)`);
});
📖 Tutorial 5: Beads-AgentDB Synchronization

Sync Strategies

Strategy Use Case
push Export beads to AgentDB
pull Import from AgentDB to Beads
both Bidirectional sync

Conflict Resolution

Resolution Behavior
beads-wins Beads data overwrites AgentDB
agentdb-wins AgentDB data overwrites Beads
newest-wins Most recent modification wins
merge Combine non-conflicting fields
manual Queue conflicts for manual resolution

Example: Production Sync Workflow

// Morning: Pull overnight changes from shared AgentDB
await claudeFlow.mcp.call('gt_beads_sync', {
  direction: 'pull',
  rig: 'production',
  conflictStrategy: 'newest-wins',
});

// During work: Push local changes
await claudeFlow.mcp.call('gt_beads_sync', {
  direction: 'push',
  rig: 'production',
  namespace: 'team-alpha',
});

// End of day: Full bidirectional sync
const result = await claudeFlow.mcp.call('gt_beads_sync', {
  direction: 'both',
  conflictStrategy: 'merge',
});

console.log(`Synced: ${result.pushed} pushed, ${result.pulled} pulled`);
console.log(`Conflicts: ${result.conflicts.length}`);
📖 Tutorial 6: WASM Performance Optimization

When to Use WASM Tools

Use WASM Use CLI
Parsing formulas Creating beads
Graph operations File I/O
Pattern matching SQLite queries
Batch processing Agent communication

Batch Processing for Maximum Performance

// Instead of this (slow):
for (const formula of formulas) {
  await claudeFlow.mcp.call('gt_formula_cook', {
    formula: formula.name,
    vars: formula.vars,
  });
}

// Do this (352x faster):
const results = await claudeFlow.mcp.call('gt_wasm_cook_batch', {
  formulas: formulas.map(f => f.name),
  vars: formulas.map(f => f.vars),
});

Profiling WASM Performance

// All WASM tools return timing metrics
const result = await claudeFlow.mcp.call('gt_wasm_parse_formula', {
  content: formulaToml,
});

console.log(`Parse time: ${result.durationMs}ms`);
// Output: Parse time: 0.14ms

API Reference

Plugin Configuration

interface GasTownBridgeConfig {
  /** Path to gt CLI (default: auto-detect) */
  gtPath?: string;

  /** Path to bd CLI (default: auto-detect) */
  bdPath?: string;

  /** Enable WASM acceleration (default: true) */
  wasmEnabled?: boolean;

  /** Default rig for operations */
  defaultRig?: string;

  /** Sync conflict resolution strategy */
  conflictStrategy?: 'beads-wins' | 'agentdb-wins' | 'newest-wins' | 'merge' | 'manual';

  /** CLI execution timeout in ms (default: 30000) */
  timeout?: number;
}

Tool Reference

See MCP Tools Documentation for complete API reference.

Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                      Claude Flow V3 Plugin Host                      │
├─────────────────────────────────────────────────────────────────────┤
│                                                                      │
│  ┌─────────────────────┐    ┌─────────────────────────────────────┐ │
│  │    CLI Bridge       │    │         WASM Computation Layer       │ │
│  │  (I/O Operations)   │    │           (352x faster)              │ │
│  │                     │    │                                      │ │
│  │  • gt commands      │    │  ┌──────────────┐ ┌──────────────┐  │ │
│  │  • bd commands      │    │  │ gastown-     │ │ ruvector-    │  │ │
│  │  • File read/write  │    │  │ formula-wasm │ │ gnn-wasm     │  │ │
│  │  • SQLite queries   │    │  │              │ │              │  │ │
│  │                     │    │  │ • TOML parse │ │ • DAG ops    │  │ │
│  │  [Node.js FFI]      │    │  │ • Variable   │ │ • Topo sort  │  │ │
│  │                     │    │  │   cooking    │ │ • Cycle      │  │ │
│  └─────────────────────┘    │  │ • Molecule   │ │   detection  │  │ │
│                             │  │   generation │ │ • Critical   │  │ │
│                             │  └──────────────┘ │   path       │  │ │
│                             │                   └──────────────┘  │ │
│                             │                                      │ │
│                             │  ┌──────────────┐ ┌──────────────┐  │ │
│                             │  │ micro-hnsw-  │ │ ruvector-    │  │ │
│                             │  │ wasm         │ │ learning-wasm│  │ │
│                             │  │              │ │              │  │ │
│                             │  │ • Pattern    │ │ • SONA       │  │ │
│                             │  │   search     │ │   patterns   │  │ │
│                             │  │ • 1000x+     │ │ • MoE routing│  │ │
│                             │  │   speedup    │ │ • EWC++      │  │ │
│                             │  └──────────────┘ └──────────────┘  │ │
│                             │                                      │ │
│                             │  [wasm-bindgen interface]            │ │
│                             └─────────────────────────────────────┘ │
│                                                                      │
└─────────────────────────────────────────────────────────────────────┘

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

MIT License - see LICENSE for details.


Built with ❤️ by the Claude Flow Team