{"data":{"kind":"file","path":"README.md","version_id":"s1hi6fx4pkx89niut1zmdqds","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":4230,"modified_at":"2026-09-14T08:52:24.017000","content_hash":"8a47eb775614da8b975b14b0eb7e1d9bd3344d3376dd8c18ced767c8072d593e"},"entries":[],"content":"# Amazon Improved Task 001\n\nThis is a separate Prime Hub environment for the DemoCart Android task. The model must search separately for Nimbus Wireless Headphones, Trail Steel Water Bottle, and Metro Laptop Backpack; add exactly one of each; open the cart; and finish with the exact INR 4,997 subtotal. The package uses the legacy Verifiers V0 `load_environment` contract and runs Android with software emulation on a Prime Ubuntu sandbox—KVM is not required.\n\nThe verifier profile records nine action-correctness checks and five shared optimization budgets. A policy receives the 0.5 correctness baseline only when its text-entry, search-submission, and cart-addition checks pass. Four of five shared budgets must also pass for the policy score to reach the 0.9 cutoff. Final episode values remain PASS = 1, INVALID = 0, and FAIL = -1.\n\n## Architecture\n\n```mermaid\nflowchart LR\n    M[Prime model] -->|JSON action| E[Legacy MultiTurnEnv]\n    E -->|private mailbox| S[Prime Ubuntu sandbox]\n    S --> A[Android software emulator]\n    A --> D[DemoCart APK and SQLite]\n    D --> V[Evidence and policy verifiers]\n    V --> R[Signed reward and artifacts]\n```\n\n## Bootstrap and validation\n\nFrom this directory:\n\n```bash\n./scripts/bootstrap.sh\nuv run --extra dev pytest\nuv run python -m compileall amazon_improved_task_001 tests\n```\n\nBootstrap keeps the project environment, tool installation, and caches inside this directory. It installs `prime==0.6.35` separately from the task dependencies because that CLI release supports the required `--runtime v0` publication declaration.\n\n## Headless publication\n\nAuthenticate first with either `prime login` or a `PRIME_API_KEY` environment variable. Never put the key in this repository. Then run:\n\n```bash\n./scripts/publish_prime.sh\n```\n\nEquivalent one-command upload from any directory:\n\n```bash\nUV_CACHE_DIR=/data/Tirtha/browser-is-all-you-need/android-apk-rl-adk/environments/amazon_improved_task_001/.cache/uv \\\nuvx --from prime==0.6.35 prime --plain env push \\\n  --path /data/Tirtha/browser-is-all-you-need/android-apk-rl-adk/environments/amazon_improved_task_001 \\\n  --name amazon-improved-task-001 \\\n  --visibility PUBLIC \\\n  --runtime v0\n```\n\nDo not omit `--runtime v0`: dependency-version inference alone would classify `verifiers==0.3.1` as V1 and make Prime look for a `Taskset`, which this legacy environment intentionally does not export.\n\n## Hosted workflow\n\n```mermaid\nsequenceDiagram\n    participant C as Prime hosted controller\n    participant E as Environment\n    participant S as Ubuntu sandbox\n    participant A as Android emulator\n    C->>E: Load V0 load_environment\n    E->>S: Create one approved sandbox\n    S->>A: Provision SDK, build APK, boot with -accel off\n    loop Each model action\n        C->>E: JSON action\n        E->>A: Validated ADB operation\n        A-->>E: UI, SQLite, receipt, screenshot\n    end\n    E-->>C: Verdict, policy receipts, screenshots and recording\n    E->>S: Delete sandbox during cleanup\n```\n\nPublishing the environment does not launch a sandbox, emulator, model, or evaluation. A later hosted smoke evaluation remains a separate paid operation and must explicitly pass `allow_eval=true` and the required access flags.\n\n## Important files\n\n| Path | Purpose |\n|---|---|\n| `amazon_improved_task_001/integrations/prime_env.py` | Legacy V0 `MultiTurnEnv` entry point. |\n| `amazon_improved_task_001/integrations/hosted_env.py` | Prime controller, software-emulator defaults, viewer and evidence collection. |\n| `amazon_improved_task_001/harness/hosted_worker.py` | Runs the Android worker and action mailbox inside the Prime sandbox. |\n| `amazon_improved_task_001/verification/action_budget.py` | Nine correctness checks, five shared budgets, 0.9 policy cutoff and signed episode verdict. |\n| `amazon_improved_task_001/specs/action_budget.json` | Versioned scoring contract and boundaries. |\n| `scripts/provision_android.sh` | Fresh Ubuntu Android SDK, emulator, dependency and APK provisioning. |\n| `scripts/bootstrap.sh` | Fresh-machine local Python and Prime CLI setup. |\n| `scripts/publish_prime.sh` | Headless public V0 upload with a pinned CLI. |\n| `IMPLEMENTATION_LOG.md` | Changes and evidence boundaries for this separate package. |\n\n","encoding":"utf-8","truncated":false,"total_bytes":4230},"status":null}