自动化测试验证系统

BarrHawk是一个多组件自动化测试验证系统,具有智能规划、执行和学习功能,适用于Web应用的自动化测试和验证。

  • by barrhawk
  • TypeScript
  • 本地部署
  • 15 星标
  • 更新于
在 GitHub 查看 barrhawk/barrhawk_premium_e2e_mcp

使用说明

巴尔霍克:验证你的VIBECODE

代理验证与编排操作系统

██████╗  █████╗ ██████╗ ██████╗ ██╗  ██╗ █████╗ ██╗    ██╗██╗  ██╗
██╔══██╗██╔══██╗██╔══██╗██╔══██╗██║  ██║██╔══██╗██║    ██║██║ ██╔╝
██████╔╝███████║██████╔╝██████╔╝███████║███████║██║ █╗ ██║█████╔╝
██╔══██╗██╔══██║██╔══██╗██╔══██╗██╔══██║██╔══██║██║███╗██║██╔═██╗
██████╔╝██║  ██║██║  ██║██║  ██║██║  ██║██║  ██║╚███╔███╔╝██║  ██╗
╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝ ╚══╝╚══╝ ╚═╝  ╚═╝
                                            v0.5.0 | TRIPARTITE RELEASE

“如果你的特工不能自我测试,那只是幻觉。”


v0.5.0的新增功能

  • 统一堆栈 -单一命令 bun run barrhawk 开始一切
  • 集成仪表板 -实时监控 http://localhost:7000/dashboard
  • 体验系统 -跨会话学习的自我修复选择器
  • 刀具注射 -新工具实时向正在运行的点火器广播
  • 雷击 -被卡住时,Igor自动升级为Claude
  • 集线器模式 -多点火器测试编排 --hub 旗帜

快速开始

# 1. Clone and install
git clone git@github.com:barrhawk/barrhawk_premium_e2e_mcp.git
cd barrhawk_premium_e2e_mcp
bun install

# 2. Start the stack
bun run barrhawk

# 3. Submit a test
curl -X POST http://localhost:7001/plan \
  -H "Content-Type: application/json" \
  -d '{"intent":"take a screenshot of the homepage","url":"https://example.com"}'

堆栈模式

bun run barrhawk           # Full tripartite stack (Bridge, Doctor, Igor, Frank)
bun run barrhawk --minimal # Just Bridge + Igor (lightweight)
bun run barrhawk --hub     # Full stack + Test Orchestration Hub

三方架构

四个通过WebSocket通信的专用服务器:

组件 端口 角色
桥 7000 信息总线、断路器、仪表板
医生 7001 计划器、意图解析器、体验引擎
伊戈尔 7002 闪电打击双模执行器
弗兰肯斯坦 7003 浏览器控制,动态工具锻造

运作原理

  1. 你 向医生发送意向: "test the login flow"
  2. 医生 参考经验,制定计划,选择工具
  3. 伊戈尔 一步一步地执行计划
  4. 弗兰肯斯坦 控制浏览器,截图
  5. 经验 记录下次有效的方法

雷击(双模点火器)

Igor以“哑巴模式”启动——基于正则表达式的快速执行。当一个步骤失败3次时,Igor会“罢工”——提升到完全的克劳德推理来解决问题,然后重新启动。


端点

医生(端口7001)

# Submit a plan
POST /plan
{"intent": "click the login button", "url": "https://example.com"}

# Check plan status
GET /plans
GET /plans/:id

大桥(港口7000)

# Health check
GET /health

# Live dashboard
GET /dashboard

点火器(端口7002)

# Status
GET /status
GET /health

# Current tool bag
GET /toolbag

弗兰肯斯坦(7003港)

# Health and tools
GET /health
GET /tools

项目结构

/
├── bin/barrhawk.ts          # CLI entry point
├── tripartite/              # The Core Stack
│   ├── bridge/              # Message Bus + Dashboard (7000)
│   ├── doctor/              # Planner + Swarm Logic (7001)
│   ├── igor/                # Executor + Lightning (7002)
│   ├── frankenstein/        # Browser + Tool Forge (7003)
│   └── shared/              # Common utilities
│       ├── experience.ts    # Learning system
│       ├── tool-registry.ts # 120+ tool definitions
│       └── types.ts         # Shared types
├── hub/                     # Test Orchestration (--hub mode)
│   ├── index.ts             # Hub API (7010)
│   ├── coordinator.ts       # Multi-Igor sync (7011)
│   └── igor-db.ts           # Database watcher (7012)
├── packages/                # Feature modules
│   ├── golden/              # Visual regression
│   ├── self-heal/           # Selector strategies
│   └── ...                  # 30+ packages
└── docs/                    # Documentation
    └── specs/               # Component specifications

MCP集成

BarrHawk为Claude Code、Cursor和其他AI助手提供了MCP工具。

配置Claude代码

./scripts/generate-mcp-configs.sh

关键工具

// Natural language automation
frank_execute({ task: "Log into github.com", url: "https://github.com" })

// Parallel testing
frank_swarm_execute({ intent: "Test checkout flow", maxIgors: 4 })

// OS-level control (extensions, dialogs)
frank_os_mouse({ action: "click", x: 100, y: 200 })
frank_os_keyboard({ combo: "ctrl+shift+i" })

// Screenshots
frank_screenshot({ fullPage: true })

体验系统

BarrHawk从每次测试运行中学习:

  • 选择器:哪些CSS选择器适用于哪些元素
  • 时间安排:每个站点通常需要多长时间的操作
  • 错误:常见错误模式及其修复
  • 站点:具有预映射选择器的已知站点模式

数据存储在 experiencegained/experience.json (可通过以下方式配置 EXPERIENCE_DIR).


发展

# Run tests
bun test

# Type check
bun run typecheck

# View logs
tail -f /tmp/tripartite-*.log

许可证

麻省理工学院


“信任,但要核实。” --BarrHawk