Index: trunk/ippTools/share/chiptool_runstate.sql
===================================================================
--- trunk/ippTools/share/chiptool_runstate.sql	(revision 25823)
+++ trunk/ippTools/share/chiptool_runstate.sql	(revision 25823)
@@ -0,0 +1,10 @@
+SELECT 
+    chip_id,
+    chipRun.state,
+    exp_id,
+    magic_ds_id,
+    magicDSRun.state as magic_ds_state
+FROM chipRun
+    JOIN rawExp USING(exp_id)
+    LEFT JOIN magicDSRun on stage = 'chip' and stage_id = chip_id and re_place
+
Index: trunk/ippTools/share/magicdstool_tocleanup.sql
===================================================================
--- trunk/ippTools/share/magicdstool_tocleanup.sql	(revision 25823)
+++ trunk/ippTools/share/magicdstool_tocleanup.sql	(revision 25823)
@@ -0,0 +1,12 @@
+SELECT
+    magic_ds_id,
+    magicDSRun.state,
+    magicDSRun.outroot,
+    camera
+FROM magicDSRun 
+    JOIN magicRun USING(magic_id)
+    JOIN rawExp USING(exp_id)
+WHERE magicDSRun.state = 'goto_purged'
+-- XXX: need to add fault to magicDSRun
+--    AND magicDSRun.fault = 0
+
Index: trunk/ippTools/share/warptool_runstate.sql
===================================================================
--- trunk/ippTools/share/warptool_runstate.sql	(revision 25823)
+++ trunk/ippTools/share/warptool_runstate.sql	(revision 25823)
@@ -0,0 +1,16 @@
+SELECT 
+    warp_id,
+    warpRun.label,
+    warpRun.state,
+    warpRun.magicked,
+    chip_id,
+    chipRun.state AS chip_state,
+    exp_id,
+    magic_ds_id,
+    magicDSRun.state AS magic_ds_state
+FROM warpRun 
+    JOIN fakeRun USING(fake_id) 
+    JOIN camRun USING(cam_id) 
+    JOIN chipRun USING(chip_id) 
+    JOIN rawExp USING(exp_id)
+    LEFT JOIN magicDSRun ON stage = 'warp' AND stage_id = warp_id AND re_place
