[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69ARH3N62N1W2J3EH7QGR2N":3,"skill-same:01M69ARH3N62N1W2J3EH7QGR2N":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":40,"linkOnly":41,"markdownContent":42,"markdownBody":43,"frontMatter":44,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":17,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M69ARH3N62N1W2J3EH7QGR2N","dataviewer","机器人训练数据浏览与标注","Start and interact with the Dataset Analysis Tool (dataviewer) for browsing, annotating, and exporting robotic training episodes","启动并交互使用数据集分析工具（dataviewer），用于浏览、标注和导出机器人训练片段（episodes）。","microsoft\u002Fphysical-ai-toolchain","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69ARCAV4WR03MSZSQPHZ2S8",138,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fphysical-ai-toolchain\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fdataviewer\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C0NK93YXC7GERCH372ZVDF","AI 模型训练与微调","SCENARIO","使用场景",[5,31,32,33,34,35,36,37,38,39],"training","browsing","dataset","analysis","start","for","tool","with","robotic","2026-11-10 10:12:30",false,"---\nname: dataviewer\ndescription: 'Start and interact with the Dataset Analysis Tool (dataviewer) for browsing, annotating, and exporting robotic training episodes'\n---\n\n# Dataviewer Skill\n\nLaunch and interact with the Dataset Analysis Tool, a full-stack application for analyzing and annotating robotic training data from episode-based datasets. Complete requested operations with persistence read-back; job acceptance is not inference completion or label application.\n\n## Prerequisites\n\n| Platform | Requirement                                                                                                           |\n|----------|-----------------------------------------------------------------------------------------------------------------------|\n| All      | Python 3.12+, Node.js 24+, npm, `uv`                                                                                  |\n| All      | `ffmpeg` on `PATH` outside the backend container, for HDF5 camera video (OpenCV also works) and LeRobot episode clips |\n\nThe backend virtual environment and repository-root npm workspace dependencies are auto-created on first launch by `start.sh`.\n\n## Launch and Connect Workflow\n\nFollow these steps when a launch is required and authorized. Inspect existing terminals\u002Ftask output first and reuse healthy services with matching configuration. Read-only inspection does not authorize restarts, inference or dataset writes. Use VS Code tasks for an already configured development session; use the launcher for requested overrides and readiness checks.\n\nWhen a caller or workflow supplies the URL of a Dataviewer it already runs, such as the instance the Sim Workspace Command Center opens for a workspace, skip Step 1 and open that URL in Step 2. Start `start.sh` only when no running instance is supplied, so one dataset folder never gets a second Dataviewer.\n\n### Step 1 — Start the app\n\nLaunch `start.sh` as a background terminal process. The script prints `[OK] Both services are running` and the URLs when both services are healthy.\n\nUse `.\u002Fstart.sh --check` to check installed launch prerequisites without starting or installing services. The launcher binds both services to loopback, requires the selected frontend port and returns failure when either service fails readiness.\n\n```bash\ncd data-management\u002Fviewer && .\u002Fstart.sh\n```\n\nWith a custom dataset path:\n\n```bash\ncd data-management\u002Fviewer && .\u002Fstart.sh --data-dir \u002Fpath\u002Fto\u002Fdatasets\n```\n\n### Step 2 — Open the app in the browser\n\nAfter confirming both services are running (look for `[OK] Backend is healthy` in terminal output), or when a running URL was supplied, open the frontend with the integrated browser's `open_browser_page` tool:\n\n```text\nopen_browser_page(\"http:\u002F\u002Flocalhost:5173\")\n```\n\nSimpleBrowser is the visual interface for the user when that provider is available. Configured headless Playwright automation runs in the background. Native browser tools can operate a shared page directly; separate browser sessions share persisted backend state, not necessarily unsaved drafts.\nUse the supplied URL, or substitute a non-default `FRONTEND_PORT` for `5173`.\n\n### Step 3 — Load browser automation tools\n\nUse the host's tool search to discover available browser capabilities before calling deferred tools. Native tools include `read_page`, `run_playwright_code`, `navigate_page`, `click_element`, `type_in_page` and `screenshot_page`. Use those when available; an equivalent native read does not require MCP reconfiguration.\n\nDrive the UI with whichever browser tool family the host provides:\n\n| Tool family        | Tools                                                                                                                        | How it works                                       |\n|--------------------|------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------|\n| Integrated browser | `open_browser_page`, `navigate_page`, `read_page`, `click_element`, `type_in_page`, `run_playwright_code`, `screenshot_page` | Acts on the page the user sees                     |\n| Playwright MCP     | `browser_snapshot`, `browser_navigate`, `browser_click`, `browser_type`, `browser_evaluate`, `browser_take_screenshot`       | Acts headlessly on a separate copy of the same URL |\n\nFor the Playwright MCP background workflow, configure **headless mode** so it does not open a separate browser window. Its visual feedback goes through SimpleBrowser (Step 2). In the Copilot harness (the Copilot session target in VS Code, Copilot CLI, and the Copilot app), a workspace-root `.mcp.json` can use:\n\n```json\n\u002F\u002F .mcp.json\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\"@playwright\u002Fmcp@latest\", \"--headless\"],\n      \"tools\": [\"*\"]\n    }\n  }\n}\n```\n\n`\"tools\": [\"*\"]` exposes every server tool. Narrow it to the actions this skill uses (`browser_snapshot`, `browser_navigate`, `browser_click`, `browser_type`, `browser_evaluate`, `browser_take_screenshot`), and pin a reviewed `@playwright\u002Fmcp` version instead of `@latest`, because the server drives browser sessions that may be signed in. Local agent sessions in VS Code read `.vscode\u002Fmcp.json` instead, with the same server entry under a `servers` key and without the `tools` field.\n\n> [!IMPORTANT]\n> Use `--headless` for the MCP background workflow. Reconfiguring or installing a browser provider requires approval; do not change it merely to obtain inspection evidence.\n\nSearch by capability using the host's available tool-search schema, for example:\n\n```text\nFind browser tools to read an accessible page snapshot, navigate, click, type and capture screenshots.\n```\n\nIf no suitable provider is available, report the limit and guide manual inspection. When the user chooses the configured MCP provider, they can run **MCP: Start Server** then select **playwright** in the Command Palette. An empty tool search alone does not prove that a server is stopped.\n\n### Step 4 — Interact with the UI\n\nBoth tool families see the same backend state, so API-driven changes (labels, annotations) appear in both.\n\n| Action             | Integrated browser    | Playwright MCP            | Notes                                         |\n|--------------------|-----------------------|---------------------------|-----------------------------------------------|\n| Capture page state | `read_page`           | `browser_snapshot`        | Inspect current accessible roles\u002Fnames        |\n| Navigate to URL    | `navigate_page`       | `browser_navigate`        | Preserve unsaved drafts before reload         |\n| Click an element   | `click_element`       | `browser_click`           | Use current snapshot refs and names           |\n| Type into input    | `type_in_page`        | `browser_type`            | For dataset filters or label inputs           |\n| Run a script       | `run_playwright_code` | `browser_evaluate`        | For sliders, scrolling and multi-step checks  |\n| Take a screenshot  | `screenshot_page`     | `browser_take_screenshot` | Appearance, not persistence or keyboard proof |\n\nTake a fresh accessible snapshot before click\u002Ftype actions and refresh refs after content changes. Use the [Frontend UI Structure](#frontend-ui-structure) below to orient; forced DOM clicks are not keyboard accessibility evidence.\n\n## Quick Start\n\nStart the dataviewer with the default dataset path:\n\n```bash\ncd data-management\u002Fviewer && .\u002Fstart.sh\n```\n\nStart with a custom dataset path:\n\n```bash\ncd data-management\u002Fviewer && .\u002Fstart.sh --data-dir \u002Fpath\u002Fto\u002Fdatasets\n```\n\n## Parameters Reference\n\n| Parameter        | Default                                      | Description                                 |\n|------------------|----------------------------------------------|---------------------------------------------|\n| `DATA_DIR`       | `..\u002F..\u002F..\u002Fdatasets` (relative to `backend\u002F`) | Directory containing dataset subdirectories |\n| `BACKEND_PORT`   | `8000`                                       | FastAPI backend port                        |\n| `FRONTEND_PORT`  | `5173`                                       | Vite frontend dev server port               |\n| `HEALTH_TIMEOUT` | `30`                                         | Seconds to wait for backend health check    |\n\n### Dataset Path Configuration\n\nThe `DATA_DIR` environment variable controls which datasets are visible in the app. Each subdirectory under this path is treated as a separate `dataset_id`.\n\nUse one of these methods to set `DATA_DIR`.\n\n### Launch argument\n\nUse this method for workflow handoff and ad-hoc sessions:\n\n```bash\n.\u002Fstart.sh --data-dir \u002Fpath\u002Fto\u002Fdatasets\n```\n\n### Backend environment file\n\nUse this method only when a persistent local default is requested:\n\n```env\nDATA_DIR=\u002Fpath\u002Fto\u002Fdatasets\n```\n\n### Session environment\n\nUse this method for a shell-scoped override:\n\n```bash\nexport DATA_DIR=\u002Fpath\u002Fto\u002Fdatasets\ncd data-management\u002Fviewer && .\u002Fstart.sh\n```\n\nPersist a path in `backend\u002F.env` only when the user explicitly requests a local default\nacross restarts. Do not mutate `.env` for a profile-bound workflow handoff. The workflow\nowns the viewer child and passes the manifest's exact dataset parent through\n`--data-dir`.\n\nWhen `accepted-dataset.json` exists, verify the dataset capabilities before browser\ninspection. Require the returned dataset ID, output adapter\u002Fversion, viewer adapter,\nprofile ID\u002Fhash, capture-provenance hash, export-validation hash, capture features, and\nsensor roles to match the descriptor.\n\nRead the [accepted-dataset contract reference](..\u002F..\u002F..\u002Fdata-management\u002Fviewer\u002FREADME.md#-accepted-dataset-contract)\nfor the descriptor schema, artifact integrity checks, and invalid-contract behavior.\n\n## Architecture\n\n```text\ndata-management\u002Fviewer\u002F\n├── start.sh              # Orchestrator: launches backend + frontend\n├── backend\u002F\n│   ├── .env              # DATA_DIR and test config\n│   ├── pyproject.toml    # Python dependencies (uv)\n│   └── src\u002Fapi\u002F\n│       ├── main.py       # FastAPI app, CORS, router registration\n│       ├── routers\u002F      # REST endpoints: datasets, annotations, labels, export, detection, analysis\n│       ├── routes\u002F       # AI analysis routes\n│       ├── services\u002F     # Business logic and dataset service\n│       ├── models\u002F       # Pydantic models\n│       └── storage\u002F      # Persistence layer\n├── frontend\u002F\n│   ├── vite.config.ts    # Dev server + API proxy to :8000\n│   └── src\u002F\n│       ├── App.tsx       # Root: dataset selector, episode list, annotation workspace\n│       ├── api\u002F          # HTTP client and typed API functions\n│       ├── components\u002F   # UI components (annotation, dashboard, episode viewer, export)\n│       ├── hooks\u002F        # React Query hooks for datasets, episodes, annotations\n│       ├── stores\u002F       # Zustand stores for episode and dataset state\n│       └── types\u002F        # TypeScript type definitions\n```\n\n## API Reference\n\n### Core Endpoints\n\n| Endpoint                                           | Method | Description                                                                               |\n|----------------------------------------------------|--------|-------------------------------------------------------------------------------------------|\n| `\u002Fhealth`                                          | GET    | Health check                                                                              |\n| `\u002Fapi\u002Fdatasets`                                    | GET    | List all datasets                                                                         |\n| `\u002Fapi\u002Fdatasets\u002F{id}`                               | GET    | Get dataset metadata                                                                      |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fcapabilities`                  | GET    | Get format support, optional feature availability, and verified accepted-dataset contract |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes`                      | GET    | List episodes in a dataset                                                                |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}`                | GET    | Get episode data with trajectory and metadata                                             |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Ftrajectory`     | GET    | Get trajectory data only                                                                  |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fframes\u002F{frame}` | GET    | Get a single frame image                                                                  |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fcameras`        | GET    | List available camera views                                                               |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fvideo\u002F{camera}` | GET    | Stream video for a camera                                                                 |\n| `http:\u002F\u002Flocalhost:8000\u002Fdocs`                       | GET    | Swagger UI documentation                                                                  |\n\n### Label Endpoints\n\n| Endpoint                                   | Method | Description                                           |\n|--------------------------------------------|--------|-------------------------------------------------------|\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Flabels`                | GET    | Get all episode labels and available label options    |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Flabels\u002Foptions`        | GET    | List available label options                          |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Flabels\u002Foptions`        | POST   | Add a new label option (`{\"label\": \"NAME\"}`)          |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Flabels` | GET    | Get labels for one episode                            |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Flabels` | PUT    | Set labels for one episode (`{\"labels\": [\"A\", \"B\"]}`) |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Flabels\u002Fsave`           | POST   | Persist all labels to disk                            |\n\n### VLM-as-Judge Endpoints\n\n> [!NOTE]\n> Mounted only when `VLM_JUDGE_ENABLED=true`. Dataset capabilities advertise this\n> state, and the frontend does not request an episode judge status while disabled.\n\n| Endpoint                                                 | Method | Description                                                                                   |\n|----------------------------------------------------------|--------|-----------------------------------------------------------------------------------------------|\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fjudge\u002Fsnapshot`       | GET    | Resolve saved inputs and snapshot identity; optionally select `annotation_author_id`          |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fjudge`                | GET    | Current configuration\u002Fcache status and optional cached inference payload; not durable history |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fjudge`                | POST   | Accept one job with saved `snapshot_id`, optional author, `views`, `process_method`, `force`  |\n| `\u002Fapi\u002Fjudge\u002Fepisodes?dataset_id={id}`                    | GET    | Paginated actual episode IDs and inventory revision                                           |\n| `\u002Fapi\u002Fjudge\u002Fjobs`                                        | POST   | Accept a sample or approved dataset job                                                       |\n| `\u002Fapi\u002Fjudge\u002Fjobs\u002F{job_id}`                               | GET    | Durable status, counts and paginated targets                                                  |\n| `\u002Fapi\u002Fjudge\u002Fjobs\u002F{job_id}\u002Fapprove`                       | POST   | Approve reviewed sample evidence\u002Fconfiguration                                                |\n| `\u002Fapi\u002Fjudge\u002Fjobs\u002F{job_id}\u002Fcancel`                        | POST   | Cancel pending work without deleting saved evidence                                           |\n| `\u002Fapi\u002Fjudge\u002Fjobs\u002F{job_id}\u002Fretry`                         | POST   | Retry eligible unfinished work after revalidation                                             |\n| `\u002Fapi\u002Fjudge\u002Fjobs\u002F{job_id}\u002Fapply`                         | POST   | Explicit label application, optionally selected episode IDs                                   |\n| `\u002Fapi\u002Fjudge\u002Fresults?dataset_id={id}&episode_index={idx}` | GET    | Canonical evidence with current\u002Fstale\u002Fwithdrawn applicability                                 |\n| `\u002Fapi\u002Fjudge\u002Fapprovals?dataset_id={id}`                   | GET    | Saved approvals for the current principal                                                     |\n| `\u002Fapi\u002Fjudge\u002Fresets\u002Fpreview`                              | POST   | Preview removal of AI-applied labels                                                          |\n| `\u002Fapi\u002Fjudge\u002Fresets`                                      | POST   | Confirm a reviewed `preview_id`                                                               |\n| `\u002Fapi\u002Fjudge\u002Fresets?dataset_id={id}`                      | GET    | Withdrawal status                                                                             |\n| `\u002Fapi\u002Fjudge\u002Fresets\u002Fretry`                                | POST   | Retry eligible withdrawal work                                                                |\n\nPOST submission returns HTTP `202` with a durable job summary, `Location` and `Retry-After`, not a finished result. Use a stable `Idempotency-Key` for retries of the same payload; changed requests need a new key. Request-body instruction overrides are rejected with `422`: save instruction edits first and bind the resolved snapshot.\n\nPoll the returned location, respecting `Retry-After`, until `succeeded`, `partial`, `failed` or `cancelled`. Paginate targets and separately retrieve canonical episode evidence before interpreting outcomes. Job success can contain an inconclusive model assessment; acceptance or a cache badge alone is not success. The evidence's result payload contains outcome votes\u002Fconfidence, progress\u002FVOC, milestones and failure mode, with run\u002Fresult and saved-input identity on its canonical record.\n\n#### Acceptance response\n\nThe HTTP `202` body is a job summary. This illustrative subset shows acceptance, not a completed judgment:\n\n```json\n{\n  \"id\": \"00000000000000000000000000000001\",\n  \"dataset_id\": \"leisaac-pick-orange\",\n  \"status\": \"queued\",\n  \"total\": 1,\n  \"judged\": 0,\n  \"applied\": 0,\n  \"errors\": 0\n}\n```\n\n`id` identifies the durable job to poll. `total` counts selected targets, `judged` counts successful judgments, `applied` counts applied label contributions and `errors` counts failed judgments. Inspect application status\u002Ferrors separately; judged evidence is not proof that labels were applied.\n\n#### Completed judgment fields\n\nAfter terminal status, GET `\u002Fapi\u002Fjudge\u002Fresults?dataset_id={id}&episode_index={idx}` returns a paginated `{items, total}` response. Each evidence item wraps `result` with `run_id`, `result_id`, saved `input`, runtime `config`, `config_revision`, `applicability` and `applied`. The following example is the composite `JudgeResult` inside `items[].result`, not the POST response (snake_case on the wire, camelCased by the frontend client):\n\n```json\n{\n  \"episode_id\": \"leisaac-pick-orange\u002Fepisode_000007\",\n  \"instruction\": \"Grab orange and place into plate\",\n  \"judge_model\": \"Qwen\u002FQwen3-VL-4B-Instruct\",\n  \"prompt_version\": \"outcome-mcq-v1+gvl-process-v1+milestones-v1+failuremode-v1\",\n  \"n_frames\": 12,\n  \"outcome_success\": true,\n  \"outcome_confidence\": 0.83,\n  \"outcome_n_valid_votes\": 3,\n  \"progress_per_frame\": [0, 9, 18, 27, 36, 45, 55, 64, 73, 82, 91, 100],\n  \"voc\": 0.92,\n  \"milestones\": [\n    {\n      \"name\": \"approach_object\",\n      \"completed\": true,\n      \"frame_range\": \"0-3\",\n      \"evidence\": \"Gripper moves toward the orange in the sampled frames.\"\n    }\n  ],\n  \"failure_mode\": null\n}\n```\n\n| Field                                         | Meaning                                                                                         |\n|-----------------------------------------------|-------------------------------------------------------------------------------------------------|\n| `episode_id`                                  | Dataset-qualified episode identity                                                              |\n| `instruction`                                 | Saved task instruction evaluated by the judge                                                   |\n| `judge_model`, `prompt_version`               | Model and scoring-prompt identity; inspect evidence configuration for the full runtime identity |\n| `n_frames`                                    | Number of sampled frames                                                                        |\n| `outcome_success`                             | `true` for success, `false` for failure, `null` for inconclusive                                |\n| `outcome_confidence`, `outcome_n_valid_votes` | Outcome confidence in 0-1 and number of valid outcome votes                                     |\n| `progress_per_frame`                          | Per-sampled-frame progress in 0-100; a populated curve contains `n_frames` values               |\n| `voc`                                         | Value-order correlation in -1 to 1; it is process-order evidence, not a success probability     |\n| `milestones`                                  | Optional completed-step evidence with sampled-frame ranges; can be empty                        |\n| `failure_mode`                                | Failure attribution when available, otherwise `null`                                            |\n\nThe canonical `result` does not contain `cached`: read that flag from GET episode cache status or the job-status target. Cache status can also expose an optional result, but it is not the canonical evidence\u002Fhistory response. Check evidence `applicability` (`current`, `stale` or `withdrawn`) and saved-input identity before using an outcome.\n\nRead the [backend environment example](..\u002F..\u002F..\u002Fdata-management\u002Fviewer\u002Fbackend\u002F.env.example) for runtime settings, `VLM_JUDGE_JOB_DIR`, `VLM_JUDGE_CAPACITY`, capacity scope and storage permissions. An empty `VLM_JUDGE_CACHE_DIR` disables only the fallback cache, not viewer per-dataset\u002Fsnapshot caches. The [Storage and identity](#storage-and-identity) section distinguishes persistence from cache and export.\n\n### Annotation Endpoints\n\n| Endpoint                                             | Method | Description                            |\n|------------------------------------------------------|--------|----------------------------------------|\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fannotations`      | GET    | Get structured annotations             |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fannotations`      | PUT    | Update structured annotations          |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fannotations`      | DELETE | Remove annotations                     |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fannotations\u002Fauto` | POST   | Trigger auto-annotation                |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fannotations\u002Fsummary`             | GET    | Get annotation summary across episodes |\n\n### Export and Analysis Endpoints\n\n| Endpoint                                   | Method | Description                  |\n|--------------------------------------------|--------|------------------------------|\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fexport`                | POST   | Export dataset with filters  |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fexport\u002Fstream`         | POST   | Stream export                |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fexport\u002Fpreview`        | GET    | Preview export configuration |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fdetect` | POST   | Run object detection         |\n| `\u002Fapi\u002Fanalysis\u002Ftrajectory-quality`         | POST   | Trajectory quality analysis  |\n| `\u002Fapi\u002Fanalysis\u002Fanomaly-detection`          | POST   | Anomaly detection            |\n| `\u002Fapi\u002Fai\u002Fsuggest-annotation`               | POST   | AI-suggested annotations     |\n\nWhen an episode's files can't be read, `GET \u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}`, `detect`, `annotations\u002Fauto` and `export\u002Fpreview` return HTTP 500 with `{\"code\": \"EPISODE_LOAD_FAILED\"}`, and the backend log has the cause.\nA failed export returns `\"error\": \"Export failed\"`, or a `complete` event with `\"success\": false` from the stream; the backend log has the reason.\n\n## Annotation Workflow\n\nAnnotation combines API calls for efficiency with Playwright UI interaction for verification. Use the API for bulk operations and the UI for visual review and spot-checking.\n\n### Annotation surfaces\n\nThe annotation panel exposes three structured surfaces in addition to free-form labels:\n\n| Surface              | Storage                                  | Notes                                                                          |\n|----------------------|------------------------------------------|--------------------------------------------------------------------------------|\n| Labels               | `meta\u002Fepisode_labels.json`               | Free-form tag set with shared dataset-level options                            |\n| Episode annotation   | `EpisodeAnnotation` JSON                 | Task completeness, trajectory quality, data quality, anomalies                 |\n| Language instruction | `EpisodeAnnotation.language_instruction` | Optional VLA payload (instruction, source, paraphrases, subtask decomposition) |\n\n### Multi-camera selection\n\nThe annotation workspace supports multiple selected playback cameras. Read available controls from the current episode; selection is reconciled when media sources change. Video and frame extraction follow their selected sources. Judge `views` are separate saved-input configuration: playback selection does not prove which views a job evaluated.\n\n### Language instruction (VLA annotation)\n\nThe `LanguageInstructionWidget` writes a structured payload through `PUT \u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fannotations`:\n\n| Field                  | Purpose                                                         | Bounds                             |\n|------------------------|-----------------------------------------------------------------|------------------------------------|\n| `instruction`          | Primary natural-language task description                       | 1–1000 chars                       |\n| `source`               | Provenance: `human`, `template`, `llm-generated`, `retroactive` | enum                               |\n| `language`             | BCP-47 language tag, defaults to `en`                           | up to 10 chars                     |\n| `paraphrases`          | Alternative phrasings for data augmentation                     | up to 50 entries, 1000 chars each  |\n| `subtask_instructions` | Ordered subtask decomposition for hierarchical conditioning     | up to 100 entries, 1000 chars each |\n\nWhen a dataset task description is available the widget seeds the instruction with `source = template`; otherwise it creates a blank instruction with `source = human`. The source dropdown allows changing the value at any time.\nA LeRobot export can write the most recently saved instruction as LeRobot rows: the instruction and paraphrases as `task_aug`, and the subtask instructions as one numbered `plan` row at the first frame.\n\n### Step 1 — Analyze trajectory data\n\nFetch episode trajectory data from the API to determine labels programmatically:\n\n```bash\ncurl -s \"http:\u002F\u002Flocalhost:8000\u002Fapi\u002Fdatasets\u002F{dataset_id}\u002Fepisodes\u002F{idx}\" | python3 -c \"\nimport sys, json\nd = json.load(sys.stdin)\ntraj = d['trajectory_data']  # List of frames with joint_positions and timestamps\nprint(f'Frames: {len(traj)}')\nprint(f'First joint positions: {traj[0][\"joint_positions\"][:8]}')\nprint(f'Last joint positions: {traj[-1][\"joint_positions\"][:8]}')\n\"\n```\n\nEpisode trajectory data is a list of frame dictionaries, each containing:\n\n| Field             | Type        | Description                          |\n|-------------------|-------------|--------------------------------------|\n| `timestamp`       | float       | Time in seconds from episode start   |\n| `frame`           | int         | Frame index                          |\n| `joint_positions` | list[float] | Joint positions for all robot joints |\n\nThe `meta` field of the episode response contains `index`, `length`, `task_index`, and `has_annotations`.\n\n### Step 2 — Determine labels from trajectory\n\nAnalyze gripper and joint data at multiple time points to classify episodes. Check the midpoint first, then 25% and 75% for episodes where grasp actions happen earlier or later:\n\nResolve gripper channels and units from the dataset's declared features and verified\ncapture profile before assigning grasp labels. The example below assumes a verified\n16-joint bimanual layout; do not reuse its offsets for single-arm datasets.\n\n```python\n# Example: check grip values at multiple points for robust classification\nfor pct in [25, 50, 75]:\n    idx = int(len(traj) * pct \u002F 100)\n    jp = traj[idx][\"joint_positions\"]\n    right_grip = jp[7]  # Right arm gripper index\n    left_grip = jp[15]  # Left arm gripper index\n```\n\n> [!IMPORTANT]\n> Some episodes have late or early grasp actions, so checking only the midpoint may yield UNKNOWN results. Always check multiple time points (25%, 50%, 75%) and the minimum grip value across the full trajectory for robust classification.\n\n### Step 3 — Apply labels via API\n\nSuccessful PUT requests persist immediately. Label mutations require the latest\ndataset-label ETag in `If-Match`, or `If-None-Match: *` when the GET response has no\nETag yet. Stop and reconcile after HTTP 412; do not overwrite another writer's changes.\n\nThese examples use the launcher's loopback-only development mode with\n`DATAVIEWER_AUTH_DISABLED=true`. Authenticated servers also require authentication\nand CSRF headers; the frontend supplies them automatically.\n\n```bash\ncurl -i -fsS \"http:\u002F\u002Flocalhost:8000\u002Fapi\u002Fdatasets\u002F{dataset_id}\u002Flabels\"\ncurl -fsS -X PUT \"http:\u002F\u002Flocalhost:8000\u002Fapi\u002Fdatasets\u002F{dataset_id}\u002Fepisodes\u002F{idx}\u002Flabels\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H 'If-Match: \"\u003CETag from the GET response>\"' \\\n  -d '{\"labels\": [\"RIGHT\", \"SUCCESS\"]}'\n```\n\nFor bulk annotation, loop over episodes in a script:\n\n```python\nfrom __future__ import annotations\n\nimport json\nfrom urllib.request import Request, urlopen\n\n\ndef annotate(dataset_id: str, episode_idx: int, labels: list[str]) -> dict[str, object]:\n    dataset_url = f\"http:\u002F\u002Flocalhost:8000\u002Fapi\u002Fdatasets\u002F{dataset_id}\"\n    with urlopen(f\"{dataset_url}\u002Flabels\") as response:\n        etag = response.headers.get(\"ETag\")\n    headers = {\"Content-Type\": \"application\u002Fjson\"}\n    headers[\"If-Match\" if etag else \"If-None-Match\"] = etag or \"*\"\n    data = json.dumps({\"labels\": labels}).encode()\n    req = Request(\n        f\"{dataset_url}\u002Fepisodes\u002F{episode_idx}\u002Flabels\",\n        data=data,\n        method=\"PUT\",\n        headers=headers,\n    )\n    with urlopen(req) as response:\n        return json.load(response)\n```\n\n### Step 4 — Verify persisted labels\n\nRead back the saved labels after applying changes:\n\n```bash\ncurl -fsS \"http:\u002F\u002Flocalhost:8000\u002Fapi\u002Fdatasets\u002F{dataset_id}\u002Flabels\"\n```\n\nThe optional `POST \u002Flabels\u002Fsave` endpoint confirms persistence and also requires a\ncurrent revision precondition. It is not needed after a successful PUT.\n\n#### Label storage on disk\n\nIn local storage mode, successful label mutations write inside the dataset's `meta\u002F` directory:\n\n```text\n{DATA_DIR}\u002F{dataset_id}\u002Fmeta\u002Fepisode_labels.json\n```\n\nFor example, with the default dataset path:\n\n```text\ndatasets\u002Fur10e_episodes\u002Fmeta\u002Fepisode_labels.json\n```\n\nFile structure:\n\n```json\n{\n  \"dataset_id\": \"ur10e_episodes\",\n  \"available_labels\": [\"SUCCESS\", \"FAILURE\", \"PARTIAL\", \"LEFT\", \"RIGHT\"],\n  \"episodes\": {\n    \"0\": [\"LEFT\", \"SUCCESS\"],\n    \"1\": [\"RIGHT\", \"SUCCESS\"]\n  }\n}\n```\n\nWhen clearing labels is explicitly requested, send an empty `labels` array through\nthe episode-label PUT endpoint for each selected episode. Use the latest revision\nprecondition for every write and verify the result with GET. Do not overwrite label\nfiles behind a running server.\n\n### Step 5 — Verify in UI with Playwright\n\nAfter applying labels via API, refresh the browser and verify using Playwright:\n\n1. Preserve unsaved drafts before refreshing. Navigate to the app using `navigate_page` or `browser_navigate` on the configured port.\n2. Wait for the episode list using the available provider and take a fresh accessible snapshot.\n3. Take a screenshot to confirm labels appear in the sidebar.\n4. Use label filter buttons in the sidebar to verify counts match expectations.\n5. Click individual episodes and scroll to the \"Episode Labels\" section to verify correct labels are applied.\n\n### Step 6 — Interactive annotation via UI\n\nFor individual episode review or correction:\n\n1. Click an episode button in the sidebar using the current snapshot.\n2. Scroll to \"Episode Labels\" through the provider or the agent's `scrollIntoView` example.\n3. Toggle requested labels (SUCCESS, FAILURE, PARTIAL or custom labels); clicking a selected label removes it.\n4. Click \"Save Episode\", wait for acknowledgment and independently GET the saved resources. Resolve partial saves and HTTP 412 before continuing.\n5. Use the separate \"Next Episode\" control after persistence is verified. Retain unrelated and unmounted drafts.\n\nBefore judging, check saved-input readiness for every selected target and validation sample under the current source and principal. A clean active episode does not establish readiness elsewhere. Failed refreshes retain drafts and do not authorize work from stale acknowledgments. Interpret metadata warnings by source; HTTP 200, local-origin listings or provider availability do not prove Blob metadata synchronization.\n\nThe Edit Tools trajectory editor adjusts state channels per frame, labelled with the dataset's own channel names, and the trajectory plot previews each adjustment.\nAdjustments belong to the recorded frame under the playhead; after frames are removed or inserted, the editor names that recorded frame, and an inserted frame can't be adjusted directly.\nHDF5 exports keep the recorded joint positions as `data\u002Fqpos` and add the adjustments beside them as `data\u002Fqpos_adjusted`, with `data\u002Fqpos_adjusted_mask` marking the edited rows and the adjustment list in the episode's `.meta.json`.\nVelocities, actions and the other exported arrays stay as recorded.\n\nLeRobot v3.0 sources whose camera features are non-depth videos, including sim captures, export to a new LeRobot v3.0 dataset at the output path; datasets with image features or depth video are refused. That path must be new or empty and outside the source; an existing empty directory, such as a mount point, is kept.\nThe export locks the directory with a hidden `.dataviewer-export.lock` file and stages in a hidden `.dataviewer-export.partial` directory, so a second export to the same directory fails while the first runs.\nIf the backend stops mid-export, or an export fails and can't remove what it moved, the next export to that directory cleans up first. It removes the earlier export's staging and the moved files that still match the identities that export recorded, and keeps a dataset whose move finished. Anything else stays, and exports there fail until it's removed.\nThe cleanup never follows links and ignores a record whose paths don't describe a staged dataset. On Windows it leaves the earlier export's files, so remove them, including `.dataviewer-export.partial`, before exporting there again.\nLeRobot exports need a filesystem with file locking; on one without, the export fails and can leave an empty `.dataviewer-export.lock`.\nThe export keeps `observation.state` and every other supported recorded feature, and adds adjustments as `adjusted.observation.state` with `adjusted.observation.state_mask`. The `adjusted.` prefix keeps both out of LeRobot policy inputs.\nRemoving or inserting frames renumbers `frame_index` and `timestamp`. `dataviewer-export.json` maps every output frame to its source frame and records the edits and remapped subtasks.\nSubtasks shrink to the frames that survive the edits, and a LeRobot export also writes each one as a LeRobot `subtask` row in `language_persistent`, starting at its first output frame.\nLeRobot keeps a subtask active until the next one starts, so frames between two subtasks read as the earlier one; `dataviewer-export.json` keeps the exact ranges.\nOpening an export shows its subtasks in the editor: LeRobot rows run until the next one starts, and HDF5 `.subtasks.json` files keep exact ranges. Re-exporting keeps unchanged subtasks as recorded, writes changed ones in their place, and removes them when all are deleted; a saved draft takes precedence. `dataviewer-export.json` records `subtasks` as `null` when the export kept the recorded ones and `[]` when it removed them.\nRecorded language annotations move with the edited frames, apart from rows the exported subtasks or language instructions replace. Clearing **Include subtasks as LeRobot subtask annotations** in the export dialog leaves your subtask changes out; recorded annotations are still exported. For HDF5 the option reads **Include subtask metadata**, and clearing it still carries a recorded `.subtasks.json` forward.\nA LeRobot export has language columns when its source has them or when an exported episode gets subtask or language-instruction rows.\n**Include language instructions as LeRobot task phrasings and plan**, on by default for LeRobot sources, writes each episode's most recently saved language instruction as `task_aug` and `plan` rows that replace the recorded ones; `dataviewer-export.json` records whose instruction was used.\nAPI exports through `\u002Fexport` and `\u002Fexport\u002Fstream` include them too, unless the request body sets `\"includeLanguageInstructions\": false`.\nEach export is a separate dataset. LeRobot merges datasets only when their features match, so a cropped or adjusted export won't merge with an unedited one.\n\n## Frontend UI Structure\n\nThe React app has these key areas for browser automation:\n\n| Area               | Selector Pattern                                     | Description                                                 |\n|--------------------|------------------------------------------------------|-------------------------------------------------------------|\n| Dataset catalog    | Region \"Dataset catalog\", combobox \"Filter datasets\" | Browse\u002Ffilter datasets; inspect stale warnings              |\n| Dataset disclosure | Button \"Dataset\", dialog \"Select dataset\"            | Choose current dataset entries                              |\n| Dataset batch      | Region \"Dataset workspace\" and its disclosure        | Targets, validation samples, approvals, jobs and withdrawal |\n| Episode sidebar    | Current episode button roles\u002Fnames within `aside`    | Select actual episode IDs and label filters                 |\n| Main workspace     | `main`, Playback frame slider and camera controls    | Annotation and multi-camera playback                        |\n| Save\u002Fnavigation    | \"Save Episode\", \"Previous Episode\", \"Next Episode\"   | Separate persistence\u002Fnavigation with busy\u002Fstatus states     |\n| Analysis           | \"Expand Episode Analysis\", region \"Judge assessment\" | Episode judge controls when available                       |\n| Workspace return   | \"Return to episode\" when present                     | Return while preserving retained drafts                     |\n\nUse fresh roles\u002Fnames, not fixed header selectors or heading-based clicks. Observe disabled, denied and checking-access states without enabling features merely to make controls appear. Check affected keyboard navigation, focus restoration, live-region announcements and narrow-layout reflow; visual inspection alone is not accessibility acceptance.\n\n## Troubleshooting\n\n| Issue                                    | Solution                                                                                                                              |\n|------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| Backend fails to start                   | Recreate the locked environment with `cd backend && uv sync --frozen --python 3.12 --group dev --extra analysis --extra export`       |\n| Frontend shows \"Loading...\" indefinitely | Verify backend is healthy: `curl http:\u002F\u002Flocalhost:8000\u002Fhealth`                                                                        |\n| No datasets visible                      | Check `DATA_DIR` in `backend\u002F.env` points to a directory with dataset subdirectories                                                  |\n| \"The episode's files couldn't be read\"   | The API returned 500 `EPISODE_LOAD_FAILED`; the backend log names the file and error                                                  |\n| Export reports \"Export failed\"           | Check the backend log: another export may be writing there, the directory may not be new or empty, or file locking may be unavailable |\n| Port conflict                            | Set `BACKEND_PORT` or `FRONTEND_PORT` environment variables                                                                           |\n| CORS errors                              | Backend allows localhost ports 5173-5177; check the frontend port is in range                                                         |\n| Labels not persisted after restart       | Check the PUT response; resolve any HTTP 412 revision conflict, then verify the saved labels with GET                                 |\n| Playwright opens separate Chrome window  | For the MCP background workflow, use `--headless`; reconfigure\u002Frestart only with authority                                            |\n| Snapshot refs stale after navigation     | Take a fresh `read_page` or `browser_snapshot` before clicking                                                                        |\n| Slider not responding to automation      | Use the agent's native input setter fallback as a state probe, not keyboard acceptance                                                |\n| Sidebar not scrolling                    | Use the agent's `aside ul` scrolling example through the available evaluation tool                                                    |\n\n## VLM-as-Judge Workflow\n\nThe VLM judge scores each episode with an outcome MCQ (success\u002Ffail with N-sample self-consistency), process reward (per-frame progress + Spearman VOC), milestone decomposition and failure-mode attribution. Viewer and CLI share evaluator code, not automatically storage or identity.\n\n### Storage and identity\n\n| Surface               | Purpose                                          | Boundary                                                                     |\n|-----------------------|--------------------------------------------------|------------------------------------------------------------------------------|\n| Inference cache       | Disposable optimization                          | Viewer jobs select per-dataset\u002Fsnapshot caches independently of fallback     |\n| Durable jobs\u002Fevidence | Restart-safe lifecycle, approvals and provenance | Local job root or Azure dataset-container job store; source\u002Fprincipal scoped |\n| JSONL export          | Portable result export with run\u002Fresult IDs       | Not a job store, approval or proof of viewer reuse                           |\n\nCLI local defaults use the dataset parent's `.curation\u002Fjudge`; viewer local defaults use `DATA_DIR\u002F.curation\u002Fjudge`. Azure viewer jobs use the dataset container. Keep durable stores on persistent writable storage separate from scratch cache.\n\nCross-client reuse requires matching canonical dataset\u002Fsource, principal scope, saved author\u002Frevision\u002Fsnapshot, media identity\u002Fwindows and runtime configuration (model revision, prompt, views and scoring settings), plus access to the same canonical evidence store. Prove matching run\u002Fresult and snapshot identity through a CLI-to-viewer evidence read. Matching model names, a cache badge or JSONL filename is insufficient.\n\n### Enable the judge\n\nPass the judge settings through the launcher's child environment. Store them in\n`backend\u002F.env` only when persistent defaults are explicitly requested:\n\n```env\nDATA_DIR=\u002Fabs\u002Fpath\u002Fto\u002Fdatasets\nDATAVIEWER_AUTH_DISABLED=true\n\nVLM_JUDGE_ENABLED=true\nVLM_JUDGE_BACKEND=echo                        # echo | qwen3-vl | openai-compat\nVLM_JUDGE_MODEL_ID=Qwen\u002FQwen3-VL-4B-Instruct\nVLM_JUDGE_N_FRAMES=12\nVLM_JUDGE_CACHE_DIR=outputs\u002Fvlm-judge\u002Fcache\n```\n\n> [!IMPORTANT]\n> Restart only an owned, authorized backend after changing launch settings. Code reload does not refresh environment variables. Require `vlm_judge_enabled` from capabilities before submission; do not enable the judge for read-only inspection. Approve downloads and remote transmission of frames\u002Fsaved instructions before inference.\n\n### Backends at a glance\n\n| Backend         | Use case                         | Notes                                                                           |\n|-----------------|----------------------------------|---------------------------------------------------------------------------------|\n| `echo`          | UI smoke \u002F wiring tests          | Deterministic stub, no GPU, no network                                          |\n| `qwen3-vl`      | Local HF inference               | Requires approved pinned weights and target GPU\u002Fruntime validation              |\n| `openai-compat` | vLLM \u002F NVIDIA NIM \u002F Azure OpenAI | Set `VLM_JUDGE_BASE_URL` (+ `VLM_JUDGE_API_KEY` if needed); identical code path |\n\n### UI workflow (Trajectory tab)\n\n1. Open or reuse the dataviewer page on the configured port.\n2. Choose a dataset, select an episode and switch to **Trajectory**.\n3. Expand **Episode Analysis** and locate **Judge assessment**. A \"VLM Judge\" heading may instead identify an unavailable state.\n4. Observe checking, disabled and denied states. If authorized and ready, save edits, verify read-back and resolve the saved snapshot before clicking **Run judge**.\n5. Track the durable job to terminal status, then read canonical evidence\u002Fapplicability before interpreting the outcome badge, progress, VOC, milestones and failure mode.\n6. **Force fresh** bypasses inference cache, not saved-input or approval checks. Judge-only evidence does not apply labels.\n\n### Browser UI verification\n\nUse a fresh `read_page` or `browser_snapshot`, then click current accessible controls. With `run_playwright_code`, a locator-based pattern is:\n\n```javascript\nconst assessment = page.getByRole('region', { name: 'Judge assessment' });\nawait assessment.scrollIntoViewIfNeeded();\nawait assessment.getByRole('button', { name: 'Run judge', exact: true }).click();\n```\n\nUse that pattern only when submission is authorized and the control is available. Do not force clicks or use an unavailable-state heading to find the action. After terminal status and evidence read-back, wait for the evidence's outcome text through the provider:\n\n```text\nWait for SUCCESS, FAILURE or Inconclusive, matching the retrieved evidence.\n```\n\n### Direct API calls (curl \u002F Python)\n\nAuthenticated POST requires authentication and CSRF headers; the frontend hook handles those. Keep credentials\u002Fcookies outside Git and model-visible output. The example below uses loopback-only development with `DATAVIEWER_AUTH_DISABLED=true`, one actual inventory ID and an approved saved instruction:\n\n```bash\nAPI=http:\u002F\u002Flocalhost:8000\nDATASET_ID='\u003Cdataset-id>'\nEPISODE_ID='\u003Cactual-episode-id>'\nEPISODE_URL=\"$API\u002Fapi\u002Fdatasets\u002F$DATASET_ID\u002Fepisodes\u002F$EPISODE_ID\u002Fjudge\"\nSNAPSHOT_ID=$(curl -fsS \"$EPISODE_URL\u002Fsnapshot\" | jq -r .snapshot_id)\nREQUEST_ID='\u003Cstable-request-id>'\ncurl -fsS \"$EPISODE_URL\" | jq\ncurl -i -fsS -X POST \"$EPISODE_URL\" \\\n  -H 'Content-Type: application\u002Fjson' -H \"Idempotency-Key: $REQUEST_ID\" \\\n  -d \"$(jq -n --arg snapshot \"$SNAPSHOT_ID\" '{snapshot_id: $snapshot, force: false}')\"\n```\n\nRead `Location` and `Retry-After` from acceptance, poll that location through the client's polling facility until terminal and retrieve canonical evidence separately:\n\n```bash\nJOB_ID='\u003Caccepted-job-id>'\ncurl -fsS \"$API\u002Fapi\u002Fjudge\u002Fjobs\u002F$JOB_ID\" | jq\ncurl -fsS --get \"$API\u002Fapi\u002Fjudge\u002Fresults\" \\\n  --data-urlencode \"dataset_id=$DATASET_ID\" \\\n  --data-urlencode \"episode_index=$EPISODE_ID\" | jq\n```\n\nPaginate status\u002Fresults as needed. `404` indicates missing\u002Finaccessible resources; `422` indicates invalid input including instruction overrides; `409` requires saved-state\u002Fconfiguration reconciliation. Never report `202` as inference success.\n\n### Single-episode CLI smoke (no dataviewer needed)\n\nUse the already-restored viewer backend environment with its judge profile. `--no-sync` avoids installing dependencies. Set `DATASET` to an approved isolated fixture, `EPISODE_ID` to one actual inventory ID, and `JOB_DIR`\u002F`OUTPUT` to isolated paths. Commands write durable state and exports; do not test on user datasets without permission.\n\n```bash\nuv run --project data-management\u002Fviewer\u002Fbackend --no-sync python -m physical_ai_curation.run \\\n  --dataset \"$DATASET\" --indices \"$EPISODE_ID\" \\\n  --single --mode judge --backend echo --n-frames 6 \\\n  --job-dir \"$JOB_DIR\" --request-id \"$REQUEST_ID\" --output \"$OUTPUT\"\n```\n\nInspect terminal status and use `--operation results --episode-index \"$EPISODE_ID\"` with matching dataset\u002Fprincipal\u002Fstore arguments to retrieve evidence. Echo proves wiring, not model quality or GPU readiness. Never issue repeated single submissions to bypass dataset approval.\n\n### Bulk evaluation via the CLI\n\n1. Enumerate actual target and sample IDs from dataset metadata, not a count-derived range. HTTP users can paginate `\u002Fapi\u002Fjudge\u002Fepisodes`, retaining its inventory revision across pages.\n2. Save human sample annotations. Resolve saved `annotation_author_id`, `annotation_revision` and `snapshot_id` with the matching saved-input resolver. Use viewer snapshot references for CLI only after proving source\u002Fprincipal identity equivalence. Store a JSON object keyed by actual sample episode ID; each value contains exactly those three non-empty fields. Drafts or guessed revisions are not valid references.\n3. Define `SAMPLE_IDS`\u002F`TARGET_IDS` as comma-separated actual IDs, `SAMPLE_REFERENCES` as the saved JSON path and `PRINCIPAL_ID` as the matching scope. Keep shared runtime arguments unchanged throughout sample, approval and batch. For real inference, replace echo with the approved backend and pinned model\u002Fruntime before sampling; an echo approval does not approve another runtime.\n\n```bash\nJUDGE_ARGS=(--dataset \"$DATASET\" --job-dir \"$JOB_DIR\" \\\n  --principal-scope-id \"$PRINCIPAL_ID\" --backend echo --n-frames 6)\nuv run --project data-management\u002Fviewer\u002Fbackend --no-sync python -m physical_ai_curation.run \"${JUDGE_ARGS[@]}\" \\\n  --mode sample --indices \"$SAMPLE_IDS\" --sample-references \"$SAMPLE_REFERENCES\" \\\n  --request-id \"$SAMPLE_REQUEST_ID\" --output \"$SAMPLE_OUTPUT\"\n```\n\nRead the returned sample job ID, terminal status and evidence for each sample. Compare with saved human outcomes and review disagreements\u002Finconclusive evidence. Only after explicit review, approve the sample job. Add `--acknowledge-exceptions` only when the reviewer explicitly accepts those exceptions.\n\n```bash\nuv run --project data-management\u002Fviewer\u002Fbackend --no-sync python -m physical_ai_curation.run \"${JUDGE_ARGS[@]}\" \\\n  --operation approve --job-id \"$SAMPLE_JOB_ID\"\n```\n\nRead the returned approval `id` and submit the selected batch. Judge mode produces evidence only; `--mode judge-and-label` additionally requires explicit label-write authority.\n\n```bash\nuv run --project data-management\u002Fviewer\u002Fbackend --no-sync python -m physical_ai_curation.run \"${JUDGE_ARGS[@]}\" \\\n  --mode judge --indices \"$TARGET_IDS\" --approval-id \"$APPROVAL_ID\" \\\n  --request-id \"$BATCH_REQUEST_ID\" --output \"$BATCH_OUTPUT\"\n```\n\nIf approval is stale, stop, refresh saved inputs\u002Fconfiguration, rerun samples and review a new approval. Do not force or fan out single submissions. HTTP follows the same sequence: sample POST `\u002Fapi\u002Fjudge\u002Fjobs` with `episode_indices`, `samples` and `snapshot_ids`, review evidence, POST `\u002Fjobs\u002F{id}\u002Fapprove`, then submit judge\u002Fjudge-and-label with `approval_id` and current snapshots. Dataset submissions require `Idempotency-Key`.\n\nDataset wrappers and the standalone HTTP launcher live under `data-management\u002Fcuration\u002Fscripts\u002F`. They are conveniences, not approval bypasses. Inspect their accepted lifecycle arguments before use; fall back to the generic CLI when a wrapper cannot carry the required selection, references or approval. Policy-rollout inference stays under `evaluation\u002Fvlm_judge\u002Fscripts\u002F` and does not expose curation operations.\n\n### Status, cancellation and restart recovery\n\nUse the same dataset\u002Fprincipal\u002Fjob root with `--operation status --job-id`, `--operation cancel --job-id` or `--operation retry --job-id`. Status describes saved work, not worker health. Cancellation fences queued\u002Frunning work and queued application; saved evidence remains. Retry queues eligible failed\u002Fcancelled targets in partial, failed or cancelled jobs; the worker revalidates saved inputs\u002Fapproval during execution. Withdrawn jobs cannot be retried.\n\nSubmit\u002Fretry normally runs a local worker until terminal and exports available results. `--detach` returns acceptance only and requires a matching `--operation worker` process. Client interruption is not cancellation. After restart, inspect the existing job before resubmitting; retain durable storage and allow worker lease recovery rather than deleting jobs. Workers sharing inference capacity must use the same store, capacity limit and scope.\n\n### Apply or withdraw AI labels\n\nAfter reviewing evidence and obtaining label-write authority, use HTTP `\u002Fjobs\u002F{id}\u002Fapply` (optionally selected `episode_indices`) or CLI `--operation apply --job-id`. Application has separate counts\u002Ferrors and conditional persistence: verify saved labels and provenance independently. Judge-only success is not applied-label success.\n\nFor requested withdrawal, obtain CLI `--operation reset-preview` or HTTP `\u002Fresets\u002Fpreview`; review affected AI-applied labels and conflicts, then confirm that exact preview with `--operation reset-confirm --preview-id` or HTTP `\u002Fresets`. Read `reset-status` and use `reset-retry` for eligible failures. A stale\u002Fchanged preview requires a new preview and confirmation.\n\nWithdrawal selectively removes AI-applied values while preserving human edits and retained evidence\u002Fhistory; do not clear all labels or delete cache\u002Fjob files as a substitute.\n\n### Verification and reporting\n\nUse isolated echo cases for single acceptance\u002Fpolling\u002Fevidence, approved batch, stale approval rejection and preview-bound withdrawal preserving human edits\u002Fhistory. Prove CLI-to-viewer reuse with matching canonical evidence identity. Source inspection alone does not claim these cases executed.\n\nFor behavior changes, follow scoped viewer guidance: failing-first tests, focused grouped development checks and configured gates after coherent changes. Use frozen dependencies and isolated storage, without changing user `.env` or restarting user-owned services for evidence.\n\nReport terminal judged\u002Fapplied\u002Ferror counts, evidence applicability, runtime\u002Fmodel\u002Fprompt identity and output paths. Separate unit\u002Fstatic, real-HTTP, browser collection, native browser execution, simulation, assistive-technology and target GPU evidence. Missing prerequisites remain explicit gaps; prior passing counts or browser collection do not close unexecuted acceptance gates.\n\n> Brought to you by physical-ai-toolchain\n","# Dataviewer Skill\n\nLaunch and interact with the Dataset Analysis Tool, a full-stack application for analyzing and annotating robotic training data from episode-based datasets. Complete requested operations with persistence read-back; job acceptance is not inference completion or label application.\n\n## Prerequisites\n\n| Platform | Requirement                                                                                                           |\n|----------|-----------------------------------------------------------------------------------------------------------------------|\n| All      | Python 3.12+, Node.js 24+, npm, `uv`                                                                                  |\n| All      | `ffmpeg` on `PATH` outside the backend container, for HDF5 camera video (OpenCV also works) and LeRobot episode clips |\n\nThe backend virtual environment and repository-root npm workspace dependencies are auto-created on first launch by `start.sh`.\n\n## Launch and Connect Workflow\n\nFollow these steps when a launch is required and authorized. Inspect existing terminals\u002Ftask output first and reuse healthy services with matching configuration. Read-only inspection does not authorize restarts, inference or dataset writes. Use VS Code tasks for an already configured development session; use the launcher for requested overrides and readiness checks.\n\nWhen a caller or workflow supplies the URL of a Dataviewer it already runs, such as the instance the Sim Workspace Command Center opens for a workspace, skip Step 1 and open that URL in Step 2. Start `start.sh` only when no running instance is supplied, so one dataset folder never gets a second Dataviewer.\n\n### Step 1 — Start the app\n\nLaunch `start.sh` as a background terminal process. The script prints `[OK] Both services are running` and the URLs when both services are healthy.\n\nUse `.\u002Fstart.sh --check` to check installed launch prerequisites without starting or installing services. The launcher binds both services to loopback, requires the selected frontend port and returns failure when either service fails readiness.\n\n```bash\ncd data-management\u002Fviewer && .\u002Fstart.sh\n```\n\nWith a custom dataset path:\n\n```bash\ncd data-management\u002Fviewer && .\u002Fstart.sh --data-dir \u002Fpath\u002Fto\u002Fdatasets\n```\n\n### Step 2 — Open the app in the browser\n\nAfter confirming both services are running (look for `[OK] Backend is healthy` in terminal output), or when a running URL was supplied, open the frontend with the integrated browser's `open_browser_page` tool:\n\n```text\nopen_browser_page(\"http:\u002F\u002Flocalhost:5173\")\n```\n\nSimpleBrowser is the visual interface for the user when that provider is available. Configured headless Playwright automation runs in the background. Native browser tools can operate a shared page directly; separate browser sessions share persisted backend state, not necessarily unsaved drafts.\nUse the supplied URL, or substitute a non-default `FRONTEND_PORT` for `5173`.\n\n### Step 3 — Load browser automation tools\n\nUse the host's tool search to discover available browser capabilities before calling deferred tools. Native tools include `read_page`, `run_playwright_code`, `navigate_page`, `click_element`, `type_in_page` and `screenshot_page`. Use those when available; an equivalent native read does not require MCP reconfiguration.\n\nDrive the UI with whichever browser tool family the host provides:\n\n| Tool family        | Tools                                                                                                                        | How it works                                       |\n|--------------------|------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------|\n| Integrated browser | `open_browser_page`, `navigate_page`, `read_page`, `click_element`, `type_in_page`, `run_playwright_code`, `screenshot_page` | Acts on the page the user sees                     |\n| Playwright MCP     | `browser_snapshot`, `browser_navigate`, `browser_click`, `browser_type`, `browser_evaluate`, `browser_take_screenshot`       | Acts headlessly on a separate copy of the same URL |\n\nFor the Playwright MCP background workflow, configure **headless mode** so it does not open a separate browser window. Its visual feedback goes through SimpleBrowser (Step 2). In the Copilot harness (the Copilot session target in VS Code, Copilot CLI, and the Copilot app), a workspace-root `.mcp.json` can use:\n\n```json\n\u002F\u002F .mcp.json\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\"@playwright\u002Fmcp@latest\", \"--headless\"],\n      \"tools\": [\"*\"]\n    }\n  }\n}\n```\n\n`\"tools\": [\"*\"]` exposes every server tool. Narrow it to the actions this skill uses (`browser_snapshot`, `browser_navigate`, `browser_click`, `browser_type`, `browser_evaluate`, `browser_take_screenshot`), and pin a reviewed `@playwright\u002Fmcp` version instead of `@latest`, because the server drives browser sessions that may be signed in. Local agent sessions in VS Code read `.vscode\u002Fmcp.json` instead, with the same server entry under a `servers` key and without the `tools` field.\n\n> [!IMPORTANT]\n> Use `--headless` for the MCP background workflow. Reconfiguring or installing a browser provider requires approval; do not change it merely to obtain inspection evidence.\n\nSearch by capability using the host's available tool-search schema, for example:\n\n```text\nFind browser tools to read an accessible page snapshot, navigate, click, type and capture screenshots.\n```\n\nIf no suitable provider is available, report the limit and guide manual inspection. When the user chooses the configured MCP provider, they can run **MCP: Start Server** then select **playwright** in the Command Palette. An empty tool search alone does not prove that a server is stopped.\n\n### Step 4 — Interact with the UI\n\nBoth tool families see the same backend state, so API-driven changes (labels, annotations) appear in both.\n\n| Action             | Integrated browser    | Playwright MCP            | Notes                                         |\n|--------------------|-----------------------|---------------------------|-----------------------------------------------|\n| Capture page state | `read_page`           | `browser_snapshot`        | Inspect current accessible roles\u002Fnames        |\n| Navigate to URL    | `navigate_page`       | `browser_navigate`        | Preserve unsaved drafts before reload         |\n| Click an element   | `click_element`       | `browser_click`           | Use current snapshot refs and names           |\n| Type into input    | `type_in_page`        | `browser_type`            | For dataset filters or label inputs           |\n| Run a script       | `run_playwright_code` | `browser_evaluate`        | For sliders, scrolling and multi-step checks  |\n| Take a screenshot  | `screenshot_page`     | `browser_take_screenshot` | Appearance, not persistence or keyboard proof |\n\nTake a fresh accessible snapshot before click\u002Ftype actions and refresh refs after content changes. Use the [Frontend UI Structure](#frontend-ui-structure) below to orient; forced DOM clicks are not keyboard accessibility evidence.\n\n## Quick Start\n\nStart the dataviewer with the default dataset path:\n\n```bash\ncd data-management\u002Fviewer && .\u002Fstart.sh\n```\n\nStart with a custom dataset path:\n\n```bash\ncd data-management\u002Fviewer && .\u002Fstart.sh --data-dir \u002Fpath\u002Fto\u002Fdatasets\n```\n\n## Parameters Reference\n\n| Parameter        | Default                                      | Description                                 |\n|------------------|----------------------------------------------|---------------------------------------------|\n| `DATA_DIR`       | `..\u002F..\u002F..\u002Fdatasets` (relative to `backend\u002F`) | Directory containing dataset subdirectories |\n| `BACKEND_PORT`   | `8000`                                       | FastAPI backend port                        |\n| `FRONTEND_PORT`  | `5173`                                       | Vite frontend dev server port               |\n| `HEALTH_TIMEOUT` | `30`                                         | Seconds to wait for backend health check    |\n\n### Dataset Path Configuration\n\nThe `DATA_DIR` environment variable controls which datasets are visible in the app. Each subdirectory under this path is treated as a separate `dataset_id`.\n\nUse one of these methods to set `DATA_DIR`.\n\n### Launch argument\n\nUse this method for workflow handoff and ad-hoc sessions:\n\n```bash\n.\u002Fstart.sh --data-dir \u002Fpath\u002Fto\u002Fdatasets\n```\n\n### Backend environment file\n\nUse this method only when a persistent local default is requested:\n\n```env\nDATA_DIR=\u002Fpath\u002Fto\u002Fdatasets\n```\n\n### Session environment\n\nUse this method for a shell-scoped override:\n\n```bash\nexport DATA_DIR=\u002Fpath\u002Fto\u002Fdatasets\ncd data-management\u002Fviewer && .\u002Fstart.sh\n```\n\nPersist a path in `backend\u002F.env` only when the user explicitly requests a local default\nacross restarts. Do not mutate `.env` for a profile-bound workflow handoff. The workflow\nowns the viewer child and passes the manifest's exact dataset parent through\n`--data-dir`.\n\nWhen `accepted-dataset.json` exists, verify the dataset capabilities before browser\ninspection. Require the returned dataset ID, output adapter\u002Fversion, viewer adapter,\nprofile ID\u002Fhash, capture-provenance hash, export-validation hash, capture features, and\nsensor roles to match the descriptor.\n\nRead the [accepted-dataset contract reference](..\u002F..\u002F..\u002Fdata-management\u002Fviewer\u002FREADME.md#-accepted-dataset-contract)\nfor the descriptor schema, artifact integrity checks, and invalid-contract behavior.\n\n## Architecture\n\n```text\ndata-management\u002Fviewer\u002F\n├── start.sh              # Orchestrator: launches backend + frontend\n├── backend\u002F\n│   ├── .env              # DATA_DIR and test config\n│   ├── pyproject.toml    # Python dependencies (uv)\n│   └── src\u002Fapi\u002F\n│       ├── main.py       # FastAPI app, CORS, router registration\n│       ├── routers\u002F      # REST endpoints: datasets, annotations, labels, export, detection, analysis\n│       ├── routes\u002F       # AI analysis routes\n│       ├── services\u002F     # Business logic and dataset service\n│       ├── models\u002F       # Pydantic models\n│       └── storage\u002F      # Persistence layer\n├── frontend\u002F\n│   ├── vite.config.ts    # Dev server + API proxy to :8000\n│   └── src\u002F\n│       ├── App.tsx       # Root: dataset selector, episode list, annotation workspace\n│       ├── api\u002F          # HTTP client and typed API functions\n│       ├── components\u002F   # UI components (annotation, dashboard, episode viewer, export)\n│       ├── hooks\u002F        # React Query hooks for datasets, episodes, annotations\n│       ├── stores\u002F       # Zustand stores for episode and dataset state\n│       └── types\u002F        # TypeScript type definitions\n```\n\n## API Reference\n\n### Core Endpoints\n\n| Endpoint                                           | Method | Description                                                                               |\n|----------------------------------------------------|--------|-------------------------------------------------------------------------------------------|\n| `\u002Fhealth`                                          | GET    | Health check                                                                              |\n| `\u002Fapi\u002Fdatasets`                                    | GET    | List all datasets                                                                         |\n| `\u002Fapi\u002Fdatasets\u002F{id}`                               | GET    | Get dataset metadata                                                                      |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fcapabilities`                  | GET    | Get format support, optional feature availability, and verified accepted-dataset contract |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes`                      | GET    | List episodes in a dataset                                                                |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}`                | GET    | Get episode data with trajectory and metadata                                             |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Ftrajectory`     | GET    | Get trajectory data only                                                                  |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fframes\u002F{frame}` | GET    | Get a single frame image                                                                  |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fcameras`        | GET    | List available camera views                                                               |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fvideo\u002F{camera}` | GET    | Stream video for a camera                                                                 |\n| `http:\u002F\u002Flocalhost:8000\u002Fdocs`                       | GET    | Swagger UI documentation                                                                  |\n\n### Label Endpoints\n\n| Endpoint                                   | Method | Description                                           |\n|--------------------------------------------|--------|-------------------------------------------------------|\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Flabels`                | GET    | Get all episode labels and available label options    |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Flabels\u002Foptions`        | GET    | List available label options                          |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Flabels\u002Foptions`        | POST   | Add a new label option (`{\"label\": \"NAME\"}`)          |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Flabels` | GET    | Get labels for one episode                            |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Flabels` | PUT    | Set labels for one episode (`{\"labels\": [\"A\", \"B\"]}`) |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Flabels\u002Fsave`           | POST   | Persist all labels to disk                            |\n\n### VLM-as-Judge Endpoints\n\n> [!NOTE]\n> Mounted only when `VLM_JUDGE_ENABLED=true`. Dataset capabilities advertise this\n> state, and the frontend does not request an episode judge status while disabled.\n\n| Endpoint                                                 | Method | Description                                                                                   |\n|----------------------------------------------------------|--------|-----------------------------------------------------------------------------------------------|\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fjudge\u002Fsnapshot`       | GET    | Resolve saved inputs and snapshot identity; optionally select `annotation_author_id`          |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fjudge`                | GET    | Current configuration\u002Fcache status and optional cached inference payload; not durable history |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fjudge`                | POST   | Accept one job with saved `snapshot_id`, optional author, `views`, `process_method`, `force`  |\n| `\u002Fapi\u002Fjudge\u002Fepisodes?dataset_id={id}`                    | GET    | Paginated actual episode IDs and inventory revision                                           |\n| `\u002Fapi\u002Fjudge\u002Fjobs`                                        | POST   | Accept a sample or approved dataset job                                                       |\n| `\u002Fapi\u002Fjudge\u002Fjobs\u002F{job_id}`                               | GET    | Durable status, counts and paginated targets                                                  |\n| `\u002Fapi\u002Fjudge\u002Fjobs\u002F{job_id}\u002Fapprove`                       | POST   | Approve reviewed sample evidence\u002Fconfiguration                                                |\n| `\u002Fapi\u002Fjudge\u002Fjobs\u002F{job_id}\u002Fcancel`                        | POST   | Cancel pending work without deleting saved evidence                                           |\n| `\u002Fapi\u002Fjudge\u002Fjobs\u002F{job_id}\u002Fretry`                         | POST   | Retry eligible unfinished work after revalidation                                             |\n| `\u002Fapi\u002Fjudge\u002Fjobs\u002F{job_id}\u002Fapply`                         | POST   | Explicit label application, optionally selected episode IDs                                   |\n| `\u002Fapi\u002Fjudge\u002Fresults?dataset_id={id}&episode_index={idx}` | GET    | Canonical evidence with current\u002Fstale\u002Fwithdrawn applicability                                 |\n| `\u002Fapi\u002Fjudge\u002Fapprovals?dataset_id={id}`                   | GET    | Saved approvals for the current principal                                                     |\n| `\u002Fapi\u002Fjudge\u002Fresets\u002Fpreview`                              | POST   | Preview removal of AI-applied labels                                                          |\n| `\u002Fapi\u002Fjudge\u002Fresets`                                      | POST   | Confirm a reviewed `preview_id`                                                               |\n| `\u002Fapi\u002Fjudge\u002Fresets?dataset_id={id}`                      | GET    | Withdrawal status                                                                             |\n| `\u002Fapi\u002Fjudge\u002Fresets\u002Fretry`                                | POST   | Retry eligible withdrawal work                                                                |\n\nPOST submission returns HTTP `202` with a durable job summary, `Location` and `Retry-After`, not a finished result. Use a stable `Idempotency-Key` for retries of the same payload; changed requests need a new key. Request-body instruction overrides are rejected with `422`: save instruction edits first and bind the resolved snapshot.\n\nPoll the returned location, respecting `Retry-After`, until `succeeded`, `partial`, `failed` or `cancelled`. Paginate targets and separately retrieve canonical episode evidence before interpreting outcomes. Job success can contain an inconclusive model assessment; acceptance or a cache badge alone is not success. The evidence's result payload contains outcome votes\u002Fconfidence, progress\u002FVOC, milestones and failure mode, with run\u002Fresult and saved-input identity on its canonical record.\n\n#### Acceptance response\n\nThe HTTP `202` body is a job summary. This illustrative subset shows acceptance, not a completed judgment:\n\n```json\n{\n  \"id\": \"00000000000000000000000000000001\",\n  \"dataset_id\": \"leisaac-pick-orange\",\n  \"status\": \"queued\",\n  \"total\": 1,\n  \"judged\": 0,\n  \"applied\": 0,\n  \"errors\": 0\n}\n```\n\n`id` identifies the durable job to poll. `total` counts selected targets, `judged` counts successful judgments, `applied` counts applied label contributions and `errors` counts failed judgments. Inspect application status\u002Ferrors separately; judged evidence is not proof that labels were applied.\n\n#### Completed judgment fields\n\nAfter terminal status, GET `\u002Fapi\u002Fjudge\u002Fresults?dataset_id={id}&episode_index={idx}` returns a paginated `{items, total}` response. Each evidence item wraps `result` with `run_id`, `result_id`, saved `input`, runtime `config`, `config_revision`, `applicability` and `applied`. The following example is the composite `JudgeResult` inside `items[].result`, not the POST response (snake_case on the wire, camelCased by the frontend client):\n\n```json\n{\n  \"episode_id\": \"leisaac-pick-orange\u002Fepisode_000007\",\n  \"instruction\": \"Grab orange and place into plate\",\n  \"judge_model\": \"Qwen\u002FQwen3-VL-4B-Instruct\",\n  \"prompt_version\": \"outcome-mcq-v1+gvl-process-v1+milestones-v1+failuremode-v1\",\n  \"n_frames\": 12,\n  \"outcome_success\": true,\n  \"outcome_confidence\": 0.83,\n  \"outcome_n_valid_votes\": 3,\n  \"progress_per_frame\": [0, 9, 18, 27, 36, 45, 55, 64, 73, 82, 91, 100],\n  \"voc\": 0.92,\n  \"milestones\": [\n    {\n      \"name\": \"approach_object\",\n      \"completed\": true,\n      \"frame_range\": \"0-3\",\n      \"evidence\": \"Gripper moves toward the orange in the sampled frames.\"\n    }\n  ],\n  \"failure_mode\": null\n}\n```\n\n| Field                                         | Meaning                                                                                         |\n|-----------------------------------------------|-------------------------------------------------------------------------------------------------|\n| `episode_id`                                  | Dataset-qualified episode identity                                                              |\n| `instruction`                                 | Saved task instruction evaluated by the judge                                                   |\n| `judge_model`, `prompt_version`               | Model and scoring-prompt identity; inspect evidence configuration for the full runtime identity |\n| `n_frames`                                    | Number of sampled frames                                                                        |\n| `outcome_success`                             | `true` for success, `false` for failure, `null` for inconclusive                                |\n| `outcome_confidence`, `outcome_n_valid_votes` | Outcome confidence in 0-1 and number of valid outcome votes                                     |\n| `progress_per_frame`                          | Per-sampled-frame progress in 0-100; a populated curve contains `n_frames` values               |\n| `voc`                                         | Value-order correlation in -1 to 1; it is process-order evidence, not a success probability     |\n| `milestones`                                  | Optional completed-step evidence with sampled-frame ranges; can be empty                        |\n| `failure_mode`                                | Failure attribution when available, otherwise `null`                                            |\n\nThe canonical `result` does not contain `cached`: read that flag from GET episode cache status or the job-status target. Cache status can also expose an optional result, but it is not the canonical evidence\u002Fhistory response. Check evidence `applicability` (`current`, `stale` or `withdrawn`) and saved-input identity before using an outcome.\n\nRead the [backend environment example](..\u002F..\u002F..\u002Fdata-management\u002Fviewer\u002Fbackend\u002F.env.example) for runtime settings, `VLM_JUDGE_JOB_DIR`, `VLM_JUDGE_CAPACITY`, capacity scope and storage permissions. An empty `VLM_JUDGE_CACHE_DIR` disables only the fallback cache, not viewer per-dataset\u002Fsnapshot caches. The [Storage and identity](#storage-and-identity) section distinguishes persistence from cache and export.\n\n### Annotation Endpoints\n\n| Endpoint                                             | Method | Description                            |\n|------------------------------------------------------|--------|----------------------------------------|\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fannotations`      | GET    | Get structured annotations             |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fannotations`      | PUT    | Update structured annotations          |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fannotations`      | DELETE | Remove annotations                     |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fannotations\u002Fauto` | POST   | Trigger auto-annotation                |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fannotations\u002Fsummary`             | GET    | Get annotation summary across episodes |\n\n### Export and Analysis Endpoints\n\n| Endpoint                                   | Method | Description                  |\n|--------------------------------------------|--------|------------------------------|\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fexport`                | POST   | Export dataset with filters  |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fexport\u002Fstream`         | POST   | Stream export                |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fexport\u002Fpreview`        | GET    | Preview export configuration |\n| `\u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fdetect` | POST   | Run object detection         |\n| `\u002Fapi\u002Fanalysis\u002Ftrajectory-quality`         | POST   | Trajectory quality analysis  |\n| `\u002Fapi\u002Fanalysis\u002Fanomaly-detection`          | POST   | Anomaly detection            |\n| `\u002Fapi\u002Fai\u002Fsuggest-annotation`               | POST   | AI-suggested annotations     |\n\nWhen an episode's files can't be read, `GET \u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}`, `detect`, `annotations\u002Fauto` and `export\u002Fpreview` return HTTP 500 with `{\"code\": \"EPISODE_LOAD_FAILED\"}`, and the backend log has the cause.\nA failed export returns `\"error\": \"Export failed\"`, or a `complete` event with `\"success\": false` from the stream; the backend log has the reason.\n\n## Annotation Workflow\n\nAnnotation combines API calls for efficiency with Playwright UI interaction for verification. Use the API for bulk operations and the UI for visual review and spot-checking.\n\n### Annotation surfaces\n\nThe annotation panel exposes three structured surfaces in addition to free-form labels:\n\n| Surface              | Storage                                  | Notes                                                                          |\n|----------------------|------------------------------------------|--------------------------------------------------------------------------------|\n| Labels               | `meta\u002Fepisode_labels.json`               | Free-form tag set with shared dataset-level options                            |\n| Episode annotation   | `EpisodeAnnotation` JSON                 | Task completeness, trajectory quality, data quality, anomalies                 |\n| Language instruction | `EpisodeAnnotation.language_instruction` | Optional VLA payload (instruction, source, paraphrases, subtask decomposition) |\n\n### Multi-camera selection\n\nThe annotation workspace supports multiple selected playback cameras. Read available controls from the current episode; selection is reconciled when media sources change. Video and frame extraction follow their selected sources. Judge `views` are separate saved-input configuration: playback selection does not prove which views a job evaluated.\n\n### Language instruction (VLA annotation)\n\nThe `LanguageInstructionWidget` writes a structured payload through `PUT \u002Fapi\u002Fdatasets\u002F{id}\u002Fepisodes\u002F{idx}\u002Fannotations`:\n\n| Field                  | Purpose                                                         | Bounds                             |\n|------------------------|-----------------------------------------------------------------|------------------------------------|\n| `instruction`          | Primary natural-language task description                       | 1–1000 chars                       |\n| `source`               | Provenance: `human`, `template`, `llm-generated`, `retroactive` | enum                               |\n| `language`             | BCP-47 language tag, defaults to `en`                           | up to 10 chars                     |\n| `paraphrases`          | Alternative phrasings for data augmentation                     | up to 50 entries, 1000 chars each  |\n| `subtask_instructions` | Ordered subtask decomposition for hierarchical conditioning     | up to 100 entries, 1000 chars each |\n\nWhen a dataset task description is available the widget seeds the instruction with `source = template`; otherwise it creates a blank instruction with `source = human`. The source dropdown allows changing the value at any time.\nA LeRobot export can write the most recently saved instruction as LeRobot rows: the instruction and paraphrases as `task_aug`, and the subtask instructions as one numbered `plan` row at the first frame.\n\n### Step 1 — Analyze trajectory data\n\nFetch episode trajectory data from the API to determine labels programmatically:\n\n```bash\ncurl -s \"http:\u002F\u002Flocalhost:8000\u002Fapi\u002Fdatasets\u002F{dataset_id}\u002Fepisodes\u002F{idx}\" | python3 -c \"\nimport sys, json\nd = json.load(sys.stdin)\ntraj = d['trajectory_data']  # List of frames with joint_positions and timestamps\nprint(f'Frames: {len(traj)}')\nprint(f'First joint positions: {traj[0][\"joint_positions\"][:8]}')\nprint(f'Last joint positions: {traj[-1][\"joint_positions\"][:8]}')\n\"\n```\n\nEpisode trajectory data is a list of frame dictionaries, each containing:\n\n| Field             | Type        | Description                          |\n|-------------------|-------------|--------------------------------------|\n| `timestamp`       | float       | Time in seconds from episode start   |\n| `frame`           | int         | Frame index                          |\n| `joint_positions` | list[float] | Joint positions for all robot joints |\n\nThe `meta` field of the episode response contains `index`, `length`, `task_index`, and `has_annotations`.\n\n### Step 2 — Determine labels from trajectory\n\nAnalyze gripper and joint data at multiple time points to classify episodes. Check the midpoint first, then 25% and 75% for episodes where grasp actions happen earlier or later:\n\nResolve gripper channels and units from the dataset's declared features and verified\ncapture profile before assigning grasp labels. The example below assumes a verified\n16-joint bimanual layout; do not reuse its offsets for single-arm datasets.\n\n```python\n# Example: check grip values at multiple points for robust classification\nfor pct in [25, 50, 75]:\n    idx = int(len(traj) * pct \u002F 100)\n    jp = traj[idx][\"joint_positions\"]\n    right_grip = jp[7]  # Right arm gripper index\n    left_grip = jp[15]  # Left arm gripper index\n```\n\n> [!IMPORTANT]\n> Some episodes have late or early grasp actions, so checking only the midpoint may yield UNKNOWN results. Always check multiple time points (25%, 50%, 75%) and the minimum grip value across the full trajectory for robust classification.\n\n### Step 3 — Apply labels via API\n\nSuccessful PUT requests persist immediately. Label mutations require the latest\ndataset-label ETag in `If-Match`, or `If-None-Match: *` when the GET response has no\nETag yet. Stop and reconcile after HTTP 412; do not overwrite another writer's changes.\n\nThese examples use the launcher's loopback-only development mode with\n`DATAVIEWER_AUTH_DISABLED=true`. Authenticated servers also require authentication\nand CSRF headers; the frontend supplies them automatically.\n\n```bash\ncurl -i -fsS \"http:\u002F\u002Flocalhost:8000\u002Fapi\u002Fdatasets\u002F{dataset_id}\u002Flabels\"\ncurl -fsS -X PUT \"http:\u002F\u002Flocalhost:8000\u002Fapi\u002Fdatasets\u002F{dataset_id}\u002Fepisodes\u002F{idx}\u002Flabels\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H 'If-Match: \"\u003CETag from the GET response>\"' \\\n  -d '{\"labels\": [\"RIGHT\", \"SUCCESS\"]}'\n```\n\nFor bulk annotation, loop over episodes in a script:\n\n```python\nfrom __future__ import annotations\n\nimport json\nfrom urllib.request import Request, urlopen\n\n\ndef annotate(dataset_id: str, episode_idx: int, labels: list[str]) -> dict[str, object]:\n    dataset_url = f\"http:\u002F\u002Flocalhost:8000\u002Fapi\u002Fdatasets\u002F{dataset_id}\"\n    with urlopen(f\"{dataset_url}\u002Flabels\") as response:\n        etag = response.headers.get(\"ETag\")\n    headers = {\"Content-Type\": \"application\u002Fjson\"}\n    headers[\"If-Match\" if etag else \"If-None-Match\"] = etag or \"*\"\n    data = json.dumps({\"labels\": labels}).encode()\n    req = Request(\n        f\"{dataset_url}\u002Fepisodes\u002F{episode_idx}\u002Flabels\",\n        data=data,\n        method=\"PUT\",\n        headers=headers,\n    )\n    with urlopen(req) as response:\n        return json.load(response)\n```\n\n### Step 4 — Verify persisted labels\n\nRead back the saved labels after applying changes:\n\n```bash\ncurl -fsS \"http:\u002F\u002Flocalhost:8000\u002Fapi\u002Fdatasets\u002F{dataset_id}\u002Flabels\"\n```\n\nThe optional `POST \u002Flabels\u002Fsave` endpoint confirms persistence and also requires a\ncurrent revision precondition. It is not needed after a successful PUT.\n\n#### Label storage on disk\n\nIn local storage mode, successful label mutations write inside the dataset's `meta\u002F` directory:\n\n```text\n{DATA_DIR}\u002F{dataset_id}\u002Fmeta\u002Fepisode_labels.json\n```\n\nFor example, with the default dataset path:\n\n```text\ndatasets\u002Fur10e_episodes\u002Fmeta\u002Fepisode_labels.json\n```\n\nFile structure:\n\n```json\n{\n  \"dataset_id\": \"ur10e_episodes\",\n  \"available_labels\": [\"SUCCESS\", \"FAILURE\", \"PARTIAL\", \"LEFT\", \"RIGHT\"],\n  \"episodes\": {\n    \"0\": [\"LEFT\", \"SUCCESS\"],\n    \"1\": [\"RIGHT\", \"SUCCESS\"]\n  }\n}\n```\n\nWhen clearing labels is explicitly requested, send an empty `labels` array through\nthe episode-label PUT endpoint for each selected episode. Use the latest revision\nprecondition for every write and verify the result with GET. Do not overwrite label\nfiles behind a running server.\n\n### Step 5 — Verify in UI with Playwright\n\nAfter applying labels via API, refresh the browser and verify using Playwright:\n\n1. Preserve unsaved drafts before refreshing. Navigate to the app using `navigate_page` or `browser_navigate` on the configured port.\n2. Wait for the episode list using the available provider and take a fresh accessible snapshot.\n3. Take a screenshot to confirm labels appear in the sidebar.\n4. Use label filter buttons in the sidebar to verify counts match expectations.\n5. Click individual episodes and scroll to the \"Episode Labels\" section to verify correct labels are applied.\n\n### Step 6 — Interactive annotation via UI\n\nFor individual episode review or correction:\n\n1. Click an episode button in the sidebar using the current snapshot.\n2. Scroll to \"Episode Labels\" through the provider or the agent's `scrollIntoView` example.\n3. Toggle requested labels (SUCCESS, FAILURE, PARTIAL or custom labels); clicking a selected label removes it.\n4. Click \"Save Episode\", wait for acknowledgment and independently GET the saved resources. Resolve partial saves and HTTP 412 before continuing.\n5. Use the separate \"Next Episode\" control after persistence is verified. Retain unrelated and unmounted drafts.\n\nBefore judging, check saved-input readiness for every selected target and validation sample under the current source and principal. A clean active episode does not establish readiness elsewhere. Failed refreshes retain drafts and do not authorize work from stale acknowledgments. Interpret metadata warnings by source; HTTP 200, local-origin listings or provider availability do not prove Blob metadata synchronization.\n\nThe Edit Tools trajectory editor adjusts state channels per frame, labelled with the dataset's own channel names, and the trajectory plot previews each adjustment.\nAdjustments belong to the recorded frame under the playhead; after frames are removed or inserted, the editor names that recorded frame, and an inserted frame can't be adjusted directly.\nHDF5 exports keep the recorded joint positions as `data\u002Fqpos` and add the adjustments beside them as `data\u002Fqpos_adjusted`, with `data\u002Fqpos_adjusted_mask` marking the edited rows and the adjustment list in the episode's `.meta.json`.\nVelocities, actions and the other exported arrays stay as recorded.\n\nLeRobot v3.0 sources whose camera features are non-depth videos, including sim captures, export to a new LeRobot v3.0 dataset at the output path; datasets with image features or depth video are refused. That path must be new or empty and outside the source; an existing empty directory, such as a mount point, is kept.\nThe export locks the directory with a hidden `.dataviewer-export.lock` file and stages in a hidden `.dataviewer-export.partial` directory, so a second export to the same directory fails while the first runs.\nIf the backend stops mid-export, or an export fails and can't remove what it moved, the next export to that directory cleans up first. It removes the earlier export's staging and the moved files that still match the identities that export recorded, and keeps a dataset whose move finished. Anything else stays, and exports there fail until it's removed.\nThe cleanup never follows links and ignores a record whose paths don't describe a staged dataset. On Windows it leaves the earlier export's files, so remove them, including `.dataviewer-export.partial`, before exporting there again.\nLeRobot exports need a filesystem with file locking; on one without, the export fails and can leave an empty `.dataviewer-export.lock`.\nThe export keeps `observation.state` and every other supported recorded feature, and adds adjustments as `adjusted.observation.state` with `adjusted.observation.state_mask`. The `adjusted.` prefix keeps both out of LeRobot policy inputs.\nRemoving or inserting frames renumbers `frame_index` and `timestamp`. `dataviewer-export.json` maps every output frame to its source frame and records the edits and remapped subtasks.\nSubtasks shrink to the frames that survive the edits, and a LeRobot export also writes each one as a LeRobot `subtask` row in `language_persistent`, starting at its first output frame.\nLeRobot keeps a subtask active until the next one starts, so frames between two subtasks read as the earlier one; `dataviewer-export.json` keeps the exact ranges.\nOpening an export shows its subtasks in the editor: LeRobot rows run until the next one starts, and HDF5 `.subtasks.json` files keep exact ranges. Re-exporting keeps unchanged subtasks as recorded, writes changed ones in their place, and removes them when all are deleted; a saved draft takes precedence. `dataviewer-export.json` records `subtasks` as `null` when the export kept the recorded ones and `[]` when it removed them.\nRecorded language annotations move with the edited frames, apart from rows the exported subtasks or language instructions replace. Clearing **Include subtasks as LeRobot subtask annotations** in the export dialog leaves your subtask changes out; recorded annotations are still exported. For HDF5 the option reads **Include subtask metadata**, and clearing it still carries a recorded `.subtasks.json` forward.\nA LeRobot export has language columns when its source has them or when an exported episode gets subtask or language-instruction rows.\n**Include language instructions as LeRobot task phrasings and plan**, on by default for LeRobot sources, writes each episode's most recently saved language instruction as `task_aug` and `plan` rows that replace the recorded ones; `dataviewer-export.json` records whose instruction was used.\nAPI exports through `\u002Fexport` and `\u002Fexport\u002Fstream` include them too, unless the request body sets `\"includeLanguageInstructions\": false`.\nEach export is a separate dataset. LeRobot merges datasets only when their features match, so a cropped or adjusted export won't merge with an unedited one.\n\n## Frontend UI Structure\n\nThe React app has these key areas for browser automation:\n\n| Area               | Selector Pattern                                     | Description                                                 |\n|--------------------|------------------------------------------------------|-------------------------------------------------------------|\n| Dataset catalog    | Region \"Dataset catalog\", combobox \"Filter datasets\" | Browse\u002Ffilter datasets; inspect stale warnings              |\n| Dataset disclosure | Button \"Dataset\", dialog \"Select dataset\"            | Choose current dataset entries                              |\n| Dataset batch      | Region \"Dataset workspace\" and its disclosure        | Targets, validation samples, approvals, jobs and withdrawal |\n| Episode sidebar    | Current episode button roles\u002Fnames within `aside`    | Select actual episode IDs and label filters                 |\n| Main workspace     | `main`, Playback frame slider and camera controls    | Annotation and multi-camera playback                        |\n| Save\u002Fnavigation    | \"Save Episode\", \"Previous Episode\", \"Next Episode\"   | Separate persistence\u002Fnavigation with busy\u002Fstatus states     |\n| Analysis           | \"Expand Episode Analysis\", region \"Judge assessment\" | Episode judge controls when available                       |\n| Workspace return   | \"Return to episode\" when present                     | Return while preserving retained drafts                     |\n\nUse fresh roles\u002Fnames, not fixed header selectors or heading-based clicks. Observe disabled, denied and checking-access states without enabling features merely to make controls appear. Check affected keyboard navigation, focus restoration, live-region announcements and narrow-layout reflow; visual inspection alone is not accessibility acceptance.\n\n## Troubleshooting\n\n| Issue                                    | Solution                                                                                                                              |\n|------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| Backend fails to start                   | Recreate the locked environment with `cd backend && uv sync --frozen --python 3.12 --group dev --extra analysis --extra export`       |\n| Frontend shows \"Loading...\" indefinitely | Verify backend is healthy: `curl http:\u002F\u002Flocalhost:8000\u002Fhealth`                                                                        |\n| No datasets visible                      | Check `DATA_DIR` in `backend\u002F.env` points to a directory with dataset subdirectories                                                  |\n| \"The episode's files couldn't be read\"   | The API returned 500 `EPISODE_LOAD_FAILED`; the backend log names the file and error                                                  |\n| Export reports \"Export failed\"           | Check the backend log: another export may be writing there, the directory may not be new or empty, or file locking may be unavailable |\n| Port conflict                            | Set `BACKEND_PORT` or `FRONTEND_PORT` environment variables                                                                           |\n| CORS errors                              | Backend allows localhost ports 5173-5177; check the frontend port is in range                                                         |\n| Labels not persisted after restart       | Check the PUT response; resolve any HTTP 412 revision conflict, then verify the saved labels with GET                                 |\n| Playwright opens separate Chrome window  | For the MCP background workflow, use `--headless`; reconfigure\u002Frestart only with authority                                            |\n| Snapshot refs stale after navigation     | Take a fresh `read_page` or `browser_snapshot` before clicking                                                                        |\n| Slider not responding to automation      | Use the agent's native input setter fallback as a state probe, not keyboard acceptance                                                |\n| Sidebar not scrolling                    | Use the agent's `aside ul` scrolling example through the available evaluation tool                                                    |\n\n## VLM-as-Judge Workflow\n\nThe VLM judge scores each episode with an outcome MCQ (success\u002Ffail with N-sample self-consistency), process reward (per-frame progress + Spearman VOC), milestone decomposition and failure-mode attribution. Viewer and CLI share evaluator code, not automatically storage or identity.\n\n### Storage and identity\n\n| Surface               | Purpose                                          | Boundary                                                                     |\n|-----------------------|--------------------------------------------------|------------------------------------------------------------------------------|\n| Inference cache       | Disposable optimization                          | Viewer jobs select per-dataset\u002Fsnapshot caches independently of fallback     |\n| Durable jobs\u002Fevidence | Restart-safe lifecycle, approvals and provenance | Local job root or Azure dataset-container job store; source\u002Fprincipal scoped |\n| JSONL export          | Portable result export with run\u002Fresult IDs       | Not a job store, approval or proof of viewer reuse                           |\n\nCLI local defaults use the dataset parent's `.curation\u002Fjudge`; viewer local defaults use `DATA_DIR\u002F.curation\u002Fjudge`. Azure viewer jobs use the dataset container. Keep durable stores on persistent writable storage separate from scratch cache.\n\nCross-client reuse requires matching canonical dataset\u002Fsource, principal scope, saved author\u002Frevision\u002Fsnapshot, media identity\u002Fwindows and runtime configuration (model revision, prompt, views and scoring settings), plus access to the same canonical evidence store. Prove matching run\u002Fresult and snapshot identity through a CLI-to-viewer evidence read. Matching model names, a cache badge or JSONL filename is insufficient.\n\n### Enable the judge\n\nPass the judge settings through the launcher's child environment. Store them in\n`backend\u002F.env` only when persistent defaults are explicitly requested:\n\n```env\nDATA_DIR=\u002Fabs\u002Fpath\u002Fto\u002Fdatasets\nDATAVIEWER_AUTH_DISABLED=true\n\nVLM_JUDGE_ENABLED=true\nVLM_JUDGE_BACKEND=echo                        # echo | qwen3-vl | openai-compat\nVLM_JUDGE_MODEL_ID=Qwen\u002FQwen3-VL-4B-Instruct\nVLM_JUDGE_N_FRAMES=12\nVLM_JUDGE_CACHE_DIR=outputs\u002Fvlm-judge\u002Fcache\n```\n\n> [!IMPORTANT]\n> Restart only an owned, authorized backend after changing launch settings. Code reload does not refresh environment variables. Require `vlm_judge_enabled` from capabilities before submission; do not enable the judge for read-only inspection. Approve downloads and remote transmission of frames\u002Fsaved instructions before inference.\n\n### Backends at a glance\n\n| Backend         | Use case                         | Notes                                                                           |\n|-----------------|----------------------------------|---------------------------------------------------------------------------------|\n| `echo`          | UI smoke \u002F wiring tests          | Deterministic stub, no GPU, no network                                          |\n| `qwen3-vl`      | Local HF inference               | Requires approved pinned weights and target GPU\u002Fruntime validation              |\n| `openai-compat` | vLLM \u002F NVIDIA NIM \u002F Azure OpenAI | Set `VLM_JUDGE_BASE_URL` (+ `VLM_JUDGE_API_KEY` if needed); identical code path |\n\n### UI workflow (Trajectory tab)\n\n1. Open or reuse the dataviewer page on the configured port.\n2. Choose a dataset, select an episode and switch to **Trajectory**.\n3. Expand **Episode Analysis** and locate **Judge assessment**. A \"VLM Judge\" heading may instead identify an unavailable state.\n4. Observe checking, disabled and denied states. If authorized and ready, save edits, verify read-back and resolve the saved snapshot before clicking **Run judge**.\n5. Track the durable job to terminal status, then read canonical evidence\u002Fapplicability before interpreting the outcome badge, progress, VOC, milestones and failure mode.\n6. **Force fresh** bypasses inference cache, not saved-input or approval checks. Judge-only evidence does not apply labels.\n\n### Browser UI verification\n\nUse a fresh `read_page` or `browser_snapshot`, then click current accessible controls. With `run_playwright_code`, a locator-based pattern is:\n\n```javascript\nconst assessment = page.getByRole('region', { name: 'Judge assessment' });\nawait assessment.scrollIntoViewIfNeeded();\nawait assessment.getByRole('button', { name: 'Run judge', exact: true }).click();\n```\n\nUse that pattern only when submission is authorized and the control is available. Do not force clicks or use an unavailable-state heading to find the action. After terminal status and evidence read-back, wait for the evidence's outcome text through the provider:\n\n```text\nWait for SUCCESS, FAILURE or Inconclusive, matching the retrieved evidence.\n```\n\n### Direct API calls (curl \u002F Python)\n\nAuthenticated POST requires authentication and CSRF headers; the frontend hook handles those. Keep credentials\u002Fcookies outside Git and model-visible output. The example below uses loopback-only development with `DATAVIEWER_AUTH_DISABLED=true`, one actual inventory ID and an approved saved instruction:\n\n```bash\nAPI=http:\u002F\u002Flocalhost:8000\nDATASET_ID='\u003Cdataset-id>'\nEPISODE_ID='\u003Cactual-episode-id>'\nEPISODE_URL=\"$API\u002Fapi\u002Fdatasets\u002F$DATASET_ID\u002Fepisodes\u002F$EPISODE_ID\u002Fjudge\"\nSNAPSHOT_ID=$(curl -fsS \"$EPISODE_URL\u002Fsnapshot\" | jq -r .snapshot_id)\nREQUEST_ID='\u003Cstable-request-id>'\ncurl -fsS \"$EPISODE_URL\" | jq\ncurl -i -fsS -X POST \"$EPISODE_URL\" \\\n  -H 'Content-Type: application\u002Fjson' -H \"Idempotency-Key: $REQUEST_ID\" \\\n  -d \"$(jq -n --arg snapshot \"$SNAPSHOT_ID\" '{snapshot_id: $snapshot, force: false}')\"\n```\n\nRead `Location` and `Retry-After` from acceptance, poll that location through the client's polling facility until terminal and retrieve canonical evidence separately:\n\n```bash\nJOB_ID='\u003Caccepted-job-id>'\ncurl -fsS \"$API\u002Fapi\u002Fjudge\u002Fjobs\u002F$JOB_ID\" | jq\ncurl -fsS --get \"$API\u002Fapi\u002Fjudge\u002Fresults\" \\\n  --data-urlencode \"dataset_id=$DATASET_ID\" \\\n  --data-urlencode \"episode_index=$EPISODE_ID\" | jq\n```\n\nPaginate status\u002Fresults as needed. `404` indicates missing\u002Finaccessible resources; `422` indicates invalid input including instruction overrides; `409` requires saved-state\u002Fconfiguration reconciliation. Never report `202` as inference success.\n\n### Single-episode CLI smoke (no dataviewer needed)\n\nUse the already-restored viewer backend environment with its judge profile. `--no-sync` avoids installing dependencies. Set `DATASET` to an approved isolated fixture, `EPISODE_ID` to one actual inventory ID, and `JOB_DIR`\u002F`OUTPUT` to isolated paths. Commands write durable state and exports; do not test on user datasets without permission.\n\n```bash\nuv run --project data-management\u002Fviewer\u002Fbackend --no-sync python -m physical_ai_curation.run \\\n  --dataset \"$DATASET\" --indices \"$EPISODE_ID\" \\\n  --single --mode judge --backend echo --n-frames 6 \\\n  --job-dir \"$JOB_DIR\" --request-id \"$REQUEST_ID\" --output \"$OUTPUT\"\n```\n\nInspect terminal status and use `--operation results --episode-index \"$EPISODE_ID\"` with matching dataset\u002Fprincipal\u002Fstore arguments to retrieve evidence. Echo proves wiring, not model quality or GPU readiness. Never issue repeated single submissions to bypass dataset approval.\n\n### Bulk evaluation via the CLI\n\n1. Enumerate actual target and sample IDs from dataset metadata, not a count-derived range. HTTP users can paginate `\u002Fapi\u002Fjudge\u002Fepisodes`, retaining its inventory revision across pages.\n2. Save human sample annotations. Resolve saved `annotation_author_id`, `annotation_revision` and `snapshot_id` with the matching saved-input resolver. Use viewer snapshot references for CLI only after proving source\u002Fprincipal identity equivalence. Store a JSON object keyed by actual sample episode ID; each value contains exactly those three non-empty fields. Drafts or guessed revisions are not valid references.\n3. Define `SAMPLE_IDS`\u002F`TARGET_IDS` as comma-separated actual IDs, `SAMPLE_REFERENCES` as the saved JSON path and `PRINCIPAL_ID` as the matching scope. Keep shared runtime arguments unchanged throughout sample, approval and batch. For real inference, replace echo with the approved backend and pinned model\u002Fruntime before sampling; an echo approval does not approve another runtime.\n\n```bash\nJUDGE_ARGS=(--dataset \"$DATASET\" --job-dir \"$JOB_DIR\" \\\n  --principal-scope-id \"$PRINCIPAL_ID\" --backend echo --n-frames 6)\nuv run --project data-management\u002Fviewer\u002Fbackend --no-sync python -m physical_ai_curation.run \"${JUDGE_ARGS[@]}\" \\\n  --mode sample --indices \"$SAMPLE_IDS\" --sample-references \"$SAMPLE_REFERENCES\" \\\n  --request-id \"$SAMPLE_REQUEST_ID\" --output \"$SAMPLE_OUTPUT\"\n```\n\nRead the returned sample job ID, terminal status and evidence for each sample. Compare with saved human outcomes and review disagreements\u002Finconclusive evidence. Only after explicit review, approve the sample job. Add `--acknowledge-exceptions` only when the reviewer explicitly accepts those exceptions.\n\n```bash\nuv run --project data-management\u002Fviewer\u002Fbackend --no-sync python -m physical_ai_curation.run \"${JUDGE_ARGS[@]}\" \\\n  --operation approve --job-id \"$SAMPLE_JOB_ID\"\n```\n\nRead the returned approval `id` and submit the selected batch. Judge mode produces evidence only; `--mode judge-and-label` additionally requires explicit label-write authority.\n\n```bash\nuv run --project data-management\u002Fviewer\u002Fbackend --no-sync python -m physical_ai_curation.run \"${JUDGE_ARGS[@]}\" \\\n  --mode judge --indices \"$TARGET_IDS\" --approval-id \"$APPROVAL_ID\" \\\n  --request-id \"$BATCH_REQUEST_ID\" --output \"$BATCH_OUTPUT\"\n```\n\nIf approval is stale, stop, refresh saved inputs\u002Fconfiguration, rerun samples and review a new approval. Do not force or fan out single submissions. HTTP follows the same sequence: sample POST `\u002Fapi\u002Fjudge\u002Fjobs` with `episode_indices`, `samples` and `snapshot_ids`, review evidence, POST `\u002Fjobs\u002F{id}\u002Fapprove`, then submit judge\u002Fjudge-and-label with `approval_id` and current snapshots. Dataset submissions require `Idempotency-Key`.\n\nDataset wrappers and the standalone HTTP launcher live under `data-management\u002Fcuration\u002Fscripts\u002F`. They are conveniences, not approval bypasses. Inspect their accepted lifecycle arguments before use; fall back to the generic CLI when a wrapper cannot carry the required selection, references or approval. Policy-rollout inference stays under `evaluation\u002Fvlm_judge\u002Fscripts\u002F` and does not expose curation operations.\n\n### Status, cancellation and restart recovery\n\nUse the same dataset\u002Fprincipal\u002Fjob root with `--operation status --job-id`, `--operation cancel --job-id` or `--operation retry --job-id`. Status describes saved work, not worker health. Cancellation fences queued\u002Frunning work and queued application; saved evidence remains. Retry queues eligible failed\u002Fcancelled targets in partial, failed or cancelled jobs; the worker revalidates saved inputs\u002Fapproval during execution. Withdrawn jobs cannot be retried.\n\nSubmit\u002Fretry normally runs a local worker until terminal and exports available results. `--detach` returns acceptance only and requires a matching `--operation worker` process. Client interruption is not cancellation. After restart, inspect the existing job before resubmitting; retain durable storage and allow worker lease recovery rather than deleting jobs. Workers sharing inference capacity must use the same store, capacity limit and scope.\n\n### Apply or withdraw AI labels\n\nAfter reviewing evidence and obtaining label-write authority, use HTTP `\u002Fjobs\u002F{id}\u002Fapply` (optionally selected `episode_indices`) or CLI `--operation apply --job-id`. Application has separate counts\u002Ferrors and conditional persistence: verify saved labels and provenance independently. Judge-only success is not applied-label success.\n\nFor requested withdrawal, obtain CLI `--operation reset-preview` or HTTP `\u002Fresets\u002Fpreview`; review affected AI-applied labels and conflicts, then confirm that exact preview with `--operation reset-confirm --preview-id` or HTTP `\u002Fresets`. Read `reset-status` and use `reset-retry` for eligible failures. A stale\u002Fchanged preview requires a new preview and confirmation.\n\nWithdrawal selectively removes AI-applied values while preserving human edits and retained evidence\u002Fhistory; do not clear all labels or delete cache\u002Fjob files as a substitute.\n\n### Verification and reporting\n\nUse isolated echo cases for single acceptance\u002Fpolling\u002Fevidence, approved batch, stale approval rejection and preview-bound withdrawal preserving human edits\u002Fhistory. Prove CLI-to-viewer reuse with matching canonical evidence identity. Source inspection alone does not claim these cases executed.\n\nFor behavior changes, follow scoped viewer guidance: failing-first tests, focused grouped development checks and configured gates after coherent changes. Use frozen dependencies and isolated storage, without changing user `.env` or restarting user-owned services for evidence.\n\nReport terminal judged\u002Fapplied\u002Ferror counts, evidence applicability, runtime\u002Fmodel\u002Fprompt identity and output paths. Separate unit\u002Fstatic, real-HTTP, browser collection, native browser execution, simulation, assistive-technology and target GPU evidence. Missing prerequisites remain explicit gaps; prior passing counts or browser collection do not close unexecuted acceptance gates.\n\n> Brought to you by physical-ai-toolchain\n",{"name":5,"description":7},"main","e15a97f765c004fa06a15a68853ec488fdd33de0",".github\u002Fskills\u002Fdataviewer",72,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fphysical-ai-toolchain","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-14 17:25:41",{"source":9,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add microsoft\u002Fphysical-ai-toolchain --skill dataviewer",{"tool":60,"command":61},"bunx","bunx skills add microsoft\u002Fphysical-ai-toolchain --skill dataviewer",{"tool":63,"command":64},"pnpm","pnpm dlx skills add microsoft\u002Fphysical-ai-toolchain --skill dataviewer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fphysical-ai-toolchain\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fdataviewer\u002FSKILL.md",true,[68],{"path":69,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002FPLAYWRIGHT.md","REFERENCE","参考文档",6036,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fphysical-ai-toolchain\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fdataviewer\u002Freferences\u002FPLAYWRIGHT.md",[75,83,90,97,104,111],{"skillNo":76,"name":77,"nameZh":17,"description":78,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":82},"01M78JTQEPW7M3HRGHF4SBB2P4","submit-lerobot-training","Submit a LeRobot imitation learning training job to OSMO with configurable policy, dataset, and Azure ML logging. Use when the user runs \u002Fsubmit-lerobot-training.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fphysical-ai-toolchain\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fsubmit-lerobot-training\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":84,"name":85,"nameZh":17,"description":86,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":82},"01M78JTMTZY0EDECA60C6C9TR3","start-dataviewer","Launch the dataviewer app with an optional dataset path, open it in the browser, and optionally run a VLM judge smoke pass. Use when the user runs \u002Fstart-dataviewer.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fphysical-ai-toolchain\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fstart-dataviewer\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":17,"description":93,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":82},"01M78JT7VKCVSEM8N7SR67973R","dataviewer-annotate","One-shot: launch the dataviewer with the VLM judge enabled and run the multi-step VLM-as-judge pipeline across an entire dataset. Use when the user runs \u002Fdataviewer-annotate.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fphysical-ai-toolchain\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fdataviewer-annotate\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":17,"description":100,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":82},"01M78JT5SY9QXT8X7KQX2A9EJ5","check-training-status","Check status, stream logs, and retrieve Azure ML metrics for a running or completed OSMO LeRobot training job. Use when the user runs \u002Fcheck-training-status.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fphysical-ai-toolchain\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fcheck-training-status\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":17,"description":107,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":82},"01M78JT2TMR9AKTKGMJ7D0HMT4","chatlog","Create and maintain structured conversation chatlogs capturing problems, solutions, and lessons learned. Use when the user runs \u002Fchatlog.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fphysical-ai-toolchain\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fchatlog\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":114,"description":115,"descriptionZh":116,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":117,"categories":118,"keywords":121,"publishedAt":40},"01M69AS2WAAD5CZ9S9CBSEZ226","synthetic-data","NVIDIA Cosmos合成数据生成","Generate synthetic training data using NVIDIA Cosmos world foundation models for SDG pipelines","使用 NVIDIA Cosmos 世界基础模型为 SDG 管道生成合成训练数据。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fphysical-ai-toolchain\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fsynthetic-data\u002FSKILL.md",[119,120],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[122,123,124,125,126,127,36,128,31,129,130,131,132],"synthetic data","data","synthetic","world","NVIDIA","generate","models","cosmos","pipelines","Training Data","foundation"]