Krusch Grounded Harness
v0.2.2Turn-0 workspace grounding, spin-loop blocker, and defect-only stop gate for AI coding agents.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
krusch_ground_workspace
Introspect local workspace schemas (CSV/TSV, JSON/JSONL, read-only SQLite DDL, source symbols, and 256/32 Raw-RAG docs) with 0 LLM calls, apply BM25 tool deferral, and emit a KV-cache-stable prompt bundle.
| Parameter | Type | Description |
|---|---|---|
activeParamsB | number | Optional active parameter count in billions. |
deferThreshold | integer | Tool count threshold triggering BM25 deferral. |
goal | string | Task goal used to retrieve relevant doc chunks. |
maxGroundingTokens | integer | Maximum Turn-0 grounding token budget. |
model | string | Target model identifier for scale-aware directive. |
pinnedToolNames | array | Core tools kept eagerly exposed. |
standingInvariants | array | Standing rules/invariants included in the static cache prefix. |
thinkingEnabled | boolean | Whether native reasoning/thinking is enabled. |
tools | array | Full tool registry definitions to gate via BM25 deferral. |
totalParamsB | number | Optional total parameter count in billions. |
workspaceDir | string | Directory path to introspect. |
krusch_resolve_scale_profile
Deterministically map a model identifier and parameter/thinking hints into SMALL_MODEL, MID_MODEL, or FRONTIER_REASONING harness policy.
| Parameter | Type | Description |
|---|---|---|
activeParamsB | number | Optional active parameter count in billions. |
explicitTier | string | Optional explicit tier override. |
model | string | Model identifier (e.g., qwen2.5-coder:7b, gemma4:31b, gemini-4-argon). |
preferThinkingStepForSmallActive | boolean | Opt small-active MoE models into the compact PLAN->BIND->ACT directive. |
reasoningEffort | string | Optional reasoning effort hint. |
thinkingEnabled | boolean | Whether native thinking mode is active. |
thinkingLevel | string | Optional thinking level hint. |
totalParamsB | number | Optional total parameter count in billions. |
krusch_grounded_session_start
Create or reset a SQLite-tracked grounded session seeded with Turn-0 chunk IDs, file digests, scale profile, and schema token savings.
| Parameter | Type | Description |
|---|---|---|
goal * | string | User or task goal. |
activeParamsB | number | |
all_tools | array | |
allowed_scopes | array | |
anchor_date | string | Optional ISO anchor date (YYYY-MM-DD). |
exposed_tools | array | |
file_digests | object | |
max_bulk_limit | integer | |
max_duplicate_writes | integer | |
max_stalled_mutations | integer | Consecutive zero-progress verified edit cycles before STALLED_MUTATION_LOOP hold (default 3). |
model | string | Target model identifier. |
prefix_hash | string | Optional 64-char Turn-0 prompt cache prefix hash. |
seen_chunk_ids | array | |
session_id | string | Optional explicit session identifier. |
thinkingEnabled | boolean | |
totalParamsB | number | |
turn0_tokens | integer |
krusch_grounded_intercept
Check a proposed tool call against the frozen policy floor, secret-leak guard, duplicate-write guard, mutation-stall guard (INV-GH-13), read memoization cache (maxReadStreak=0), and small-model placeholder soft-holds.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Active grounded session ID. |
tool_name * | string | Invoked tool name. |
allow_stalled_mutation | boolean | Explicitly override STALLED_MUTATION_LOOP hold after human guidance (INV-GH-13). |
args | object | Tool call arguments. |
block_spin_loop | boolean | Passively block identical repeat calls via BLOCK_SPIN_LOOP. |
mutating | boolean | Optional explicit mutability override. |
step | integer | 0-based or 1-based agent turn index. |
suppress_turn0_reads | boolean | Short-circuit unchanged Turn-0 file reads. |
krusch_grounded_outcome
Commit or fail a pending intercepted tool call, memoizing read previews, preserving partial stdout on timeouts, tracking passed test cases (INV-GH-13), and updating staged diff verification counters.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Active grounded session ID. |
call_signature | string | Fallback 64-char call signature. |
event_id | string | Event ID returned by krusch_grounded_intercept. |
mutated_paths | array | Explicit session-mutated relative paths. |
ok | boolean | Whether the underlying tool succeeded. |
partial_stdout | string | Partial stdout captured prior to timeout. |
passed_cases | integer | Passing test/replay case count for INV-GH-13 progress tracking. |
pending_diffs_delta | integer | Change in unverified staged code/disk diffs. |
reground_file_digests | object | Refreshed baseline SHA-256 file digests after re-grounding. |
reset_mutation_stall | boolean | Reset stalled mutation streak after user clarification. |
result_preview | string | Bounded preview cached for read memoization. |
timed_out | boolean | Whether sandbox/subprocess execution timed out. |
total_cases | integer | Total test/replay case count for INV-GH-13 progress tracking. |
verification_passed | boolean | Whether automated verification passed. |
krusch_grounded_verify_stop
Approve zero-overhead completion when pendingDiffsCount=0 and output has 0 objective defects while blocking unverified code diffs, upstream source fingerprint drift (INV-GH-14), unexplained panics/stubs (INV-GH-15), empty/null/NaN bailouts, truncations, raw DataFrame/numpy reprs, and leaked <tool_call> tags.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Active grounded session ID. |
assistant_text | string | Final assistant response text. |
audited_files | array | Optional edited fallible modules audited for unexplained unwrap/panic!/process.exit/todo! (INV-GH-15). |
candidate_answer | Optional structured or scalar final answer value. | |
current_file_digests | object | Optional current file SHA-256 map checked against Turn-0 baseline digests (INV-GH-14). |
expect_non_empty_answer | boolean | Flag empty/null/NaN/[]/{} bailouts as output defects. |
finish_reason | string | Optional provider finish reason (e.g., STOP, MAX_TOKENS). |
latest_verification_passed | boolean | |
mutated_files_count | integer | |
pending_diffs_count | integer | |
tool_calls | array | |
verification_command | string | |
workspace_dir | string | Optional workspace directory used to verify upstream baseline SHA-256 digests (INV-GH-14). |
krusch_grounded_summary
Retrieve session metrics including exploratory foraging ratio, memoized reads, spin loops blocked, output defects caught, partial-stdout timeouts, Turn-0 suppressed duplicates, schema token savings, and ordered events.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Grounded session ID. |