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

Built for CROO Hackathon


TypeScript Node.js 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: 0 Β· last updated: 2026-06-_

# Date Counterparty (requester) Amount (USDC) Order ID Tx (BaseScan) Score
1 2026-06-_ Maestro / external 0.00 _ord_…_ 0x… N/100

Order IDs + pay tx are in the provider logs and the CROO dashboard. Delete this note once populated.

πŸ—οΈ Architecture & Tech Stack

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

πŸš€ Getting Started

Prerequisites

  • Node.js β‰₯ 20
  • npm

Installation

  1. Clone: git clone https://github.com/edycutjong/litmus.git
  2. Install: npm install
  3. 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

dorahacks-croo-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 with a rubric, on-chain

Topics

Resources

License

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors