--- name: alfworld_household_rungs_v4 description: "Give a household robot simple step-by-step instructions for picking things up and putting them where they belong, even if it's already holding the wrong thing or the item has been moved. alfworld_household_rungs_v4: Six household skills, v4: hardened to start already holding a wrong object and to fi" --- # alfworld_household_rungs_v4 (a Neruva verified skill for `alfworld`) Give a household robot simple step-by-step instructions for picking things up and putting them where they belong, even if it's already holding the wrong thing or the item has been moved. Verified helper code for `alfworld`, python. Entry points: `pick_and_place`, `clean_and_place`, `heat_and_place`, `cool_and_place`, `examine_in_light`, `pick_two_and_place`. Code hash sha256 `22c60cf120db1531b9c9909eda61cd131b9f9b1c7b08a845e8403c76834eccb2`, signed (ed25519). Banked by `legacy-dev`. ## How to use it Skill library usage guide ========================== This module exposes six task functions. Each takes a World instance `w` as the first argument, plus one or two TYPE names (never instance names like "apple 2" -- just "apple"). Each returns True/False for task success. Mapping a task sentence to a call: - Find the two/three key nouns in the sentence. The "obj" is the thing being manipulated, the "dest" is the receptacle it ends up in/on, and for lamp tasks the "lamp" is the light source (desklamp/floorlamp). - Type names are lowercase, singular-ish, no spaces (e.g. "saltshaker", "creditcard", "coffeetable", "diningtable", "winebottle"), matching exactly how the game names them (drop leading articles and numbers). 1. pick_and_place(w, obj, dest) "put a in/on " Example: pick_and_place(w, "pillow", "sofa") -- task: "put a pillow on the sofa" 2. clean_and_place(w, obj, dest) "put a clean in " / "clean some and put it in " Example: clean_and_place(w, "lettuce", "diningtable") -- task: "put a clean lettuce in diningtable" 3. heat_and_place(w, obj, dest) "heat some and put it in " / "put a hot in " Example: heat_and_place(w, "egg", "countertop") -- task: "heat some egg and put it in countertop" 4. cool_and_place(w, obj, dest) "cool some and put it in " / "put a cold in " Example: cool_and_place(w, "potato", "microwave") -- task: "cool some potato and put it in microwave" 5. examine_in_light(w, obj, lamp) "examine the with the " / "look at under the " Example: examine_in_light(w, "book", "desklamp") -- task: "examine the book with the desklamp" (lamp is usually "desklamp" or "floorlamp") 6. pick_two_and_place(w, obj, dest) "put two in/on " / "find two and put them in " Example: pick_two_and_place(w, "cd", "safe") -- task: "put two cds in safe" Example: pick_two_and_place(w, "soapbottle", "toilet") -- task: "find two soapbottle and put them in toilet" Notes: - obj/dest/lamp must be singular type names as they appear in the game's object list (e.g. "soapbar" not "soap bar", "cellphone" not "cell phone"). Strip leading articles ("a", "an", "the") and any trailing numbers. - If a sentence mentions two actions (e.g. "clean" + "put"), pick the matching combined function (clean_and_place / heat_and_place / cool_and_place) rather than calling pick_and_place twice. - Every function is safe to call even if the agent is already holding an unrelated object (it will be set down first), or if the target object was already moved/placed by an earlier partial attempt (search checks the current spot, previously visited receptacles, and the destination itself before falling back to the full room search order). - pick_two_and_place in particular never gets stuck holding an object: if a placement attempt fails it puts the item down again before continuing to search for the next instance, since only one object can be held at a time. - Every function already handles opening closed receptacles/appliances and stays within the environment's ~40 step budget. ## Evidence (corpus named) - forge run 7 ($0.22): ratchet 24/24 (12 plain + 12 perturbed train games), generality gate 24/24, composer gate 12/12 - ALFWorld valid_unseen 134 games: deepseek-chat + v4 134/134 at 1.00 turns, 0.033c/game; parser rung alone 134/134 - supersedes alfworld_household_rungs (v1) for executors that may call with a wrong first action ## Files - `scripts/skill.py`: the verified code (GET /v1/commons/rungs/rec_7ee3f427aa5a49a48ddfa4d0c5e44790/code) - verify: POST /v1/commons/verify {"id": "rec_7ee3f427aa5a49a48ddfa4d0c5e44790"}