Skip to content
Pizzylee001Public

About

Turn blocked agent outputs into verified DPO preference pairs on Reppo and SERV Reasoning

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

TraceMend

Turn blocked or flagged AI agent outputs into grounded, citation-verified DPO preference pairs using Reppo DataNet evidence pods and SERV Reasoning (Gpt 6 Luna).

Live App Demo Video SERV Hackathon

TypeScript CSS HTML5 JavaScript Next.js 16 React 19 Tailwind CSS v4 Zod 4 Vitest 4


Languages & Tech Stack

Layer Technologies Usage
Languages TypeScript 5.9, CSS, HTML5, JavaScript App Router pages, API route handlers, mineral paper stylesheets, design specimen, and build configs
Framework & UI Next.js 16.4, React 19.2, Tailwind CSS v4 Multi-route workbench (/mend, /datanets, /vault), server endpoints, and Canvas/SVG telemetry
Motion & Icons Motion 12, GSAP 3, Phosphor Icons Reduced-motion-aware panel choreography and hairline iconography
Validation & Tests Zod 4.1, Vitest 4.0, ESLint 9 Strict API schema validation, DPO compiler verification, and linting
Protocols Reppo DataNets & Eval API, SERV Reasoning (Gpt 6 Luna) Evidence pod retrieval, evaluation polling, and citation-grounded repair

What TraceMend Does

AI agents fail evaluation gates when claims cite outdated dates, unverified numbers, or missing sources. Raw evaluation APIs return a score and a critique, leaving the engineer to hunt for evidence, rewrite the draft, re-verify the lift, and format training data by hand.

TraceMend closes that loop across three linked routes:

  1. Mend Bench (/mend): Load a failed or flagged agent draft (answer, plan, trace, or artifact), run an instant SERV Pre-Screen (Gpt 6 Luna) or submit directly to live Reppo Evaluation Markets (eval.reppo.xyz), pin verifiable Reppo DataNet pods, generate a grounded repair via SERV Reasoning (serv_prompt_guard + serv_shadow_agent + static BRAID prompt caching + strict JSON schema), scrub clause-by-clause diffs with the Kintsugi Optical Seam comparator, re-audit score lift, and save the (rejected, chosen) pair.
  2. DataNet Evidence Registry (/datanets): Browse all 19 live Reppo public DataNets, filter by market name, token symbol, or CUID, inspect up-vote vs down-vote ratios and epoch emissions, review IPFS pod provenance, and pin records straight into /mend.
  3. DPO Preference Vault (/vault): Filter verified remediation runs (BLOCK -> AUTO-SHIP, REVIEW -> AUTO-SHIP, or your own saved runs), inspect compiled OpenAI/TRL-compatible DPO JSONL records, copy records to clipboard, or download .jsonl datasets and Markdown audit receipts.

Screenshots

Mend Bench (/mend)

TraceMend Mend Bench Desktop

Kintsugi Seam Diff Comparator & SERV BRAID Trace

Kintsugi Seam Diff and BRAID Trace

Reppo DataNet Evidence Registry (/datanets)

Reppo DataNet Evidence Registry

DPO Preference Pair Vault (/vault)

DPO Preference Pair Vault

Mobile Responsive View (375px with Reduced Motion)

TraceMend Mobile View


Architecture & Protocol Integration

1. Reppo DataNets & Evaluation Markets (src/lib/reppo.ts)

  • Public Subnets: GET https://reppo.ai/api/v1/public/subnets?page=1&limit=30 fetches active DataNets (19 live subnets) with automatic normalization and captured snapshot fallback if an upstream feed is unreachable.
  • Public Evidence Pods: GET https://reppo.ai/api/v1/public/pods?page=1&limit=80 retrieves recent pod records, sanitizes external links (http: / https: only), and applies server-side subnetId and search filtering.
  • Live Evaluation Submit & Poll: POST https://eval.reppo.xyz/api/v1/agents/eval-requests/submit and GET https://eval.reppo.xyz/api/v1/agents/eval-requests/{evalId} dispatch answer, plan, trace, or artifact payloads with bounded settlement windows (10 to 1440 minutes) and surface clear UI feedback on 402 (credit balance), 409 (active pending evaluation conflict), and PENDING settlement states.

2. SERV Reasoning (src/lib/serv.ts)

  • Model: Uses gpt-6-luna (Gpt 6 Luna in UI telemetry) at https://inference-api.openserv.ai/v1/chat/completions.
  • Static BRAID Prompt Graph: Keeps system prompts (TRACEMEND_SYSTEM_PROMPT and TRACEMEND_PRESCREEN_SYSTEM_PROMPT) byte-for-byte immutable so SERV Reasoning BRAID prompt caching warms across runs.
  • Built-in Guard & Verification Tools: Attaches serv_prompt_guard and serv_shadow_agent (max_iterations: 2) on repair requests alongside strict response_format: json_schema enforcement.
  • Server-Only Credentials: All calls to eval.reppo.xyz and inference-api.openserv.ai run inside Next.js Route Handlers (src/app/api/*). No API keys are exposed to the browser bundle.

3. DPO Preference Pair Persistence (src/lib/vault-store.ts, src/lib/client-vault.ts)

  • Writes validated runs to /tmp/tracemend-vault.json on the server (POST /api/vault) using atomic write-and-rename and merges them with the user's browser localStorage mirror (src/lib/schemas.ts mergeClientAndServerRuns) so saved runs persist even across serverless cold starts.
  • Ships two real captured Reppo baseline specimens (captured-specimen) pre-loaded so judges can test the entire repair, diff-scrub, and DPO export workflow without spending evaluation credits first.

Project Structure

tracemend/
├── src/
│   ├── app/
│   │   ├── icon.svg                 # Custom SVG favicon (optical reticle monogram)
│   │   ├── layout.tsx               # Outfit, Rubik, JetBrains Mono fonts + shell chrome
│   │   ├── page.tsx                 # Redirects / -> /mend
│   │   ├── mend/page.tsx            # Stage 01-04 remediation workbench
│   │   ├── datanets/page.tsx        # Reppo DataNet & pod provenance registry
│   │   ├── vault/page.tsx           # DPO JSONL compiler & audit receipts
│   │   └── api/
│   │       ├── datanets/route.ts    # Public Reppo DataNets proxy
│   │       ├── pods/route.ts        # Public Reppo pods filter proxy
│   │       ├── eval/route.ts        # Reppo eval dispatch & SERV Pre-Screen
│   │       ├── eval/[id]/route.ts   # Reppo eval polling endpoint
│   │       ├── mend/route.ts        # SERV Gpt 6 Luna grounded citation repair
│   │       └── vault/route.ts       # DPO Vault GET/POST/DELETE persistence
│   ├── components/
│   │   ├── optical-header.tsx       # Caliper navigation header + live status chips
│   │   ├── calibration-field.tsx    # Topographic phase-lock Canvas backdrop
│   │   ├── consensus-constellation.tsx # Orbital score dial + 4-axis SVG radar
│   │   ├── kintsugi-diff-scrub.tsx  # 0%-100% seam scrub, split proof & clause view
│   │   ├── braid-trace-inspector.tsx # BRAID node trace & token/USD telemetry
│   │   ├── protocol-footer.tsx      # Ft8 protocol telemetry strip with pause control
│   │   ├── mend-workbench.tsx
│   │   ├── datanets-workbench.tsx
│   │   └── vault-workbench.tsx
│   └── lib/
│       ├── schemas.ts               # Zod contracts, score/route helpers, DPO compiler
│       ├── specimens.ts             # Captured Reppo DataNet, pod & eval baselines
│       ├── reppo.ts                 # Reppo API normalizers & HTTP clients
│       ├── serv.ts                  # SERV Reasoning Gpt 6 Luna client & prompt builder
│       ├── vault-store.ts           # Server /tmp JSON store with atomic writes
│       └── client-vault.ts          # Browser localStorage mirror for pinned pods & runs
├── tests/unit/                      # Vitest unit tests (schemas, vault, API clients)
├── docs/screenshots/                # Real Playwright captures across desktop & mobile
├── DESIGN.md                        # Approved mineral rag paper visual specification
└── .env.example                     # Server-side environment template

Local Development Setup

Prerequisites

  • Node.js 20+ (verified on Node 24.22.2)
  • SERV_API_KEY from OpenServ
  • REPPO_API_KEY from Reppo

Install & Configure

git clone https://github.com/Pizzylee001/tracemend.git
cd tracemend
npm install
cp .env.example .env.local

Add your keys to .env.local (never commit .env.local):

SERV_API_KEY=serv_your_key_here
REPPO_API_KEY=rk_your_key_here
SERV_MODEL=gpt-6-luna

Run Locally & Verify

# Run unit tests (Vitest)
npm test

# Type-check & lint
npx tsc --noEmit
npm run lint

# Build production bundle
npm run build

# Start development server
npm run dev

Open http://localhost:3000 (automatically opens /mend).


Deploying to Vercel

  1. Import Pizzylee001/tracemend in the Vercel dashboard (Framework Preset: Next.js).
  2. Add these Environment Variables under Project Settings -> Environment Variables:
    • SERV_API_KEY (Server-side secret key)
    • REPPO_API_KEY (Server-side Reppo evaluation & DataNet key)
    • SERV_MODEL = gpt-6-luna (optional default)
  3. Deploy. Serverless API routes persist custom DPO runs in /tmp/tracemend-vault.json per warm instance while the browser mirrors saved pairs in localStorage for immediate continuity.

About

Turn blocked agent outputs into verified DPO preference pairs on Reppo and SERV Reasoning

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages