Skip to content

edycutjong/conclave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Conclave Logo

Conclave πŸ—³οΈ

Agentic governance that reads the contract before it signs.

Conclave Hero

Live Demo Pitch Deck Pitch Video Built for Casper Agentic Buildathon


Next.js TypeScript Casper Contracts Anthropic MCP License CI


πŸ“Έ See it in Action

A council of AI agents debates every DAO proposal, grounds it in live Casper state, collects approvals off-chain, and β€” after a human veto window β€” executes the approved transaction on Casper Testnet.

1. Conclave Governance Dashboard

Conclave Dashboard

The main war-room interface displaying the proposal registry, active voting statuses, and the four AI council agent seats (Risk, Treasury, Legal, and the Arbiter).

2. Multi-Agent Council Deliberation

AI Council Deliberating

Convening the council. The three specialist agents (Risk, Treasury, Legal) stream their reasoning live, analyzing the proposal against grounded Casper Testnet state.

3. Human Veto Window

Veto Window

Once the Arbiter issues a positive consensus verdict, the proposal enters a human veto countdown, allowing manual intervention before execution.

4. Casper Testnet Execution

Executed Proposal

After the veto window closes, the Executor agent signs and broadcasts the transaction to the Casper Testnet, linking to a live block explorer.

5. Interactive "What-If" Console

What-If Console

The custom proposal composer where users can test arbitrary targets, assets, and amounts against the AI council's reasoning.

6. Automated Policy Enforcement (Charter Violation)

Policy Violation Blocked

A demonstration of a Charter Section 5 violation (attempted self-mint). The Legal agent flags the breach, the Arbiter issues a hard REJECT, and the console blocks execution.


πŸ’‘ The Problem & Solution

Current DAOs rely heavily on token holder attention, leading to voter apathy and unverified contract executions. Conclave instantiates a council of AI agents (Risk, Treasury, Legal) that reason over a proposal grounded in Casper account state, then an Arbiter reconciles them into a verdict for a human veto β€” and only then does the approved transfer execute on Testnet.

Key Features:

  • ⚑ Real multi-agent council: with ANTHROPIC_API_KEY set, three role agents run on Claude Haiku 4.5 and the Arbiter on Claude Opus 4.8 (Anthropic SDK, structured outputs) β€” src/agents/llm.ts. Each agent only cites numbers from the grounded read layer; it can't invent balances.
  • πŸ›‘οΈ Deterministic guardrail: every LLM verdict is checked against a pure reconcile() baseline (src/core/quorum.ts); the approved amount is computed from the verdict and clamped, and a charter Β§5 violation (self-mint / privilege escalation) is a hard, non-overridable REJECT.
  • πŸ§ͺ What-If Console (the live demo): compose any proposal (target, entrypoint, amount) and watch the council reason it to APPROVE / CAP / REJECT over your input β€” not a canned script (/api/whatif β†’ src/core/whatif.ts).
  • 🎚️ Graceful fallback: with no API key, the council degrades to a deterministic engine, so the full deliberate β†’ veto β†’ execute pipeline always runs (great for keyless judges).
  • πŸ”’ Human-in-the-Loop Veto: the approved transfer is signed with casper-js-sdk (backend PEM key) only after the veto window closes.

πŸ—οΈ Architecture & Tech Stack

Layer Technology
Frontend Next.js 16, React 19, Tailwind CSS v4
Testing Vitest (152 unit tests), Playwright E2E
Contract Odra (Rust) on Casper Testnet
AI Council Claude Opus 4.8 (Arbiter) + Claude Haiku 4.5 (Role Agents) via the Anthropic SDK β€” falls back to a deterministic engine with no key
Grounded reads Demo: deterministic fixtures Β· Live (CONCLAVE_DEMO=false): CSPR.cloud REST
Signing casper-js-sdk (backend PEM key) for autonomous execution Β· CSPR.click for the frontend veto panel

System Data Flow

flowchart TD
    U[DAO member] -->|submit proposal| FE[Next.js UI]
    FE --> ORC["Agent Orchestrator (TS worker)"]
    subgraph Council
      RA[Risk Agent]
      TA[Treasury Agent]
      LA[Legal/Charter Agent]
      AR[Arbiter]
    end
    ORC --> RA & TA & LA
    RA & TA & LA --> AR
    RA & TA & LA -->|read state| MCP[Casper MCP Server]
    TA -->|history| CLOUD[CSPR.cloud APIs]
    MCP --> TN[(Casper Testnet)]
    AR -->|verdict + quorum| MS[Approval Consensus off-chain]
    MS --> VW{Human Veto Window}
    VW -->|not vetoed| EX[Executor casper-js-sdk]
    EX -->|TransactionV1 sign+send| GOV[Odra Governance Contract]
    GOV --> TN
    AR -->|transcript hash| GOV
    FE -->|deploy hash link| EXP[cspr.live explorer]
Loading

πŸ” Deep Dive: For a full architectural breakdown, including specific API endpoints, council agent roles, and governance smart contract details, see the detailed System Architecture Design Document.

πŸ† Sponsor Tracks Targeted & Code References

  • Casper Innovation Track (Build Direction #3: Multi-Agent DAO Governance)
    • Multi-agent AI council: Real Anthropic SDK calls β€” 3 role agents (Haiku 4.5) + an Arbiter (Opus 4.8) with structured outputs, in llm.ts, guard-railed by the deterministic quorum.ts.
    • Casper Testnet Smart Contract: Built with the Odra framework in Rust, located in conclave.rs. Enforces quorum rules, recorded verdicts, and a threshold-guarded, capped treasury transfer on-chain.
    • Grounded reads: Account/contract state for the agents β€” deterministic fixtures in demo, live CSPR.cloud REST in live mode β€” in mcp.ts.
    • Autonomous signing: Backend casper-js-sdk (PEM key) builds, signs, and broadcasts the execute transaction in casper.ts β€” no browser wallet required.

πŸš€ Getting Started

Prerequisites

  • Node.js β‰₯ 20
  • pnpmΒ 

InstallationΒ Β Β Β Β 

  1. Clone: git clone https://github.com/edycutjong/conclave.git
  2. Change directory: cd conclave
  3. Install: pnpm install
  4. Configure: cp .env.example .env.local and add your keys (CSPR.cloud API key, Anthropic key, Testnet keypair)Β Β Β 
  5. Run: pnpm dev

Model Context Protocol (MCP) Setup

Conclave leverages the Model Context Protocol to ground its AI council agents in live Casper blockchain state.

  1. Demo Mode (Default): No additional setup is required. The MCP client uses the mock grounding layer (fixtures) to verify contract and balance state.
  2. Live Testnet Mode: Set CONCLAVE_DEMO=false and provide your CSPR_CLOUD_API_KEY in .env.local to query live network parameters.
  3. Casper MCP Server (Docker): To run the official msanlisavas/casper-mcp server locally:
    # Run the Casper MCP server Docker container
    docker pull msanlisavas/casper-mcp:latest
    docker run -d -p 8080:8080 -e CSPR_CLOUD_API_KEY="your_cspr_cloud_api_key" msanlisavas/casper-mcp:latest
    Add the following line to your .env.local:
    CASPER_MCP_URL=http://localhost:8080

πŸ’‘ Note for Judges β€” what's real vs. simulated (no overclaiming):Β Β Β Β 

  • The AI is real. Set ANTHROPIC_API_KEY and the council makes genuine Claude calls (Opus 4.8 Arbiter + 3 Haiku 4.5 role agents). With no key, it falls back to a deterministic engine so the pipeline still runs end-to-end β€” the What-If console (/api/whatif) reasons over any proposal you type either way.
  • On-chain execution is gated. By default (CONCLAVE_DEMO=true) the execute step returns a clearly-labelled simulated hash β€” the UI shows an amber "simulated Β· not broadcast" badge and no explorer link (we don't fake a cspr.live link). Setting CONCLAVE_DEMO=false with a funded key + a deployed CONCLAVE_CONTRACT_HASH broadcasts a real Testnet transaction and links the live cspr.live deploy. See LIVE_TESTNET.md.

⛓️ Live Testnet Deployment

Live on Casper Testnet (casper-test). The Odra governance contract is deployed and the install is a confirmed, transaction-producing on-chain event:

Item Value
Contract package hash-0b7fcb9879f8a6fd5dd07f104bf5e74ace7c1a9b3c375c902fbf0bc044248e79 β†—
Install deploy 03c6b2145f06a1357ef63112f11862020ff916614a9c8bf5e584cc236bbbd6f6 β†—
submit_proposal 6cc8d49d36d6c4ad3d030dfd1b6abecd5c3c3d39baa7c6bb2abd47a2e8593232 β†—
record_verdict e7b6f26caeeabf43fbe174ed68c2bdb49a982753385bc6abcf006e0597c699c4 β†—
approve b45648e9c142f4b16ba079f3c72c0319e4e0ab43853f9706f02819d42a92ef1b β†—
Machine-readable record deployments/testnet.json

The AI council's governance decisions are recorded on-chain: a proposal is submitted, the verdict recorded, and approved β€” all real Testnet transactions. Reproduce with pnpm deploy:rpc (install) + pnpm lifecycle (governance) β€” see LIVE_TESTNET.md.

Originality: all code is original and newly developed for the Casper Agentic Buildathon 2026; shared @vouch/* packages are authored for this submission.

πŸ“– Documentation & Design Resources

The following design documents and resources are available in this repository:

  • πŸ—οΈ System Architecture: Full data flow diagrams (Mermaid), API specifications, and math/cryptographic models.
  • 🎬 Interactive Demo Guide: Step-by-step walkthrough of the live demo console and expected system behaviors.
  • πŸ›‘οΈ Sponsor Track Defense: Justification of track eligibility, including Casper Network and x402 integration references.
  • πŸ“‹ Product Requirements Document (PRD): Initial project scope, problem statement, user personas, and product requirements.
  • πŸš€ Live Testnet Wiring Runbook: Detailed guide to flipping the application from demo mode to Casper Testnet execution.

πŸ§ͺ Testing & CI

6-stage pipeline: Quality β†’ Security β†’ Build β†’ E2E β†’ Performance β†’ Deploy

# ── Code Quality ────────────────────────────
pnpm run lint          # ESLint
pnpm run typecheck     # TypeScript check
pnpm run test          # Run Vitest tests
pnpm run test:coverage # Coverage report
pnpm run ci            # Full quality gate

# ── Advanced Testing ────────────────────────
pnpm run e2e           # Playwright E2E tests
pnpm run e2e:ui        # Playwright interactive mode
pnpm run lighthouse    # Lighthouse CI audit

# ── Security ────────────────────────────────
make security-scan     # pnpm audit + license check
Layer Tool Status
Code Quality ESLint + TypeScript βœ…
Unit Testing Vitest (152 tests) βœ…
E2E Testing Playwright (3 suites) βœ…
Security (SAST) CodeQL βœ…
Security (SCA) Dependabot + pnpm audit βœ…
Secret Scanning TruffleHog βœ…

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.

About

πŸ—³οΈ Agentic governance that reads the contract before it signs

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors