Diagnose atomic failure

From nssmd/RoboRSI · View interactive version

Diagnose atomic failure is an AI agent skill from the GitHub repository nssmd/RoboRSI. Exhaustive ordered checklist for diagnosing why an atomic failed in a long-horizon run. Codifies the procedure I (Claude) actually follow when reviewing a failed orchestrator round, so any AI reviewer can do the same investigation. Each step says WHAT to check, WHICH tool to call, HOW to read the re

How to use this skill

Skill file

Why this exists

When a long-horizon atomic fails, there are at least 6 distinct failure modes and 4 distinct fix levels (prompt / SKILL.md hint / structural gate / new base skill). Pattern-matching on judge reasons alone gets the wrong fix level (e.g., tightening the prompt when the bug is in the base skill's grasp pose computation). This checklist is the procedure that funnels you to the right fix level.

Inputs you need

Checklist (run top-to-bottom; STOP at first match)


A. Is it even a real failure?

A.1 Call get_lh_report(<lh_task>, latest=True).

Read trace[*].atomic_judge.reason AND trace[*].atomic_result.outcome AND trace[*].atomic_judge.success.

| If you see | Then |

|---|---|

| atomic_judge.success=true but atomic_success=false | CONTRADICTION — judge says it worked, gate says no. Skip to section B. |

| atomic_judge.reason describes the goal state achieved (e.g. "block separated from bowl, pinched in fingertips") but outcome is a fail enum | Same — section B. |

| atomic_judge.success=false AND reason describes the real failed scene state (e.g. "right gripper not holding bowl, bowl on table") | Real failure. Continue to C. |


B. CONTRADICTION SIGNAL — gate / judge / outcome disagree

B.1 Call get_inner_trace(<run_id>, tool_filter=<the primitive named in the recipe>). See what the VLM actually called.

B.2 If the recipe's canonical primitive WAS called with ok=True:

B.3 If the judge's "success=true" reading conflicts with sim's check_success:

STOP here if B matched.


C. Did the VLM follow the recipe?

C.1 get_inner_trace(<run_id>) (no filter) — list ALL tool calls.

C.2 Compare to the recipe in read_skill_code('<atomic>.zeroshot'):

| Symptom | Diagnosis | Fix level |

|---|---|---|

| Recipe says "Step 1 = find_object_via_wrist", but VLM called find_pixel directly | VLM ignoring recipe | Prompt strengthening (use MANDATORY / PROHIBITED clauses) |

| VLM never called the primary grasp primitive | VLM gave up early | Add HARD RULE: "PROHIBITED done(True) without ≥1 call to <primitive>". Also add a structural gate via _trace_invoked |

| VLM called done(success=True) very early in budget | Overclaim | Tighten done gate to require verify_holding_visual=True+conf>=0.7 |

| VLM called recipe correctly, all ok=True success=True holding_visual=True per primitive, but atomic_result is still fail | Continue to D |

| VLM called recipe correctly but primitives returned ok=True success=False holding_visual=False | Base skill is the problem. Skip to E |

| Primitives returned ok=False reason="<...>" | Motion / IK problem. Skip to D |


D. Motion-planning / IK level failures

D.1 Inspect the physical-layer error messages. get_sim_debug() filters DBG / IK-fail / GraspGen lines.

D.2 Or via sqlite directly (most reliable):

run_python(code='''
import sqlite3
db = sqlite3.connect("~/.roborsi/trace.db")
rows = db.execute("""SELECT tool, substr(result_preview,1,140)
                      FROM steps WHERE run_id=? AND result_ok=0
                      AND result_preview IS NOT NULL""",
                    ("<run_id>",)).fetchall()
for r in rows: print(r)
''')

D.3 Interpret:

| Pattern | Meaning | Fix |

|---|---|---|

| "no horizontal approach had IK" repeated | cuRobo refuses any cardinal lateral. Workspace is blocked OR rim_z is wrong. | propose_skill_update the base skill to add diagonal angles, or extend descend_ladder upward |

| "GraspGen returned 0 candidates" | Perception/segmentation failed | Tighten the object query / try extra_queries=[...] / check that the object class is in GraspGen's training data |

| "GraspGen returned N candidates, all rejected" | Candidates exist but downstream IK rejected each. Likely sibling arm in workspace. | Add arm-parking step OR propose new base skill with extended approach angles |

| "cuRobo plan status = Fail" on advance phase only | Pre-grasp pose reachable, advance not. Joint limits hit at advance. | Diagonal approaches; or use contact_point_id-based grasp (D goes to E) |

| "descend_ok=false" | Final descent IK fails. rim_z is too low (lateral hits bowl floor) OR too high (fingers above rim). | Extend descend_ladder; or recompute rim_z |

| IK-ok everywhere but holding_visual=false | Motion completes, force-closure fails. Skip to E — this is base-skill geometry, not IK. |

STOP if you write the fix proposal.


E. EXPERT-TRAJECTORY PROTOCOL — base skill is wrong

Triggered when EITHER:

E.1 Read the sim env source:

read_file('$ROBORSI_BICOORD_ROOT/envs/<sim_task>.py')

Look for the expert trajectory (usually play_once or named like play_*):

E.2 For each actor the expert grasps via contact_point_id, read the asset metadata:

read_file('$ROBORSI_BICOORD_ROOT/assets/objects/<modelname>/model_data<N>.json')

Check contact_points_pose — the 4×4 transforms specifying tuned grasp poses.

E.3 Survey existing base skills:

list_dir('roborsi/embodied/skills/base/robotwin')
grep_repo('get_grasp_pose|contact_points_pose|grasp_actor', '*.py', 'repo')

If a base skill already wraps the expert's primitive: the atomic's recipe is using the wrong base skill. Fix is propose_skill_update on <atomic>.zeroshot to promote the right one to Step 1.

If NO base skill wraps the expert's path: propose_new_skill a wrapper. Template: roborsi/embodied/skills/base/robotwin/pick_actor_by_contact_point/policy.py. Key constraints:

Also: NEVER hardcode actor names in the atomic prompt. Use describe_scene_actors (introspection base skill) for runtime discovery.

E.4 Write the proposal rationale citing all of:

Without these citations the proposal will be REJECTed per review_selfevo_proposal Rule 5.


F. After the fix is applied

F.1 git_log -n 5 --path=<modified file> — confirm the fix landed.

F.2 Launch a new triangle round (roborsi bench-lh skill <task>) — Python module cache means the fix only takes effect in a fresh process.

F.3 On the next round, return to A with the new run_id. If the SAME failure mode persists, the fix didn't address the right thing — restart from C/D/E rather than re-proposing the same change.

Failure modes of this checklist itself

Related

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.