The working artifact is a program. The agent starts from a task instruction, observations of the workspace, and the robot's perception and control interfaces, and writes code that specifies action sequences, geometric computations, motion parameters, and gripper commands.
At each step it weighs the current program against the evidence it has and the question that is still open. It can revise the code, request a demonstration, organize a simulated experiment, or run a candidate on the robot. Neither demonstrations nor simulation is required in every iteration.
The policy is a program
At the end of development the agent produces a condensed code policy that retains the task logic and execution details worked out through interaction, expressed in its action structure, geometric computations, and motion parameters. Once frozen, its decision rules stay fixed, while runtime observations still change the values those rules compute and the actions that result. It executes without a human or coding agent in the loop.
g = M.grasp_standing(ctx, arm, t['xy'], t['z_top'], t['close_yaw'], CARRY_Z)
run.log('grasp', **g)
if not g['ok']:
to_safe(ctx, arm)
return run.report(False, 'grasp: ' + g['why'])
c = M.carry_level(ctx, arm, target['xy'], (CARRY_Z, CARRY_LOW_Z), slot_yaw)
run.log('carry', **c)
if not c['ok']:
M.straight(ctx, arm, [t['xy'][0], t['xy'][1], g['z_grasp'] + 0.002], speed=0.3)
return run.report(False, 'carry: ' + c['why'] + ' (charger held back at its start)')
z_table = table_z(plane, target['xy'][0], target['xy'][1])
ins = M.find_slots(ctx, arm, target['xy'], s['axis'], z_table, g['top_above_tip'], log=run.log)
run.log('insert', **{k: v for k, v in ins.items() if k != 'touches'})
if not ins['ok']:
M.straight(ctx, arm, c['tip'], speed=0.4)
return run.report(False, 'insert: ' + ins['why'] + ' (charger still held above the strip)')
xy = ins['xy']
# operator 23:35: straighten it, then push hard to the bottom (holding)
st = M.straighten(ctx, arm, g['stroke_mm'])
push = M.guarded(ctx, arm, [xy[0], xy[1], z_table + M.FLOOR_ABOVE_TABLE], M.PUSH_RISE_A, speed=M.TOUCH_SPEED)
run.log('push', stroke_mm=st['stroke_mm'], z=round(push['tip'][2] - z_table, 4), fired=push['fired'],
why=push['why'], largest=push['largest'])
p = M.release_and_press(ctx, arm, xy, z_table, st['stroke_mm'])
run.log('press', **p)
M.straight(ctx, arm, [xy[0], xy[1], z_table + M.CLEAR_ABOVE_TABLE], speed=0.4)
fid = V.observe(ctx, ['front', 'wrist_right', 'wrist_' + arm])
run.log('final_view', frame=fid)
if not p['ok']:
ctx.value('piper_park')
return run.report(False, 'press: ' + p['why'], frame=fid, press=p)
M.gripper(ctx, arm, 0)
ctx.value('piper_park')
return run.report(True, socket=xy, kind=target['kind'], press=p, frame=fid)
The main sequence of an agent-written charger-insertion program from a development session: grasp, carry, feel for the slots, straighten, push, release and press, look, report. Two debugging early-exits are omitted.