List cleanup candidates
cleanup_listScans a finished part for cleanup candidates such as loose bodies, spurs, bumps, uneven struts and flat webs, then writes a marks file and report for later judged application.
Instructions
List the geometric cleanup candidates of a finished part as a marks file, in a NEW folder: facts and options, no edit, no verdict.
CONTRACTS.md section 29.3. The tool scans result/final.stl with the detectors of the pipeline stage s7_cleanup and writes marks.json (format 1, mm: apply_marks, the Refine page and the marks: source of ratchet_run read it) and cleanup.json (the full report). It lists loose bodies (no fixed and no load voxel), dead-end spurs, thin bumps, uneven struts (SMOOTH) and flat webs (FAIR). When a loose body exists the file holds the bodies only: judge them, then list the acc_01 of that ratchet root for the features. The list judges nothing: ratchet_run(marks=marks_rel) applies each mark and judges it with the rules of the YAML. The run folder and every input stay as they are. Time: about 2 s on the short hook and 8 s on the ladle. The call runs in the server and finishes if the client stops waiting (Codex waits 60 s for a tool by default); then read cleanup.json, or call again with overwrite=true. A grid above max_voxels or the memory limit gives the facts and the options (pitch_mm, max_gb), not a crash. A wrong input gives {"ok": false, "error": ...}. run_dir: a finished run, or an acc_NN folder of a ratchet root (needs run.json, labels.bin, result/final.stl). Default: the last run of this server. out_dir: the new folder. Default: -cleanup beside the run folder (beside the root for an acc_NN folder). Refused, with the reason and the options: a run folder or a folder inside one, a ratchet root or a folder inside one, a folder with an input file, a symbolic link, a folder with files that is not an earlier cleanup folder. estimate_only: the memory and time estimate of the detector and the judge; no search, no file. options: pitch_mm (0.5), max_candidates (10; null lists all), kinds (body, spur, bump, member), order ("pipeline" or "stress"), max_voxels, max_gb, and the limits of the detectors (spur_*, bump_*, member_*, mild_*, web_flatness, opening_radius_mm, frozen_near_mm, frozen_max_share, near_frozen_mm); cleanup.json gives each default and its source line in the pipeline. The constants of the method are not settable. overwrite: write again into an earlier cleanup folder. detail: the full report in the reply. yaml_path: the YAML of the run when run.json names a file that is not there. root: a ratchet root; its log gives the measured judge time for the estimate. Each mark has the detector, the location, the operator, the thresholds used, the measured sizes and, when verify/fields.npz is there, the stress near it. The facts also say how well the detectors fit this part (applicability). Reply keys: ok, counts, candidates (id, type, operator, detector, confidence, centre_mm, detected_volume_mm3, length_mm, nearest_frozen_mm, stress_ratio, mirror), applicability, bodies, estimate, routes, problems, notes, out_dir_rel, marks_rel, report_rel.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root | No | ||
| detail | No | ||
| options | No | ||
| out_dir | No | ||
| run_dir | No | ||
| overwrite | No | ||
| yaml_path | No | ||
| estimate_only | No |