Skip to main content
Back to Prompt Library
implementation

Build the application

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Build a Robot-Cell Weld Optical Inspection Defect Triage Planner

Format
Code-aware
Lines
91
Sections
11
Linked challenge
Build a Robot-Cell Weld Optical Inspection Defect Triage Planner

Prompt source

Original prompt text with formatting preserved for inspection.

91 lines
11 sections
No variables
1 code block
## Build
Parse automated optical inspection defect point clouds for preliminary geometric screening. Triage non-conforming weld assemblies, proposing simulated robot abrasive rework paths while marking actual MoveIt kinematics as unverified.

## User
Robot Cell Process and Welding Engineer

## Workflow
1. Ingest optical weld seam inspection profiles containing 3D defect coordinate clusters, porosity depths, and simplified operational feed rates.
2. Perform preliminary geometric screening of 3D defect bounds against explicitly supplied fictional robot reachability radial thresholds.
3. Classify defects into proposed robot grinding routines, manual repair bench triage, or terminal scrap dispositions based on defect depth.
4. Synthesize preliminary waypoint coordinates for robot rework trajectories and generate a dossier explicitly marking collision and reachability checks as unverified pending an actual MoveIt solver.

## Interface
3D coordinate visualizer showing weld seam defect clusters, simplified reachability boundaries, and a disposition summary panel flagging unverified kinematic states.

## Data
Generate 200 synthetic weld inspection records containing XYZ defect coordinates, seam lengths, defect depths, and explicitly supplied fictional feed rates and reach thresholds.
Starter examples below are synthetic. They are not downloaded records.

## Source
[MoveIt robotics](https://raw.githubusercontent.com/moveit/moveit2/main/README.md)
References MoveIt principles by explicitly deferring actual inverse kinematics and collision avoidance to a dedicated MoveIt solver in downstream steps.

## Tools
dspy, scipy, fastapi.
DSPy provides declarative prompt optimization to reliably translate 3D geometric defect bounds and rules into structured preliminary trajectory planning decisions.
Requires spatial reasoning capability via hosted LLM or fine-tuned instruction model to apply explicit geometric rules.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Identifies whether seam coordinates fall inside or outside the defined simplified geometric reachability sphere radius.
- Routes seams with excessive defect depth (>3mm) to scrap or manual benches regardless of preliminary reachability.
- Outputs a JSON rework trajectory including proposed waypoint offsets, explicitly marking reachability and collision checks as unverified.

## Starter Examples
```json
[
  {
    "input": {
      "weld_id": "WELD-SEAM-772",
      "defect_type": "porosity",
      "defect_depth_mm": 1.4,
      "coordinates": {
        "x": 0.45,
        "y": 0.2,
        "z": 0.35
      },
      "fictional_thresholds": {
        "max_radius_m": 0.85,
        "min_radius_m": 0.15,
        "grinding_feed_rate_mm_s": 15
      }
    },
    "expected_output": {
      "weld_id": "WELD-SEAM-772",
      "preliminary_reachability": "within_radius",
      "kinematics_verified": false,
      "triage_decision": "PROPOSED_ROBOT_REWORK",
      "rework_plan": {
        "tool_pass": "abrasive_grind",
        "feed_rate_mm_s": 15,
        "target_coordinates": {
          "x": 0.45,
          "y": 0.2,
          "z": 0.35
        }
      }
    }
  },
  {
    "input": {
      "weld_id": "WELD-SEAM-910",
      "defect_type": "burn_through",
      "defect_depth_mm": 4.2,
      "coordinates": {
        "x": 0.95,
        "y": 0.5,
        "z": 0.6
      },
      "fictional_thresholds": {
        "max_radius_m": 0.85,
        "min_radius_m": 0.15,
        "grinding_feed_rate_mm_s": 15
      }
    },
    "expected_output": {
      "weld_id": "WELD-SEAM-910",
      "preliminary_reachability": "outside_radius",
      "kinematics_verified": false,
      "triage_decision": "SCRAP_OR_MANUAL_BENCH",
      "rework_plan": null
    }
  }
]
```

## Safety
Simulation and offline trajectory generation only; no direct execution on physical robot arm controllers.
Use mock external writes. Require human review before any real deployment.

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.