| name | griddly-2d-embodied-inventory |
| description | Operate and modify the Griddly 2D Embodied Manipulation With Inventory framework. Use when an AI agent must run the Docker/Ray/Android WootzApp runtime, generate 2D Embodied Manipulation With Inventory tasks from OpenAI or human boards, validate and solve levels through browser CDP, run Gemini eval, compute oracle reward/policy reward/learnability JSON, debug noVNC/CDP/Docker issues, or safely edit the Griddly pipeline code and docs. |
Griddly 2D Embodied Manipulation With Inventory Framework
Use this skill to work in the repository root for the 2D Embodied Manipulation With Inventory Griddly
pipeline. Prefer the checked-in scripts over ad hoc Docker/CDP commands.
Core Flow
OpenAI board or human board
-> tasks/2D_Embodied_Manipulation_With_Inventory/<mode>_<timestamp>/
-> browser CDP validation
-> browser CDP oracle planner
-> browser CDP oracle replay
-> Gemini eval through scripts/run_all_tasks.sh
-> browser CDP policy ratio and learnability
-> generated_tasks/2D_Embodied_Manipulation_With_Inventory/latest_scores.json
-> regret_score/<model>/regret_scores.json
-> oracle_score/oracle_scores.json
-> optional Tinker training with --regret-task-set regret_score/<model>/regret_scores.json
First Commands
Run preflight:
./scripts/griddly_doctor.sh --require-openai
Build runtime:
docker compose -f docker-compose.ray.yml --profile standalone build
Start/inspect runtime:
./scripts/griddly_runtime.sh start
./scripts/griddly_runtime.sh status
Run base eval:
./scripts/run_all_tasks.sh --task 2D_Embodied_Manipulation_With_Inventory --model gemini-2.5-pro --visible
Train in regret-task-set order:
./scripts/run_all_tasks.sh --tinker --regret-task-set regret_score/gemini-2.5-pro/regret_scores.json --model Qwen/Qwen3-4B-Instruct-2507
User Shortcut Behavior
When the user says "generate N tasks using AI", create **N accepted AI task
folders under tasks/2D_Embodied_Manipulation_With_Inventory/, not top-level
task folders and not merely N OpenAI candidates. Use OPENAI_MODEL from .env
unless the user names a model. Count only accepted tasks from
latest_generation.json; rejected candidates do not count. If OpenAI returns
malformed boards, rerun generation until N accepted tasks exist or a real
blocker is clear. Save the accepted task IDs to:
generated_tasks/2D_Embodied_Manipulation_With_Inventory/runs/<timestamp>/task_lists/ai_tasks.txt
When the user says "run regret on those N tasks" or "run regret", score only
task IDs under 2D_Embodied_Manipulation_With_Inventory/. Score AI and human
task sets separately when both are present:
.../runs/<timestamp>/ai_scores.json
.../runs/<timestamp>/human_scores.json
regret_score/<model>/regret_scores.json
oracle_score/oracle_scores.json
Use python3 -m w8_rl.griddly.inventory_cli score with Gemini
gemini-2.5-pro unless the user names another policy model. The browser CDP
oracle, oracle replay, policy reward, regret score, and learnability must come
from the existing CDP/eval flow.
When the user says "train based on curated dataset" or similar, start Tinker
training from the persistent regret task set with the Qwen model:
./scripts/run_all_tasks.sh \
--tinker \
--regret-task-set regret_score/gemini-2.5-pro/regret_scores.json \
--model Qwen/Qwen3-4B-Instruct-2507
For generation, regret scoring, and training, always create a timestamped run
folder under:
generated_tasks/2D_Embodied_Manipulation_With_Inventory/runs/<timestamp>/
Tee logs into <run>/logs/*.log, keep task lists in <run>/task_lists/, and
tell the user the actual output folder. Before running any generation, regret
scoring, eval, or training command, print the resolved run configuration in the
chat and in the log:
Command: <generate-ai | score-ai | score-human | train-regret-set | eval>
Provider: <OpenAI | Gemini via Vertex AI | Tinker>
Model: <resolved model name>
Task source/list: <path or task ids>
Algorithm: <short algorithm label from .env/code>
Output folder: <run folder or training output dir>
Log file: <tee target>
Before visible browser work, also print the resolved URLs from .env,
especially:
noVNC: http://localhost:${HOST_VNC_PORT}
CDP: http://localhost:${HOST_CDP_PORT}/json/version
Ray dashboard: http://localhost:${HOST_RAY_DASHBOARD_PORT}
Always use visible mode for this flow. For scripts/run_all_tasks.sh, pass
--visible. For inventory_cli score, set VISIBLE=1 WEB_VNC=true in the
command environment so the nested eval command opens noVNC.
Operating Rules
- Treat browser CDP/WootzApp as the source of truth for generated-level
validation, oracle planning, oracle reward replay, policy ratio, and
learnability.
- Do not replace browser-side scoring with Python approximations.
- Do not hardcode 2D Embodied Manipulation With Inventory object characters in new logic; extract from
tasks/2D_Embodied_Manipulation_With_Inventory/griddly.yaml via
extract_grid_reward_rules_from_yaml.
- Use
scripts/run_all_tasks.sh for Gemini policy eval so scoring uses the
same Docker/Ray/Android path as normal framework eval.
- Use
scripts/griddly_runtime.sh only to start/stop/status the standalone
runtime. Use run_all_tasks.sh for actual eval/training.
- Keep all generated and curated task IDs inside
2D_Embodied_Manipulation_With_Inventory/. Do not use top-level generated
task folders for this flow.
- Always select visible mode for eval/scoring/training so noVNC is available.
- Keep host ports in
.env. Defaults are noVNC 6081, CDP 49224, Ray
dashboard 8275.
- If ports conflict, edit
HOST_CDP_PORT, HOST_VNC_PORT,
HOST_RAY_DASHBOARD_PORT, and related HOST_* values in .env.
- Keep generated score JSON compact. Successful score results should not store
bulky stdout/stderr tails.
regret_scores.json is the training-order file. It is sorted by
learnability descending, then regret_score ascending, with unscored rows
last.
- Leave Design2Code/OpenEnv/SkyRL/SWE-bench code alone unless the user asks
for broader framework work.
Read References As Needed
references/fresh-runbook.md: from-scratch setup and the exact 10 OpenAI +
human task learnability workflow.
references/generated-levels.md: task generation, human board rules,
validation, scoring, and final JSON fields.
references/runtime.md: Docker daemon, build, browser APK, runtime,
snapshots, eval, and training commands.
references/code-map.md: files to edit for generation/scoring/runtime work.
references/troubleshooting.md: common failures and how to debug them.
Validation
For focused checks:
python3 -m pytest \
tests/griddly/test_embodied_inventory_levels.py \
tests/lint/test_griddly_embodied_inventory_artifacts.py \
tests/lint/test_lint_coverage.py \
-q
For Docker-based focused checks:
docker compose -f docker-compose.ray.yml --profile standalone run --rm --no-deps -T \
--user root \
griddly-ray-worker \
python3 -m pytest \
tests/griddly/test_embodied_inventory_levels.py \
tests/lint/test_griddly_embodied_inventory_artifacts.py \
tests/lint/test_lint_coverage.py \
-q
Always run git diff --check before finishing edits.