convez.ai
MCP ServerSegurançaAvançado
StephenSook

CornerCheck

StephenSook/cornercheck

Validação de clearance de lutadores com suspensões cross-jurisdição no Slack

Ver no GitHub
InicialPluginScore · de 0 a 100

MCP Server Slack que valida clearance de lutadores verificando suspensões médicas cross-jurisdição, janelas de retorno à competição e histórico de lesões. Integra registros públicos de comissões de boxe/MMA com busca em tempo real no Slack, mantendo ledger auditável com hash-chain para decisões de segurança no esporte de combate.

Instalação

$npx convez-ai StephenSook/cornercheck

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 5 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Verificar se lutador tem suspensão ativa em outra jurisdição antes de liberar luta
  • Consultar janelas obrigatórias de retorno após KO/TKO baseado em protocolos médicos
  • Rastrear sinais de lesão em histórico Slack com citações de permalink

Veredito

Ferramenta especializada e crítica para segurança em esportes de combate, implementada como MCP Server. Resolve problema real (mortes por suspensões não cross-consultadas) com design fail-closed e auditoria integrada, mas nicho muito específico (boxe/MMA) com adoção limitada fora desse domínio.

README

A tradução para o português deste README ainda está na fila.

A Slack-native AI agent that helps fight-operations teams, matchmakers, and athletic commissions confirm whether a combat-sports athlete is safe and cleared to compete. It catches the cross-jurisdiction medical suspension a team would otherwise miss, and refuses to clear a fighter when it cannot be sure who they are.

Built for the Slack Agent Builder Challenge, Slack Agent for Good track. Live for judging: the agent runs inside Slack, and cornercheck.onrender.com is its public health page.

CornerCheck is decision support. A human always makes the final call, and every decision lands in a tamper-evident, hash-chained audit ledger.

The problem

Medical suspensions in boxing and MMA do not reliably cross jurisdictions. A fighter knocked out under one commission can be booked under another before the mandatory medical hold expires. For professional boxing, federal law (15 U.S.C. §6306(b)) requires the licensing commission to consult the suspending one first; in practice that step is often skipped, and MMA has no federal equivalent at all. In 2017, boxer Tim Hague died after a knockout in Edmonton; his prior medical suspension had lapsed days earlier and he fought as a late replacement. The 2024 fatality inquiry called for a single registry of fighters' medical and bout histories. CornerCheck brings that consult-first discipline to where fight operations already coordinate: Slack.

What it does

  • Catches cross-jurisdiction suspensions against curated, source-cited public commission records. When the booking commission differs from the suspending one, it surfaces the consult-first step: binding federal law for boxing (15 U.S.C. §6306(b)), and for MMA the same discipline applied where no federal rule exists.
  • Enforces return-to-competition windows from Association of Ringside Physicians / ABC guidance (30 days after a TKO, 60 after a KO, 90 after a KO with loss of consciousness, plus stricter state overlays), encoded as data-driven decision tables.
  • Surfaces injury signals from the team's own Slack via the Real-Time Search API, with permalink citations, so a "got rocked in sparring Tuesday" message does not get lost.
  • Refuses to clear an ambiguous identity. Two pro fighters share a name; CornerCheck shows the candidates and asks a human to pick. A wrong "cleared" can be fatal; a wrong "refused" costs a phone call.

Architecture

CornerCheck is a neurosymbolic system: the language model perceives natural language and orchestrates tools, but the clearance decision itself comes from a deterministic, formally verified symbolic core. The model proposes; the proven core disposes. That separation is what lets the fail-closed guarantee be code, not a prompt.

flowchart TD
    U["You, in Slack:<br/>Is this fighter cleared to compete?"]
    U --> S

    subgraph NEURO["Neuro: perceives and orchestrates"]
      direction TB
      S["Slack surfaces<br/>Assistant pane / Block Kit / Real-Time Search"]
      A["Claude Agent SDK brain"]
      M["MCP server (FastMCP)<br/>resolve / rules / ledger tools"]
      G{{"fail-closed gate<br/>(PreToolUse hook)"}}
      S --> A --> M --> G
    end

    subgraph SYM["Symbolic: decides, formally proven fail-closed"]
      direction TB
      ER["Entity resolution<br/>pg_trgm + jellyfish, banded"]
      RE["Rule engine<br/>YAML decision tables"]
      Z["Z3 safety proof<br/>active suspension means never CLEAR"]
      L["Audit ledger<br/>HMAC-SHA256 hash chain"]
      DB[("Postgres")]
      ER --> RE --> L --> DB
      RE -. verified by .-> Z
    end

    G --> ER

All three Slack agent surfaces are load-bearing: the Assistant pane and Block Kit (verdict cards, a disambiguation picker, a Data Table audit view), one Model Context Protocol server the Claude agent orchestrates, and Real-Time Search for the injury signal.

Three independent fail-closed locks each block a wrong clearance, so no single failure can produce one: an in-tool engine re-check (refused writes are themselves ledgered), a deterministic PreToolUse hook, and a pipeline whose card renders only from the engine, never from model prose. See docs/architecture.md for the full write-up.

Verification

The clearance decision logic is checked by Z3: the engine's suspension-window membership is proven equivalent to an independently-written safety specification over all dates and intervals, so if a suspension is active on the date, the engine can never return CLEAR. The proof is not a tautology (an in-suite mutation test confirms it catches engine corruption), and it earned its keep: it surfaced a real fail-open bug, a malformed end < start date range that silently cleared a suspended fighter, now fixed to fail closed.

uv run python scripts/z3_proof_demo.py   # proves the invariant, then plants a bug and watches Z3 catch it

Quickstart

uv sync                       # install (Python 3.12)
docker compose up -d          # local Postgres
uv run python seeds/seed_db.py --force   # 4,107 real fighters + 15 cited suspension cases
uv run pytest                 # 114 tests (live-marked tests excluded by default)
uv run ruff check . && uv run mypy src tests

To run the agent you need a Slack app (Socket Mode) and an Anthropic API key; copy .env.example to .env and fill it in, then uv run python -m cornercheck.app.main.

Pre-commit hooks (ruff, gitleaks) run locally; on every push, CI re-runs lint, mypy, the full suite against a real Postgres service, a build, and a full-history secret scan.

Project layout

src/cornercheck/
  app/          Slack surface: Assistant handlers, Block Kit cards, actions, App Home
  brain/        Claude Agent SDK session, PreToolUse fail-closed hook, deterministic pipeline
  mcp_server/   one FastMCP server, the agent's tool surface
  rules/        YAML decision-table rule engine (clearance rules are data, not code)
  er/           entity resolution (pg_trgm + jellyfish, threshold-banded, fail-closed)
  ledger/       HMAC-SHA256 hash-chained audit ledger + verifier
  verification/ Z3 safety proof
tests/          unit, property (Hypothesis), integration, formal (Z3)
docs/           architecture, decisions log, demo script, submission writeup

Built with

Python 3.12, Slack Bolt (Assistant, Socket Mode), Block Kit, Real-Time Search, Claude Agent SDK, FastMCP (Model Context Protocol), Postgres (pg_trgm, jellyfish), Z3, Hypothesis, Render.

Responsible AI

CornerCheck is decision support, never a diagnosis or a replacement for a commission or a ringside physician. The model cannot decide clearance: the verdict is computed by the deterministic engine and gated by code. Every blocking suspension is shown with its source. Workspace search results are treated as untrusted data, cited by permalink and never stored. Identity ambiguity, an unreachable database, and a timed-out reasoning step all resolve toward "not cleared."

License

Apache-2.0.

Ver o original no GitHub

Bom para

Relacionados