import json,sys,platform,hashlib,pathlib,numpy as np,cv2,h5py p=pathlib.Path('/workspace');s=json.load(open(p/'candidate/demo_stats.json'));z=np.load(p/'candidate/memory.npz');a=z['a'] text='''# Offline D20 analysis — unrehearsed draft Read task_contract.json, demo_manifest.json and standalone worker_api.py. All data accessed through API.read_demo; no RPC/environment calls, simulator, external search, expert invocation, or neural training. Exactly the authorized 20 trajectories were used. No exploration episodes spent. ## Visual inspection ledger Zero-based observation indices below were actually viewed in front-camera contact sheets sheets/group0.jpg through group3.jpg. No other camera images were visually inspected. Front, left, and top RGB frames 0 through length inclusive were read for numerical resizing (terminal frame excluded from retrieval memory); all action frames 0 through length-1 and qpos/qvel frames 0 through length were analyzed. Robot camera was not used. |Demo|Actions|Visually inspected front frames|Action range| |---|---:|---|---| ''' for x in s:text+=f"|{x['id']}|{x['length']}|{x['visual_front_frames']}|{x['min']}, {x['max']}|\n" text+=''' ## Evidence and variation All 20 initial views show a red payload on a small gray shelf near an open tan bag and a peg support. The first-quarter views show the hand at the payload. Middle views show an empty shelf and hand above/near the bag; these sparse views do not directly resolve the drop. Third-quarter views show the hand returning near the free bag rim/handle. Final views show the hand withdrawn and a narrower hanging bag silhouette near the peg. This is consistent with the intended sequence, but containment, both handles securely on the peg, and success are not verified. Cloth contact and thumb engagement are occluded/small. Demo 19 has different intermediate arm posture and the longest duration. Cube position/orientation and bag shape vary modestly; the camera/table arrangement appears similar. No assumption is made that a live scene equals any demonstration. ## Action conventions and sequences Contract provides one robot part, width 22: translation xyz, rotation xyz, then 16 dexterous joint deltas in recorded order. No gripper scalar or mobile base is present. Translation is root-frame normalized delta times 0.1 m; rotation is norm-clipped times negative 0.5 radians before Euler-to-quaternion conversion in a root-aligned frame. Hand deltas scale by 0.1 rad. All legal components are [-1,1]. Joint names, kinematics, camera calibration and image-axis to root-axis mapping are not provided and remain unknown; no invented calibration is used. qpos/qvel have 23 components, not an action-space pose. All 8,836 action labels were read; lengths range 434–482 (21.7–24.1 seconds at 20 Hz). Every trajectory reaches both -1 and +1 somewhere. Full per-demo mean absolute actions, quarter means, initial/final joints are in candidate/demo_stats.json. Across normalized quarters, translation mean signs are (+,+,-), (-,-,+), (+,-,-), (+,+,+): approach/descent, transfer/lift, return/descent, final lift/withdrawal are plausible interpretations, not calibrated visual proof. Most hand channels flex positively in the first quarter, many reverse in the second, and most become nearly zero in the final quarter while channels 20/21 reverse. Individual finger names are unknown. Quarter averaging hides transitions and must not be treated as a phase oracle. ## Draft and uncertainties controller.py implements nonparametric observation/action retrieval using all 20 demos, no neural weights. Each call compares current qpos, qvel, and three downsampled RGB views against a local phase window across all demos; the best observation supplies its action. No demo ID or seed is selected at reset. Phase only advances from observation matching, not elapsed time. Retrieval uses paired pre-action observations under the conventional dataset alignment, which cannot be validated offline. Coarse images may miss a thin handle; background can dominate distance. Nearest-neighbor switching, phase stall, premature phase advance, and inability to recover off-distribution are unresolved. Distance scales/window sizes are engineering guesses, not validated hyperparameters. No explicit completion classifier exists: the controller runs until the native budget boundary; None at step 700 is budget termination, not a success claim. Runner owns initial hold; steps 1–699 can return actions. Native frequency/horizon are unchanged. Only syntax and synthetic-input checks were performed. No real task testing, rehearsal, freezing or success claim. Environment unavailable as required; internet/proxy was not used, and its availability was not tested. No preparation blocker; live control quality remains unknown. ''' (p/'demo_analysis.md').write_text(text) (p/'candidate/skills.md').write_text('''# Draft capabilities Observation-conditioned payload approach, transfer, hand shaping and handle-transfer action retrieval from authorized demonstrations. These are represented behaviors, not validated skills. No expert controller, simulator, inverse kinematics or pretrained perception model is used. Reset clears phase; each action re-observes RGB and joints. ''') (p/'candidate/findings.md').write_text('See ../demo_analysis.md and demo_stats.json for evidence and exact inspection ledger. All 20 demos analyzed; 8,836 action rows. Similar coarse sequence with duration/placement variation. Payload containment and secure peg attachment cannot be certified from inspected RGB. Thin-handle perception and off-distribution recovery remain major limitations. Draft is neither rehearsed nor frozen.\n') (p/'candidate/handoff.md').write_text('''# Handoff Load controller.py and call reset_episode() once per episode, then act(obs) after the runner-owned hold. Keep memory.npz beside controller.py. Runtime dependencies: NumPy and OpenCV. Actions preserve the contract's sole 22-component robot part order. No RPC calls are made by the controller. None only signals budget exhaustion. Malformed/missing inputs return zero deltas. The instruction is accepted but unused for this single-task draft. prepare.py rebuilds derived memory solely through authorized API.read_demo; document.py regenerates reports. Do not run environment tests in offline preparation. Runner supplies verified manifest and common environment lock separately. Later authorized rehearsal must assess phase alignment, coarse RGB discrimination, stalls, and observable completion. No episodes spent here; no successful rollouts claimed. ''') manifest={'stage':'offline_D20_preparation','status':'draft_unrehearsed_not_frozen','tools_used':['functions.exec','exec_command','write_stdin','view_image','bash','Python','worker_api.API.read_demo','NumPy','OpenCV','h5py'],'versions':{'python':platform.python_version(),'numpy':np.__version__,'opencv':cv2.__version__,'h5py':h5py.__version__},'runtime_dependencies':['numpy','opencv-python'],'preparation_dependencies':['numpy','opencv-python','h5py','Python standard library'],'provenance':{'data':'/demonstrations/demo_00.h5 through demo_19.h5, authorized /demo_manifest.json','api':'/worker_api.py','code':'authored locally during this preparation','memory':'nonparametric legal observation/action records, not neural weights'},'pretrained_weights':[],'model_weights':'No weights loaded or modified; coding model remains unchanged; provider model version not independently available','limitations':['No environment or real testing','No calibrated geometry','Coarse image retrieval may stall or misidentify phase','No completion detector','Internet not used or tested'],'artifacts_sha256':{f.name:hashlib.sha256(f.read_bytes()).hexdigest() for f in [p/'candidate/controller.py',p/'candidate/memory.npz']}} # JSON is valid YAML 1.2 (p/'candidate/model_tool_manifest.yaml').write_text(json.dumps(manifest,indent=2)+'\n')