krusch-grounded-harness
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Krusch Grounded Harness (krusch-grounded-harness v0.2.0)
Standalone Turn-0 workspace grounder, duplicate-call spin-loop blocker, and zero-turn defect-only output gate for AI coding and data agents. Runs 100% locally on Node 22 node:sqlite (7 MCP tools + HTTP :3782 gateway + ESM library) with zero cloud calls.
Turn-0 Grounded, Scale-Aware, Low-Tool-Call Agent Harness (HTTP :3782 Control Gateway + 7-tool stdio MCP Server + Node 22 ESM library) built on @krusch/toolkit (v1.8.1).
⚡ 30-Second Standalone Quickstart (Zero Cloud, Zero Docker)
1. Clone, Test & Ground Any Workspace Locally
Requires only Node.js >= 22.0.0 (uses built-in node:sqlite in WAL mode with zero Docker containers, zero native C++ compilation, and zero API keys):
git clone https://github.com/kruschdev/grounded-harness.git
cd grounded-harness
npm ci
npm test
# Verify SQLite WAL engine, 7 annotated MCP tools, and v0.2.0 invariants
node bin/krusch-grounded-harness.js doctor
# Compile Turn-0 workspace schemas, dataset hazard flags & Raw-RAG chunks (0 LLM calls)
node bin/krusch-grounded-harness.js ground --dir . --goal "Inspect workspace schemas and hazards"2. Connect to Your Agent (.mcp.json / Cursor) or Run via krusch-stack
Paste into your project .mcp.json, Cursor (~/.cursor/mcp.json), Windsurf (~/.codeium/windsurf/mcp_config.json), or Antigravity (~/.gemini/antigravity/mcp_config.json):
{
"mcpServers": {
"krusch-grounded-harness": {
"command": "node",
"args": ["/absolute/path/to/grounded-harness/bin/krusch-grounded-harness.js", "mcp"]
}
}
}Prefer a zero-clone npx command or single-package ESM import? Run the bundled engine directly through krusch-stack:
# Start the 7-tool stdio MCP server without cloning a separate repo
npx -y krusch-stack mcp --server krusch-grounded-harness// Embed via krusch-stack (zero external runtime dependencies) or standalone package
import { createGroundedHarnessEngine } from 'krusch-stack/grounded-harness';
// Standalone repo import: import { createGroundedHarness } from 'krusch-grounded-harness';Related MCP server: genpark-jev-system1-subconscious-decision-skill
🩹 Before vs. After (What It Fixes)
Common Agent Failure Mode | Without | With |
Blind file foraging & CSV | Wastes |
|
Identical failing or redundant tool-call spin loops | Re-runs the same broken query or file read with tweaked comments/whitespace, burning context and API budget. |
|
Raw | Leaks raw |
|
🧩 Ecosystem Fit (Use Standalone or Combined)
krusch-grounded-harness has zero runtime service dependencies and works standalone out of the box, or pairs cleanly with sibling tools when you want deeper state guarantees:
krusch-context-mcp(Persistent Working Memory): Pair Turn-0 workspace grounding with cross-session episodic memory, decision lineage, and pre-commit invariant nudges (5MCP tools onnode:sqlite).krusch-coding-harness(2PC Staged File Diffs): Add content-addressed diff staging, Bubblewrap sandbox verification, andSIGKILL-recoverable write-ahead disk apply for unattended background daemons.krusch-stack(Unified One-Command Bundle): Run Turn-0 grounding alongside memory, Git/AST symbol graphs, and staged execution vianpx -y krusch-stack init(supports--server krusch-grounded-harness,--components grounded-harness, and--profile coding-agent).
⚡ Overview & Six Empirical Design Laws (INV-GH-01..10)
Distilled from 16,800 Official DolphinBench traces (28 official 600-task multi-session tool runs across 6 model families: 17 $0.00 open-weights + 11 frontier/model-matched runs, 98.33% Oracle@28, 83.17% $0.00 Oracle@17), 120 DABstep multi-step analytics episodes, BEAM (100K–10M tokens), and BFCL v3 (64 live tools), krusch-grounded-harness replaces unconditional outer-loop 2PC stop-nudging with six zero-overhead-when-healthy structural laws:
Turn-0 Schema +
Raw-RAGBriefing with Dataset Hazard Flags (INV-GH-01,INV-GH-02)compileTurnZeroGroundingintrospects RFC-4180 CSV/TSV columns, JSON/JSONL object arrays, read-only SQLite DDL & row counts, code symbols, and256/32-tokenRaw-RAGdocumentation chunks with0LLM ingestion calls, paired with Okapi BM25 tool deferral (-70%to-80%schema tokens) and SHA-256prefixHashKV-cache normalization.Explicitly flags CSV
"NA"string literals (keep_default_na=Falseinpandas.read_csv) and JSONnullvs. empty-list[]wildcards before Step 1 (skipping.env/ secret files automatically).
Gemini Tool-Less
functionCallingConfig: { mode: "NONE" }Guard (INV-GH-09)buildSafeGeminiToolConfig(andbuildGeminiPayloadin@krusch/toolkit/llm) automatically injectstoolConfig: { functionCallingConfig: { mode: 'NONE' } }whenevertoolsis omitted or empty[], eliminatingMALFORMED_FUNCTION_CALLempty turns on markdown```pycode blocks.
Zero-Turn Defect-Only Output Gate (
inspectOutputDefects,INV-GH-05)Approves clean completions in
0extra turns while blocking objective output defects (maxDefectRetries = 1):EMPTY_OR_NULL_BAILOUT: literal"",None,null,NaN,[],{}when an answer is expected (never blocking"0",0,false,"Not Applicable", or"N/A").TRUNCATED_OUTPUT:finishReasoninMAX_TOKENS/length/MALFORMED_FUNCTION_CALLor truncated tool JSON.SERIALIZED_TOOL_CALL_IN_TEXT: raw<tool_call>{...}</tool_call>orcall:fn{...}emitted in prose whentoolCalls.length === 0.RAW_DATAFRAME_OR_NUMPY_REPR: unformattednp.float64(...)or pandasdtype:repr leaks in final answers.
Quote-Safe Comment-Normalized Call Hashing (
BLOCK_SPIN_LOOP) &maxReadStreak = 0(INV-GH-04)normalizeCodeSnippetForHashstrips comments outside string literals (preserving Python//floor division and indentation) prior to SHA-256 hashing. First repeats ofCOMMITTEDreads returnMEMOIZED_PRIOR_READwith cached preview; repeat identicalFAILEDcalls or repeats afterMEMOIZED_PRIOR_READreturnBLOCK_SPIN_LOOPwith0tool re-executions. Distinct multi-step reads (1..N) are never throttled (maxReadStreak === 0).
Scale-Aware Thinking Curve & Staged-Diff-Only
FORCE_VERIFY(INV-GH-03,INV-GH-05)SMALL_MODEL(< 15Bnon-thinking) receives compact[PLAN -> BIND -> ACT]guidance plus placeholder ({{var}}) and invalid-calendar-date soft-holds (HOLD);MID_MODEL(15B–70B) andFRONTIER_REASONING(>= 70Bor native thinking) execute with0outer thinking overhead.FORCE_VERIFYfires strictly whenpendingDiffsCount > 0 && !latestVerificationPassed, never on read-only analytics or policy abstentions.
Partial
stdoutPreservation on Sandbox Timeouts (INV-GH-10)execCommandWithPartialStdoutandformatTimeoutWithPartialStdoutpreserve partialstdoutemitted prior to timeout alongsideTimeoutErrorwhile clearing stalefinalAnswer: null(hasFinalAnswer: false).
📊 Empirical Benchmark Results (4,200 Grounded / 16,800 Total Official DolphinBench Traces & 120 Adyen DABstep Episodes)
1. Official DolphinBench Multi-App Suite (7 × 600 = 4,200 Grounded Traces Within 28 Runs / 16,800 openai/gpt-5.6-sol Traces, 0o444 Frozen SQLite, 5/5 Clean-Room Gates)
Model & Scale Tier ( | Standard Harness |
| Key Latency, Persona & Telemetry Outcomes | Archive SHA-256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ensemble Sufficiency Oracles &
4/4Open-Weights Adapter Lifts (28Runs /16,800Traces Across6Families:8Uploaded & Queued ondolphinbench.ai+20Clean-Room Controls =28/28Validated): Over byte-identical0o444frozen$0.00SovereignMemoryStoreSQLite checkpoints,Oracle@28 = 98.33%(590/600:Morgan 196,Alex 199,Riley 195),Argon Oracle@4 = 96.83%(581/600),$0.00Open-WeightsOracle@17 = 83.17%(499/600,+12.50 pp> published70.67%Mem0entry), andGemma 4 Oracle@6 = 71.83%(431/600,+1.16 pp> published70.67%Mem0entry at$0.00), with4/4DolphinBench lifts acrosskrush420/gemma4-31b-sre-lora(57.33%[344/600] @$0.00, highest open-weights score in self-run 28-run evaluation;54.17%[325/600] stock submissionUUID 288671aduploaded & queued ondolphinbench.ai),krush420/qwen3-coder-30b-sre-lora(43.00%Wave-4 + Grounded /42.67%Wave-4 Std.),krush420/gpt-oss-120b-sre-lora(39.50%), andkrush420/llama3-hermes3-8b-sre-lora(18.33%,15.7xlift).Cross-Suite Public Ledger & 3-Category Verification Taxonomy: Evaluated across 335,000+ traces and 14 external benchmark suites, with published SHA-256 audit logs and reproducible evaluation artifacts, separating (1) Maintainer-Reviewed & Merged Upstream (
github-actions[bot]CI-Verified) includingRouteWorks/RouterArenaPR #169 (merged by@yl231intomain @ 844e93b;0.7263CI score across8,400/8,400live receipts, leaderboard table row queued for next batch ranking refresh), (2) Uploaded & Queueddolphinbench.aiSubmissions (status: "queued"awaiting leaderboard acceptance, led by91.17%[547/600@$24.54,UUID c047b063] and54.17%[325/600@$0.00,UUID 288671ad]), and (3) Independently Reproducible Clean-Room Evaluations (95/95SHA-256 clean-room gates,49SHA-256-pinned Hugging Face audit logs across64files /40dolphinbench_600rows inkrush420/sovereign-g4-benchmarks, including90.67%[544/600@$30.54,Argon Low + Grounded v0.3, highestRileyslice181/200 = 90.50%],adyen/DABstep90.0%, & Official SnapLoCoMo90.26%acc /95.77%dia_idrecall @$0.00ingest), powered by@krusch/toolkitv1.8.1&krusch_toolkitv1.6.0(40runtime Lego bricks,65+.d.tssubpaths,179/179Node &201/201pytesttests,7blueprints,16<1msSlop-Breaker detectors,104/104[100%] zero-boilerplate compliance).
2. Adyen DABstep Multi-Step Data Analytics (120 Episodes Across 4 Models, 0 LLM Judges, 42/42 Upstream scorer.py Parity)
gemini-4-argon(medium): Reaches90.0%(9/10:100%Easy,85.7%Hard) @$0.81(5.1turns) and delivers-74.5%lower cost with a2.54xwall-clock speedup (75.5svs.191.5sungrounded) by flagging CSV"NA"string literals (keep_default_na=False) and JSONnull/[]wildcards at Turn 0.Open-Weights (
$0.00Inference): Liftsgemma4:31bfrom20.0%$\rightarrow$40.0%(+20.0 pp) andqwen3-coder-30b-moefrom20.0%$\rightarrow$30.0%(+10.0 pp,6.8 -> 2.4steps,-44.4%prompt tokens) with0LLM ingestion calls.
🛠️ Tech Stack & Package Exports
Runtime: Node.js
>= 22.0.0(ESM, nativenode:sqliteWAL via@krusch/toolkit/sqlite, zero native C++ build steps required).Bricks Used:
@krusch/toolkit/http,@krusch/toolkit/mcp,@krusch/toolkit/sqlite,@krusch/toolkit/harness-engineering,@krusch/toolkit/raw-rag,@krusch/toolkit/cli,@krusch/toolkit/config,@krusch/toolkit/log.
Subpath Import | Core Exports |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
🚀 Setup & CLI Commands
Agent-Assisted Setup
Ask your coding agent (Claude Code, Codex, Cursor, Windsurf, or Antigravity):
Read https://raw.githubusercontent.com/kruschdev/grounded-harness/main/INSTALL.md and set up grounded-harness on this machine.# Install dependencies and run full invariant + smoke test suites (15/15 passing)
npm install
npm test
# Verify SQLite WAL engine, 7-tool 4-boolean MCP annotations, and v0.2.0 invariants
node bin/krusch-grounded-harness.js doctor
# Inspect monotonic scale profile for any model
node bin/krusch-grounded-harness.js scale --model qwen2.5-coder:7b
node bin/krusch-grounded-harness.js scale --model gemma4:31b
node bin/krusch-grounded-harness.js scale --model gemini-4-argon
# Compile Turn-0 workspace schemas & zero-LLM Raw-RAG chunks (--json supported)
node bin/krusch-grounded-harness.js ground --dir . --goal "Inspect session engine invariants" --max-tokens 3200
# Run deterministic 3-tier Grounded vs. Un-Grounded vs. Legacy-2PC benchmark
node bin/krusch-grounded-harness.js bench
# Start 7-tool stdio MCP server or HTTP :3782 Control Gateway
node bin/krusch-grounded-harness.js mcp
node bin/krusch-grounded-harness.js serve --port 3782Docker Compose Deployment
cp .env.example .env
# Set DATA_DIR in .env to a dedicated non-OS storage volume
docker compose up -d --build
curl -s http://127.0.0.1:3782/health🔌 Stdio MCP Server (7 Tools, INV-STACK-03 Annotated)
Tool Name |
|
|
|
| Purpose |
|
|
|
|
| Introspect CSV/TSV, JSON/JSONL, read-only SQLite DDL, code symbols, and |
|
|
|
|
| Resolve |
|
|
|
|
| Start or reset a SQLite-tracked session seeded with |
|
|
|
|
| Check proposed tool calls against frozen policy floor, secret-leak guard, duplicate-write guard, Turn-0 digest cache, read memoization, and |
|
|
|
|
| Record tool outcome ( |
|
|
|
|
| Zero-turn-when-healthy stop gate enforcing staged-diff |
|
|
|
|
| Return session metrics ( |
🌐 HTTP Control Gateway (:3782)
All routes return deterministic JSON envelopes { ok: boolean, tool: string, summary: string, data: object } (or { ok: false, error: { code, message } }; no auth required on loopback 127.0.0.1:3782):
Method & Path | Status | Request Body / Query | Response |
|
| None | Service status, version |
|
| None |
|
|
|
|
|
|
|
|
|
|
| Same as |
|
|
|
| Created |
|
|
| Truncation poisoning check ( |
|
|
|
|
|
|
| Updated event status and preserved timeout stdout metadata. |
|
|
|
|
|
|
|
|
⚙️ Environment Variables (.env.example)
Variable | Required | Default | Description |
| Optional |
| TCP port for the HTTP Control Gateway. |
| Optional |
| Service identifier emitted in |
| Optional |
| Host/Docker volume directory for persistent runtime state (point to a non-OS disk in production). |
| Optional |
| SQLite WAL database file path ( |
| Optional |
| Directory for rotating structured JSON logs. |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Pre-execution governance for AI agents. Deterministic PASS/FAIL/REVIEW verdicts, replayable proof.
Enforces architectural invariants and code quality rules inside your AI agent's edit loop.
Deterministic runtime safety for AI agents: scan PII, gate tool actions, verify LLM output.
Cuts coding agent token burn up to 72% continuously via contradiction-free memory & verification.
Related MCP Servers
- AlicenseAqualityBmaintenanceZero-dependency token optimizer, test-failure triage gate, and System 1.5 semantic guardrail for AI coding agents. Intercepts compiler errors, missing dependencies, and doom loops in < 500µs.612MIT

genpark-jev-system1official
AlicenseNot gradedqualityBmaintenanceEnables AI agents to resolve typed routing, loop-stall arbitration, and tool safety checks locally at sub-millisecond latency, avoiding unnecessary frontier LLM calls. It enforces reversible execution checkpoints, token budgets, and decayed episodic memory for safe, privacy-first autonomous operation.7MIT- AlicenseNot gradedqualityNot gradedmaintenanceEnables agents to resolve routine typed routing, loop-stall arbitration, and tool safety checks locally instead of invoking a frontier LLM, returning schema-enforced decision outputs and telemetry at sub-millisecond latency. Also provides reversible execution checkpoints, token budgets, and decay-based episodic memory for safe, privacy-preserving autonomous operation.MIT
- AlicenseAqualityCmaintenanceEnables parallel AI coding agents to claim files atomically, detect and prevent workspace collisions, and receive deterministic zero-latency safety verdicts on destructive shell commands without any network egress. It also provides autonomous wave dispatch, worker recovery, and completion verification for multi-agent workflows via a shared coordination board.7MIT