Drawing route quality

Tool ID: drawing_route_quality

Purpose and availability

Measure the detour of one exact persisted schematic route. The quantities describe native drawing geometry only: they are not geographic line length, impedance, electrical performance or proof of a readable rendered diagram.

Prerequisites and invocation

1. Use drawing_diagrams to retain artifact and an exact schematic diagram_id. 2. Run drawing_inspect and select the exact branch_id of an existing explicit route; review its issues. 3. Supply only expected_artifact, diagram_id and branch_id, all from that same candidate snapshot. There is no points override, label-rectangle input or file-path input in this typed tool. The route must have 2–256 finite bounded points, distinct orthogonal segments and no self-intersection; unsupported route geometry is rejected, not repaired.

Exact input schema

{
  "additionalProperties": false,
  "properties": {
    "branch_id": {
      "maxLength": 256,
      "minLength": 1,
      "type": "string"
    },
    "diagram_id": {
      "maxLength": 256,
      "minLength": 1,
      "type": "string"
    },
    "expected_artifact": {
      "pattern": "^[a-f0-9]{64}$",
      "type": "string"
    }
  },
  "required": [
    "expected_artifact",
    "diagram_id",
    "branch_id"
  ],
  "type": "object"
}

Results and units

schema=powersystem-route-quality/1, candidate_id, artifact, diagram_id and branch_id bind the result. drawing_length sums segment lengths; manhattan_lower_bound is the absolute horizontal plus vertical separation of the endpoints. Both use coordinate_units="native drawing units". detour_ratio is dimensionless: length divided by that lower bound; an unavailable denominator is null, not zero. review_ratio=1.5 is a drawing-review threshold, not an engineering limit. A larger ratio adds long-detour to review_reasons. Also read endpoint_issues, native-route-shape-unavailable, native-endpoint-review-required and the missing-geometry reasons. physical_length_inferred=false; label_geometry_available=false, symbol_geometry_available=false and label_check_status="unavailable" prevent a false visual pass. label_collisions=[] does not mean checked-and-clear when label geometry is unavailable.

Limits and recovery

A returned ratio does not validate endpoint ownership or native rendering: review endpoint_issues and inspect the actual native scene before any presentation edit. Unknown IDs, absent explicit routes, unsupported points, self-intersections or an exhausted inspection budget fail rather than producing a fabricated score. The underlying inspection admits at most 2000 candidate branches and 256 points per route; this call does not bypass it. If expected_artifact is stale, rediscover with drawing_diagrams and repeat exact selection. For invalid geometry or missing native anchors, retain the original snapshot and request an explicit detached correction; do not guess data or treat a missing result as zero. An unavailable label/symbol check requires native review, not invented rectangles. No automatic inference retry.

AI and human boundaries

This tool is read-only in Plan and Build. The server binds candidate_id; it is not a selectable input. artifact is the SHA-256 of the exact saved candidate archive, not an approval or a new engineering version. engineering_approval=false always. No tool installs a proposal, saves a circuit, edits Original/Main, switches the human editor, accepts engineering or fetches map tiles. Native visual review and an explicitly authorized detached edit remain separate. See AI drawing workflow and Human review.