Skip to content

edycutjong/litmus

Repository files navigation

Litmus Logo

Litmus πŸ§ͺ

Output-grading quality gate agent β€” grades any deliverable 0-100 with a rubric, on-chain

Litmus

Live on CROO Agent Store Live Pitch Page DoraHacks BUIDL


TypeScript Node.js Release CI


πŸ“Έ See it in Action

Litmus Demo

The Quality Gate Workflow. Deliverable Received β†’ Litmus Applies Grading Rubric β†’ Score (0-100) Calculated β†’ Feedback & On-Chain Grade Delivered.


πŸ’‘ The Problem & Solution

In an autonomous agent economy, output quality varies wildly. How do you trust an agent's work without manual human review? Litmus is an AI Quality Gate Agent. It acts as an automated, impartial grader that evaluates deliverables against strict, predefined rubrics. If an agent submits subpar code, writing, or analysis, Litmus rejects it, ensuring only high-quality work passes the gate.

Key Features:

  • βš–οΈ Objective Grading: Evaluates work across multiple rubric categories, assigning a deterministic score from 0-100.
  • 🚧 Quality Gatekeeper: Automatically rejects work that falls below the acceptable threshold.
  • ⛓️ On-Chain Attestation: Cryptographically signs the grade to ensure the evaluation is immutable and verifiable.
  • πŸ”„ Active State Recovery: Resumes and finishes pending grading jobs on container restart.
  • ❌ Active Rejections: Rejects mismatched rubrics or negotiation criteria immediately, ensuring requester agents do not hang waiting.
  • πŸ’Ό Dynamic Payouts: Support for direct address routing to forward grading fees.

🌌 The Constellation β€” On-Chain A2A Graph

Litmus is the constellation's quality oracle: other agents pay it on-chain to grade a deliverable 0–100 against a rubric. A two-model "tribunal" (with a tiebreaker) keeps scoring stable (Οƒ < 4). Verifiable, paid, impartial grading-as-a-service is a primitive a normal API marketplace can't offer.

graph LR
    User([Any Agent / User]) -->|hires to grade| L[Litmus πŸ§ͺ]
    M[Maestro 🎼] -->|grade + re-grade in its reflection loop| L
    G[Gauntlet 🧀] -.->|certifies| L
    classDef hot fill:#F59E0B,stroke:#111,color:#111,font-weight:bold;
    class L hot;
Loading
  • Depth: Maestro hires Litmus twice per pipeline β€” once to grade, once to re-grade the self-corrected draft β€” making it a high-traffic A2A node.
  • Anti-gaming: rubric weights are validated and Format/Clarity is capped at 15% so agents can't farm a passing grade on style alone.

πŸ”— Live Run Log β€” On-Chain Proof (Base Mainnet)

Real CAP grading orders Litmus fulfilled as a provider.

Total real CAP orders: 2 Β· last updated: 2026-07-07 Β· two-model tribunal scoring; each cell is [pay tx] Β· [deliver tx] on Base Mainnet.

# Date Counterparty (requester) USDC Order ID Tx (BaseScan) Score
1 2026-07-07 Maestro (grade) 0.05 9da4458a pay Β· deliver 69/100 (V1 75 Β· V2 62)
2 2026-07-07 Maestro (fallback grade) 0.05 3f72221e pay Β· deliver 76/100

πŸ—οΈ Architecture & Tech Stack

Layer Technology
Runtime Node.js (TypeScript)
Ecosystem Constellation A2A (croo-core)
Testing Vitest

🧩 CROO SDK Methods Used

Litmus builds on the shared @edycutjong/croo-core SDK. The methods it actually calls:

Method Source Role in Litmus
makeClient(sdkKey) croo-core Instantiates the shared CROO AgentClient (Base Mainnet config) from the SDK key.
runProvider(...) croo-core Runs Litmus as an on-chain provider β€” subscribes to order/negotiation events and fulfils incoming hires.
isMockMode() croo-core Branches between offline mock mode and live on-chain execution.
client.getNegotiation(id) @croo-network/sdk Reads negotiation/order state during a hire.
client.getDownloadURL(...) @croo-network/sdk Resolves the deliverable's download URL.

πŸ“ž Hire Litmus (A2A)

Any agent can hire Litmus on-chain through croo-core's hire() primitive β€” it's live on the CROO Agent Store.

import { makeClient, hire } from '@edycutjong/croo-core';

const client = makeClient(process.env.CROO_SDK_KEY!);

const { delivery } = await hire(client, {
  serviceId: '516e6fd0-7270-47f1-b431-3d4596b848a2', // Litmus on the CROO Agent Store
  requirement: {
    deliverable: 'The text/output you want graded…',
    rubric: [
      { criterion: 'accuracy', weight: 0.5 },
      { criterion: 'completeness', weight: 0.5 },
    ],
  },
  maxPrice: 1.0,
});

delivery β†’ { score /* 0–100 */, rubric: RubricScore[], gaps, confidence }

πŸš€ Getting Started

Prerequisites

  • Node.js β‰₯ 20
  • npm

Installation

  1. Clone: git clone https://github.com/edycutjong/litmus.git
  2. Enter the directory: cd litmus
  3. Install: npm install
  4. Configure: cp .env.example .env.local and fill in your service ID + an LLM key (skip for mock mode)

▢️ Run it now β€” offline mock mode (no wallet, no USDC)

npm install
CROO_MOCK=true npm run dev   # boots the grader provider with no on-chain calls

Grading works with no API key (deterministic mock grade); set OPENAI_API_KEY and/or ANTHROPIC_API_KEY to enable the live LLM tribunal. Run npm run stability to reproduce the Οƒ < 4 scoring-variance harness.

πŸ§ͺ Testing & CI

4-stage pipeline: Quality β†’ Security β†’ Build β†’ Deploy Gate

# ── Code Quality ────────────────────────────
make lint          # ESLint
make typecheck     # TypeScript check
make test          # Run tests
make test-coverage # Coverage report
make ci            # Full quality gate

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

πŸ“ Project Structure

litmus/
β”œβ”€β”€ docs/              # README assets (hero, screenshots)
β”œβ”€β”€ src/               # Application source code
β”œβ”€β”€ scripts/           # Build and run scripts
β”œβ”€β”€ __tests__/         # Vitest test suites
β”œβ”€β”€ .github/           # CI workflows
└── README.md          # You are here

🚒 Deploy

Containerized for any PaaS. Litmus is a background worker (connects out to the CROO WebSocket β€” no inbound port):

docker build -t litmus .
docker run --env-file .env.local litmus

πŸ“„ License

MIT Β© 2026 Edy Cu

πŸ™ Acknowledgments

Built for the DoraHacks CROO Hackathon 2026.

About

πŸ§ͺ Output-grading quality-gate agent β€” grades any deliverable 0–100 against a rubric, on-chain (CROO Constellation)

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors