Skip to main content
Glama

Sor Ratchet

sor_ratchet

Run one ratchet iteration to execute oracle tests, compare scores to the previous best, commit improvements, reset regressions, and check stop conditions.

Instructions

Run one ratchet iteration: oracle -> compare -> git commit/reset -> check stops.

This is the core tool for the experiment loop. Call it after making changes to the mutation surface. It will:

  • Run the oracle tests

  • Compare the score to the previous best

  • Git commit if improved, git reset if not

  • Check all stopping conditions

Returns one of:

  • KEEP score={X} prev={Y}

  • DISCARD score={X} best={Y}

  • DISCARD FAIL

  • STOP:{reason} score={X} attempts={N} kept={K}

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "layer": "<layer>",
      "hypothesis": "<hypothesis>"
    },
    "name": "sor_ratchet"
  }
}

Input Schema

NameRequiredDescriptionDefault
layerYes
hypothesisYes
project_dirNo.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations at all, the description carries the full burden and does reasonably well: it discloses that the tool mutates git state (commit on improvement, reset otherwise) and evaluates stopping conditions, which an agent cannot infer from the schema. It never clarifies the blast radius of the git reset (uncommitted working-tree changes?) or what happens if the oracle itself errors.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the one-line summary, then a scannable bullet list of steps and a compact enumeration of return strings. Every line carries information; the return-value block is mildly redundant given an output schema exists, but it is short and formats the result tokens usefully.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The return values are covered (output schema aside) and the side effects are named, so an agent could plausibly call it. But for a git-mutating, loop-driving tool with 0% schema coverage on three required-ish inputs, the missing parameter meaning and the unstated effect of a reset leave real operational gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% for all three parameters, so the description must compensate — and it says nothing about 'layer', 'hypothesis', or 'project_dir'. 'layer' in particular is opaque: is it a module path, a named mutation target, an integer depth? The reader is left to guess.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Run one ratchet iteration') and enumerates the pipeline: oracle -> compare -> git commit/reset -> check stops. That sequence implicitly distinguishes it from the sibling sor_run_oracle (which only runs the oracle step), but the description never names that sibling, so the differentiation is inferred rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'Call it after making changes to the mutation surface' gives clear timing guidance for invocation. It stops short of exclusions — nothing says when NOT to call it, or whether sor_init/sor_status must run first, and no alternative is named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.