Skip to main content
Glama

Judge candidate edits

ratchet_run
Destructive

Judges candidate part edits against YAML acceptance rules, promotes passing candidates as the new baseline, and logs failures with reasons; run in estimate-only mode first.

Instructions

Judge candidate edits of a finished part and keep the ones that pass the rules of the YAML (the ratchet).

The start part is judged first (the baseline). A candidate that passes every listed rule becomes the new parent (folder acc_NN in the ratchet root). A candidate that fails is kept in the log with the reason. The rules are the list acceptance.rules in the problem YAML; a rule that is not listed is off. Nothing in the start run is written. estimate_only: default True. It returns the rules, what each rule needs, what is missing (a rule with a missing input fails every candidate), the number of candidates and the time of verify (its own estimate), and starts nothing. Tell the user the numbers, then call again with estimate_only=false. A real start returns at once (a detached process does the work, like verify_run); call ratchet_status to watch it. Only one job goes at a time on this machine. Reply to a start: ok, started, run_dir, root, pid, log_file, check (the estimate), message. On a wrong input: {"ok": false, "error": ..., "exit_code": 1 or 2}. run_dir: the finished run (needs run.json, labels.bin for marks, result/final.stl). Default: the last run of this server. source: marks:FILE (a marks file of the Refine page: one candidate for each mark, made by apply_marks) or stl:FOLDER (each STL file of the folder is a candidate). marks: a marks file, the same as source="marks:FILE". root: the ratchet folder (default: beside the run folder, <run folder>-ratchet). A second call with the same root goes on where the first stopped. If the rules, the mesh size or the inputs (the YAML, the region files) differ from the ratchet in the root, the call stops with the facts: use a new root; or rebaseline=true (judge the current parent again under the new inputs, keep the log); or overwrite=true (it moves the old files into earlier_NN). override_lock: run although another process holds the job lock of the root. stop_before_promote: the owner gate. The job stops before it promotes an accepted candidate (ratchet_status shows pending); ratchet_approve promotes it or drops it. Off by default; the YAML key acceptance.owner_gate does the same. yaml_path: the problem YAML, if the path in run.json is not valid. max_candidates: judge at most this many in this call. mesh_size_mm: the size of the baseline and of all candidates. Each candidate is judged against the current parent with topopt printcheck and, if a rule needs it, topopt verify at the mesh size of the baseline. Every limit comes from the YAML and the log names its source. A stress or stiffness rule on a marks candidate is judged like on any other candidate. If verify refuses the surface (an apply_marks step that fell back to the plain boolean seam), the log record has errors.verify and the rule check is no_input.

Input Schema

NameRequiredDescriptionDefault
rootNo
marksNo
sourceNo
run_dirNo
overwriteNo
yaml_pathNo
rebaselineNo
mesh_size_mmNo
estimate_onlyNo
override_lockNo
max_candidatesNo
stop_before_promoteNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations declare a destructive, non-idempotent, non-read-only write, and the description goes well beyond them: the start run writes nothing, a real start returns immediately because a detached process does the work, a second call with the same root resumes rather than restarts, overwrite relocates old files into earlier_NN, and override_lock bypasses a held job lock. It also documents side-effect details annotations cannot express, such as `errors.verify` and `no_input` on refused surfaces.

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?

The purpose and default workflow are front-loaded, and each subsequent block maps to real parameters, so little is wasted. However, it is a dense run of unbulleted prose paragraphs, and a scannable list for the dozen parameter semantics would make it easier to extract the right flag under time pressure.

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

Completeness5/5

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

For a 12-parameter, destructive, long-running job with no output schema and zero schema coverage, the description covers the call ordering, async nature, resume/conflict behavior, promotion output fields, and error shape ({"ok": false, "error": ..., "exit_code": 1 or 2}). An agent has everything needed to invoke it correctly and interpret the result.

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

Parameters5/5

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

Schema coverage is 0% with 12 parameters, so the description must carry the full burden — and it does, defining run_dir requirements, the two `source` forms (`marks:FILE`, `stl:FOLDER`), root defaults and resume semantics, what each of rebaseline/overwrite/override_lock/stop_before_promote/max_candidates/mesh_size_mm does, and the estimate_only default. Almost every parameter gets semantics the schema cannot supply.

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

Purpose5/5

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

The opening sentence names a specific verb and resource — 'judge candidate edits of a finished part and keep the ones that pass' — and immediately defines the mechanism (baseline parent, promotion to acc_NN, failures logged). It is clearly distinguishable from ratchet_status (watching) and ratchet_approve (promoting), which are named later.

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

Usage Guidelines5/5

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

It explicitly prescribes the default workflow — estimate_only defaults True, 'Tell the user the numbers, then call again with estimate_only=false,' then 'call ratchet_status to watch it' — and names the alternatives for conflicting roots (new root, rebaseline, overwrite). It also states the concurrency constraint ('Only one job goes at a time on this machine'), so the agent knows when a call will block or conflict.

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