Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- tasks/EC-L1-109-basketball-tracking-gui-v1/README.mdAdded+15
- tasks/EC-L1-109-basketball-tracking-gui-v1/instruction.mdAdded+11
- tasks/EC-L1-109-basketball-tracking-gui-v1/task.tomlAdded+26
- tasks/EC-L1-109-basketball-tracking-gui-v1/tests/DockerfileAdded+27
- tasks/EC-L1-109-basketball-tracking-gui-v1/tests/licenses/canyon-license.mdAdded+18
- tasks/EC-L1-109-basketball-tracking-gui-v1/tests/mode.jsonAdded+1
- tasks/EC-L1-109-basketball-tracking-gui-v1/tests/native_curves.pyAdded+42
- tasks/EC-L1-109-basketball-tracking-gui-v1/tests/test.shAdded+2
- tasks/EC-L1-109-basketball-tracking-gui-v1/tests/verify.pyAdded+496
- tasks/golf-tracer-01/tests/reference/svg_frames/000000.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000001.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000002.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000003.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000004.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000005.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000006.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000007.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000008.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000009.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000010.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000011.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000012.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000013.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000014.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000015.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000016.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000017.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000018.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000019.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000020.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000021.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000022.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000023.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000024.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000025.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000026.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000027.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000028.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000029.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000030.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000031.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000032.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000033.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000034.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000035.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000036.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000037.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000038.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000039.svgAdded
- tasks/golf-tracer-01/tests/reference/svg_frames/000043.svgAdded
123456789101112131415# EC-L1-109-basketball-tracking-gui-v1
Archived Harbor task package. GUI and terminal variants are separate folders.
## Trajectories.sh results
- [Trajectories.sh results](https://www.trajectories.sh/t/32e1c59f-38e6-478d-b9b8-79e1dadc7a63) — published reward 0.4
## Contents and provenance
Available `instruction.md`, `task.toml`, `environment/` and `tests/` files are copied from the saved task source. Any original README is preserved as `SOURCE-README.md`. `PACKAGE-MANIFEST.json` records every archived file and its SHA-256. `RECOVERY-PROVENANCE.json`, when present, identifies files recovered from saved bootstrap archives or matching local copies; those substitutions are recorded for review.
Source: `/Users/sidsantbak/Documents/ChatGPT/StudioWorld/level1_tasks/EC-L1-109-basketball-tracking-gui-v1`
Archived: 2026-10-22. This is the current saved source, which may include verifier repairs after the run. The linked trajectory is authoritative for that run’s artifacts and status. A finished run or an uploaded result does not establish successful delivery or QC approval. Private tests, references and operator material must stay outside the agent environment.1234567891011Use EffectCraft to make a vertical version of `/root/Desktop/basketball-task/media/Sequence 01.mp4`.
Open EffectCraft, create a 1080×1920 composition at 24 fps with square pixels, and import the supplied horizontal video. Keep all 223 frames in their original order at normal speed, with the same cuts and duration (9 seconds and 7 frames). You may split the footage into layers at the cuts. Use 2D footage layers directly in the main composition, with tracking and transform controls only; keep the layers unparented.
Use EffectCraft’s native Stabilize Motion tracking feature to track the active basketball player's face or head in each shot. Track the dribbler or shooter rather than a spectator or defender. In the last passing drill, either active passing participant is acceptable. A back-of-head track is valid. Use Position and Scale together, analyze the motion, and apply the tracking to the footage so it drives the vertical framing. You may correct drift, restart tracking at cuts, smooth the motion, and adjust framing offsets. When a head leaves the source image or is briefly occluded, preserve the shot and reacquire the same player when visible.
Keep the available head visible and fill the entire vertical frame throughout. Use proportional scaling; do not add black borders, filler backgrounds, stretching, rotation or overlays.
Save the editable project as `/root/Desktop/basketball-task/output/basketball_tracking.ecproj`, keeping the source linked and the analyzed tracking data editable. Export the final vertical video from EffectCraft as `/root/Desktop/basketball-task/output/vertical_bballer.mp4` using H.264 at 1080×1920, 24 fps. The exported video must match the saved composition.
Do the work through the graphical interface only. Do not use a terminal, scripts, application expressions, APIs or tools that edit project files directly. Mouse/keyboard interaction and screenshots or other desktop observations are permitted.1234567891011121314151617181920212223242526schema_version = "1.4"artifacts = ["/root/Desktop/basketball-task/media", "/root/Desktop/basketball-task/output", "/root/.local/share/effectcraft", "/root/.config/effectcraft", "/logs/artifacts", "/tmp/effectcraft.log", "/tmp/effectcraft-xfce.log"][task]name = "sid/EC-L1-109-basketball-tracking-gui-v1"version = "1.0.0"[agent]timeout_sec = 28800network_mode = "no-network"[environment]network_mode = "no-network"build_timeout_sec = 3600cpus = 4memory_mb = 16384storage_mb = 20480os = "linux"[verifier]disable = falsetimeout_sec = 3600environment_mode = "separate"[verifier.environment]network_mode = "no-network"build_timeout_sec = 3600cpus = 4memory_mb = 8192storage_mb = 20480os = "linux"123456789101112131415161718192021222324252627FROM debian:bookworm-slim@sha256:3783cc01769c7b2b1b83a5c5ad96c815348e28ed7da68e2e3687004faa906251ENV DEBIAN_FRONTEND=noninteractiveARG TARGETARCHRUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg python3 python3-pil python3-numpy python3-opencv fontconfig ca-certificates \ libgl1-mesa-dri libgl1 libglu1-mesa mesa-vulkan-drivers libvulkan1 libegl1 \ libx11-6 libx11-xcb1 libxkbcommon0 libwayland-client0 libgtk-3-0 \ libsm6 libice6 libxrender1 libxext6 libpulse0 libasound2 libnss3 \ && rm -rf /var/lib/apt/lists/*COPY vendor/effectcraft-linux-${TARGETARCH}.tar.gz /tmp/effectcraft.tar.gzRUN case "$TARGETARCH" in \ amd64) ec_sha=b9cb2ce68dd66458cc164437e431376e94e38e33e3b6529fa8fd45f8cf968934 ;; \ arm64) ec_sha=ee5047d0f6c3ab5fc613c1984ade8621d56291ac24a342b3358a6c54cec433fb ;; \ *) exit 1 ;; esac \ && echo "${ec_sha} /tmp/effectcraft.tar.gz" | sha256sum -c - \ && mkdir -p /opt/effectcraft \ && tar -xzf /tmp/effectcraft.tar.gz -C /opt/effectcraft --strip-components=1 \ && ln -s /opt/effectcraft/bin/effectcraft-cli /usr/local/bin/effectcraft-cli \ && rm /tmp/effectcraft.tar.gzCOPY verify.py native_curves.py test.sh /tests/COPY reference/ /tests/reference/COPY mode.json /tests/mode.jsonCOPY licenses/ /usr/local/share/task-licenses/COPY media/ /tests/media/RUN mkdir -p /logs/verifier /root/Desktop/basketball-task/output && chmod +x /tests/test.shWORKDIR /rootCMD ["sleep", "infinity"]123456789101112131415161718SAVED LICENSE EVIDENCE — landscape-canyon-panorama-4k30.mp4=======================================================
Retrieved: 2026-10-13 (original download from Pixabay)Record completed: 2026-10-19
License: Pixabay Content License
Statement of license (as recorded at retrieval):This file was retrieved from Pixabay (video ID 81520) under the PixabayContent License: free to use for commercial and non-commercial purposes.It is NOT released under Creative Commons Zero (CC0) and is NOT in thepublic domain.
Note: the full license text was not re-captured when this record wascompleted (pixabay.com is not reachable from the research environment).Consult Pixabay's license page for the complete current terms.This file is a saved copy of the licensing evidence, not legal advice.1{"mode": "gui"}123456789101112131415161718192021222324252627282930313233343536373839404142"""Evaluate nonlinear native keys through EffectCraft, not a guessed interpolation."""import jsonimport numpy as np
def reader(project, relocated_project, report, cli, run, dump, error): paths={} def walk(node, layer, prefix=''): counts={} for child in node.get('children',[]): name=child.get('match','');counts[name]=counts.get(name,0)+1 part=name+('#'+str(counts[name]) if counts[name]>1 else '') path=prefix+'/'+part if prefix else part paths[id(child)]=(layer,path) walk(child,layer,path) def reject_expressions(node): if isinstance(node,dict): if (isinstance(node.get('expr'),dict) and node['expr'].get('enabled')) or node.get('expression_enabled') or node.get('expressionEnabled'): raise error('Candidate expressions cannot run in native curve evaluation') for v in node.values():reject_expressions(v) elif isinstance(node,list): for v in node:reject_expressions(v) reject_expressions(project) for comp in project['items'].values(): if comp['kind']['type']=='Comp': for layer in comp['kind']['layers']:walk(layer['props'],(comp['id'],layer['id'])) project_file=report/'native-curve-input.ecproj';cache={};records=[];written=False def read(prop,frame): nonlocal written if id(prop) not in paths:raise error('Native property path unavailable') (comp,layer),path=paths[id(prop)];key=(comp,layer,frame) if key not in cache: if not written: dump(project_file,relocated_project);written=True result=json.loads(run([cli,'--project',project_file,'props',str(comp),str(layer),'--flat','--time',str(frame/24),'--json'])) if result.get('id')!=layer:raise error('Native curve evaluation returned the wrong layer') cache[key]={p['path']:p['value'] for p in result['properties']} records.append(result);dump(report/'native-curve-values.json',records) if path not in cache[key]:raise error('Native curve value missing: '+path) value=np.asarray(cache[key][path],dtype=float) if not np.isfinite(value).all():raise error('Non-finite native curve value') return value return read12#!/bin/shexec python3 /tests/verify.py --mode gui --output /root/Desktop/basketball-task/output --source "/tests/media/Sequence 01.mp4" --annotations /tests/reference/heads.json --evidence /tests/runtime/evidence.json --report-dir /logs/verifier123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496#!/usr/bin/env python3"""Private EC part-2 grader. Never install this directory in the agent workspace."""import argparseimport copyimport hashlibimport jsonimport shutilimport subprocessfrom pathlib import Path
import numpy as np
TICKS = 254016000000STEP = TICKS // 24N = 223RUBRIC = { 'source': ('Imports the supplied horizontal footage', 10), 'composition': ('Editable 1080×1920, square-pixel, 24 fps composition', 10), 'timing': ('Preserves all 223 source frames once, in order', 10), 'heads': ('Analyzed tracks follow the active head in every evaluable frame', 20), 'channels': ('Position and Scale are analyzed on the same head', 10), 'applied': ('Analyzed tracking is applied to the framing', 10), 'framing': ('Keeps the available head visible', 10), 'coverage': ('Fills the canvas proportionally without exposed borders', 10), 'export': ('Playable H.264 vertical export matches the editable project', 5), 'workflow': ('Uses EffectCraft and follows the run’s tool restrictions', 5),}
class GradingError(Exception): pass
def sha(p): return hashlib.sha256(Path(p).read_bytes()).hexdigest()
def dump(p, data): Path(p).write_text(json.dumps(data, indent=2, allow_nan=False) + '\n')
def run(cmd, binary=False): r = subprocess.run(list(map(str, cmd)), capture_output=True, timeout=600) if r.returncode: raise GradingError(f'Grading tool failed ({cmd[0]}, exit {r.returncode}): {r.stderr.decode(errors="replace")[-1200:]}') return r.stdout if binary else r.stdout.decode()
def walk(node): yield node for child in node.get('children', []): yield from walk(child)
def children(node, match): return [c for c in node.get('children', []) if c.get('match') == match]
def child(node, match): found = children(node, match) if len(found) != 1: raise GradingError(f'Unsupported/malformed native property {match}') return found[0]
def value(prop, frame): """Native frame-key evaluation. Unsupported interpolation never silently scores.""" if (prop.get('expr') or {}).get('enabled') or prop.get('expression_enabled') or prop.get('expressionEnabled'): raise GradingError('Expression evaluation needs a native adapter') keys = sorted(prop.get('keys', []), key=lambda k: k['time']) t = frame * STEP if not keys: out = np.asarray(prop['value']['v'], dtype=float) elif t <= keys[0]['time']: out = np.asarray(keys[0]['value']['v'], dtype=float) elif t >= keys[-1]['time']: out = np.asarray(keys[-1]['value']['v'], dtype=float) else: for a, b in zip(keys, keys[1:]): if a['time'] <= t <= b['time']: if t == a['time'] or a.get('out_interp') == 'Hold': out = np.asarray(a['value']['v'], dtype=float) elif t == b['time']: out = np.asarray(b['value']['v'], dtype=float) else: if a.get('out_interp', 'Linear') != 'Linear' or b.get('in_interp', 'Linear') != 'Linear': raise GradingError('Interpolated Bezier keys need a native evaluation adapter') if any(abs(x) > 1e-8 for k in (a, b) for m in ('spatial_in', 'spatial_out') for x in k.get(m, [])): raise GradingError('Spatial Bezier interpolation needs a native adapter') f = (t-a['time'])/(b['time']-a['time']) out = np.asarray(a['value']['v'])*(1-f) + np.asarray(b['value']['v'])*f break if not np.isfinite(out).all(): raise GradingError('Non-finite native property') return out
def getcomp(p): comps = [v for v in p['items'].values() if v['kind']['type'] == 'Comp'] named = [c for c in comps if c['name'] == 'Vertical'] if len(named) == 1: return named[0] if len(comps) == 1: return comps[0] raise GradingError('Ambiguous composition; extend adapter before scoring')
def event_for(events, operation, layer=None, tracker=None, frame=None): selected = [(i, e) for i, e in enumerate(events) if e['operation'] == operation and e.get('app') == 'EffectCraft' and (layer is None or e.get('layer') == layer) and (tracker is None or e.get('tracker_uid') == tracker) and (frame is None or any(a <= frame < b for a, b in e.get('ranges', [])))] if operation not in ('track_analyze', 'track_apply'): return [e for _, e in selected] current = [] for index, event in selected: related = [(i, e) for i, e in enumerate(events) if e.get('app') == 'EffectCraft' and e.get('layer') == event.get('layer') and e.get('tracker_uid') == event.get('tracker_uid')] reset = max((i for i, e in related if e['operation'] == 'track_reset'), default=-1) if index <= reset: continue if operation == 'track_apply': analyzed = [i for i, e in related if e['operation'] == 'track_analyze' and i > reset and (frame is None or any(a <= frame < b for a, b in e.get('ranges', [])))] if not analyzed or index <= max(analyzed): continue current.append(event) return current
def evidence(path, output, mode, fixture=False): """Trust comes from the private runner mount, not the JSON's source field.""" path = path.resolve() if path.is_relative_to(output.resolve()): raise GradingError('Action evidence must not come from agent output') if not path.is_file(): raise GradingError('Missing complete, private runner action evidence') e = json.loads(path.read_text()) if e.get('source') != 'runner' and not (fixture and e.get('source') == 'synthetic-fixture'): raise GradingError('Untrusted evidence source') if not all(e.get(k) is True for k in ('collection_complete', 'action_trace_complete', 'tool_audit_complete')): raise GradingError('Incomplete collection/action/tool audit') if e.get('answer_exposure') != 'clear': raise GradingError('Answer exposure is unknown or flagged; quarantine evaluation') if e.get('mode') != mode: raise GradingError('Evidence/run mode mismatch') for name in ('basketball_tracking.ecproj', 'vertical_bballer.mp4'): actual = sha(output/name) if (output/name).is_file() else None if name not in e.get('artifacts', {}) or e['artifacts'][name] != actual: raise GradingError('Evidence does not match collected artifact: '+name) receipts = e.get('receipts', {}) def receipt(rid): r = receipts.get(rid) if not r: raise GradingError('Missing receipt '+str(rid)) f = (path.parent/r['path']).resolve() if not f.is_relative_to(path.parent) or not f.is_file() or sha(f) != r['sha256']: raise GradingError('Invalid receipt '+str(rid)) return f for item in e.get('events', []) + e.get('tool_audit', []): if not item.get('evidence_ids'): raise GradingError('Action/audit item has no original receipt') for rid in item['evidence_ids']: receipt(rid) # A hash of arbitrary text is not proof of an application operation. Real # evidence must account for every action in the sealed, private runner trace. # Legacy synthetic fixtures remain usable only with --fixture, never for scores. if e.get('source') == 'runner' or e.get('schema_version') == 2: if e.get('schema_version') != 2 or not e.get('run_id'): raise GradingError('Runner evidence requires version 2 action binding') trace = json.loads(receipt(e.get('trace_receipt_id')).read_text()) actions = trace.get('actions', []) if (trace.get('run_id') != e['run_id'] or trace.get('sealed') is not True or trace.get('action_count') != len(actions) or [a.get('index') for a in actions] != list(range(len(actions)))): raise GradingError('Runner trace is not a complete ordered action archive') ids = [a.get('action_id') for a in actions] audit_ids = [a.get('action_id') for a in e.get('tool_audit', [])] if not ids or len(set(ids)) != len(ids) or audit_ids != ids: raise GradingError('Tool audit does not cover the complete action trace') records = {} for action, audit in zip(actions, e['tool_audit']): rid = action.get('receipt_id'); raw = json.loads(receipt(rid).read_text()) if (rid not in audit['evidence_ids'] or raw.get('run_id') != e['run_id'] or raw.get('action_id') != action['action_id'] or raw.get('index') != action['index'] or any(raw.get(k) != audit.get(k) for k in ('kind', 'app')) or not raw.get('tool') or 'request' not in raw or 'result' not in raw): raise GradingError('Audit classification/action ID is not bound to its raw receipt') if raw['kind'] == 'read_only': request = raw.get('request') desktop_observation = (raw.get('tool') == 'computer-1' and isinstance(request, dict) and request.get('type') in {'screenshot', 'wait', 'sleep', 'zoom', 'cursor_position', 'done', 'answer', 'terminate'} and not request.get('command')) completion_metadata = (raw.get('tool') == 'mark_task_complete' and raw.get('app') == 'runner' and isinstance(request, dict) and set(request) <= {'result'}) if not desktop_observation and not completion_metadata: raise GradingError('Read-only classification is not a permitted desktop observation or runner completion') if raw['kind'] in ('gui_action', 'gui_file_action'): if not fixture: request = raw.get('request') gui_types = {'click', 'double_click', 'triple_click', 'right_click', 'middle_click', 'mouse_down', 'mouse_up', 'mouse_move', 'type', 'key_down', 'key_up', 'key', 'keypress', 'drag', 'scroll', 'hold_key', 'navigate'} if (raw.get('tool') != 'computer-1' or not isinstance(request, dict) or request.get('type') not in gui_types or request.get('command')): raise GradingError('GUI classification is not a supported desktop interaction') for side in ('before', 'after'): screenshot = receipt(raw.get(side+'_screenshot')) if not screenshot.read_bytes().startswith(b'\x89PNG\r\n\x1a\n'): raise GradingError('GUI action lacks a valid '+side+' PNG screenshot') records[action['action_id']] = raw previous_event_order = (-1, -1) for event in e.get('events', []): raw = records.get(event.get('action_id')) semantic = {k: val for k, val in event.items() if k not in ('action_id', 'evidence_ids')} if (raw is None or raw.get('success') is not True or semantic not in raw.get('verified_operations', []) or actions[raw['index']]['receipt_id'] not in event['evidence_ids']): raise GradingError('Operation is not established by the referenced successful action') # Observations are made by the trusted collector from raw app output # and native snapshots; never from the agent's narration. if raw.get('operation_review') != 'operator-verified': raise GradingError('Native operation interpretation has not been reviewed') order = (raw['index'], raw['verified_operations'].index(semantic)) if order <= previous_event_order: raise GradingError('Semantic operations are not in original execution order') previous_event_order = order if not e.get('tool_audit'): raise GradingError('Empty tool audit cannot prove compliance') kinds = {'gui_action', 'gui_file_action', 'terminal', 'script', 'api', 'expression', 'direct_project_edit', 'read_only'} if any(x.get('kind') not in kinds for x in e['tool_audit']): raise GradingError('Unclassified tool use') events = e.get('events', []) bad = [x for x in e['tool_audit'] if mode == 'gui' and x['kind'] not in {'gui_action', 'gui_file_action', 'read_only'}] gui_seen = any(x.get('kind') == 'gui_action' and x.get('app') == 'EffectCraft' for x in e['tool_audit']) return e, events, not bad and gui_seen
def inspect_native(p, ann, events, linked, native_reader=None): local_value = globals()['value'] def value(prop, frame): try: return local_value(prop, frame) except GradingError as exc: if native_reader is None or not str(exc).startswith(('Interpolated Bezier', 'Spatial Bezier')): raise return native_reader(prop, frame) if p.get('schema') != 2: raise GradingError('Unsupported EffectCraft schema') item = getcomp(p); c = item['kind'] good = {k: True for k in ('source', 'composition', 'timing', 'heads', 'channels', 'applied', 'framing', 'coverage')} detail = {k: [] for k in good}
def fail(k, reason, frame=None): good[k] = False if len(detail[k]) < 24: detail[k].append({'frame': frame, 'reason': reason})
if (c['width'], c['height'], c['pixel_aspect'], c['frame_rate']) != (1080, 1920, 1.0, {'num': 24, 'den': 1}): fail('composition', 'Expected 1080×1920, square pixels, 24 fps') if c['duration'] != N*STEP: fail('timing', 'Duration differs from 223 frames') layers = [l for l in c['layers'] if l.get('switches', {}).get('video', True) and not l.get('switches', {}).get('guide')] if any(l.get('switches', {}).get('solo') for l in layers): layers = [l for l in layers if l['switches'].get('solo')] frame_records = [] for l in layers: if l.get('parent') is not None or l.get('switches', {}).get('three_d') or l['source']['type'] == 'Comp': raise GradingError('Parented, nested or 3D framing needs an additional native adapter') if l['source']['type'] != 'Footage': fail('coverage', 'Extra visible background/graphic layer') fail('timing', 'Extra visible media') continue if any(l[k] % STEP for k in ('start_time', 'in_point', 'out_point')) or l.get('stretch', 100) != 100: fail('timing', 'Fractional frame alignment or retiming') if not linked.get(str(l['source']['item'])): fail('source', 'Used footage is not the supplied horizontal MP4') media = p['items'].get(str(l['source']['item']), {}).get('kind', {}) if (media.get('width'), media.get('height'), media.get('pixel_aspect'), media.get('frame_rate')) != (3840,2160,1.0,{'num':24,'den':1}) or media.get('native_rate') is not None or media.get('loop_count',1) != 1: fail('timing', 'Source interpretation changes dimensions, aspect, frame rate or looping') if any('remap' in n.get('match','').lower() and n.get('enabled',True) for n in walk(l['props'])): raise GradingError('Native time remapping needs an explicit source-frame evaluator') for key in ('masks', 'effects'): group = children(l['props'], key) if group and any(n.get('enabled', True) for n in group[0].get('children', [])): raise GradingError('Enabled effects/masks need a coverage-aware native adapter') if l.get('track_matte') or l.get('blend_mode', 'Normal') != 'Normal': raise GradingError('Matte/blending needs an additional coverage adapter') if l.get('switches', {}).get('motion_blur') or l.get('switches', {}).get('frame_blend', 'Off') != 'Off': raise GradingError('Motion/frame blending needs an additional evaluation adapter') for f, head in enumerate(ann['frames']): active = [l for l in layers if l['in_point'] <= f*STEP < l['out_point']] if len(active) != 1 or active[0]['source']['type'] != 'Footage': for k in ('timing', 'heads', 'channels', 'applied', 'framing', 'coverage'): fail(k, 'Needs exactly one active source-backed image', f) continue l = active[0]; lid = l['id']; tr = child(l['props'], 'transform') if l['start_time'] != 0 or l.get('stretch', 100) != 100: fail('timing', 'Output/source frame correspondence is not one-to-one', f) anchor = value(child(tr, 'anchor'), f)[:2] pos = value(child(tr, 'position'), f)[:2] scale = value(child(tr, 'scale'), f)[:2]/100 offset = pos-anchor*scale rotation = [float(value(child(tr, k), f)) for k in ('rotation', 'rotationX', 'rotationY')] if max(map(abs, rotation)) > 1e-6 or np.max(np.abs(value(child(tr, 'orientation'), f))) > 1e-6: fail('coverage', 'Rotation changes source framing', f) if min(scale) <= 0 or abs(scale[0]-scale[1]) > 1e-5 or abs(float(value(child(tr, 'opacity'), f))-100) > 1e-5: fail('coverage', 'Nonuniform scale, mirrored image or reduced opacity', f) if np.any(offset > .5) or np.any(offset + np.array(ann['dimensions'])*scale < [1079.5, 1919.5]): fail('coverage', 'Source rectangle exposes a canvas edge', f) frame_records.append({'frame': f, 'layer': lid, 'scale': scale.tolist(), 'translation': offset.tolist()}) if not head['evaluable']: continue allowed_heads = [head] + head.get('alternatives', []) def head_in_frame(h): if not h['evaluable']: return True box = np.asarray(h['bounds']).reshape(2, 2)*scale+offset # Annotation uncertainty is 8% of head height, capped at 32 output px. tol = min(32., h['height']*max(scale)*.08) return bool(np.all(box[0] >= -tol) and np.all(box[1] <= np.array([1080, 1920])+tol)) tg = children(l['props'], 'motionTrackers') candidates = tg[0].get('children', []) if tg else [] valid = [] for tracker in candidates: if not tracker.get('enabled', True): continue points = children(tracker, 'trackPoint') if len(points) < 1: continue coords = [value(child(pt, 'featureCenter'), f) for pt in points] analyzed = event_for(events, 'track_analyze', lid, tracker['uid'], f) for allowed in allowed_heads: center = np.array(allowed['center']); h = allowed['height'] near = all(abs(q[0]-center[0]) <= .55*h and abs(q[1]-center[1]) <= .65*h for q in coords) usable = analyzed if not allowed['evaluable'] and not usable: around = event_for(events, 'track_analyze', lid, tracker['uid']) rr = [r for e in around for r in e.get('ranges', [])] if any(b <= f for a,b in rr) and any(a > f for a,b in rr): usable = around if near and usable: valid.append((tracker, points, coords, usable, allowed)) if not valid: if not any(head_in_frame(h) for h in allowed_heads if h['evaluable']): fail('framing', 'Available annotated head is cropped', f) for k in ('heads', 'channels', 'applied'): fail(k, 'No retained, analyzed head track at this frame', f) continue # Select a tracker actually applied to this footage; unused trackers cannot supply channel credit. tracker, points, coords, analyzed, head = next((v for v in valid if event_for(events, 'track_apply', lid, v[0]['uid'], f)), valid[0]) if not head_in_frame(head): fail('framing', 'Tracked active head is cropped', f) settings = tracker['kind'].get('settings', {}) if len(points) > 2: raise GradingError('Tracker layouts with more than two points need a native scale adapter') if not settings.get('position') or not settings.get('scale') or len(points) < 2 or not all(e.get('position') and e.get('scale') for e in analyzed): fail('channels', 'Position+Scale absent at analysis or two-point scale data missing', f) if len(coords) >= 2 and np.linalg.norm(coords[1]-coords[0]) <= 1e-6: fail('channels', 'Scale points collapse to the same feature', f) applies = event_for(events, 'track_apply', lid, tracker['uid'], f) if settings.get('kind') not in ('stabilize',): raise GradingError('Track-motion framing chain needs an additional native adapter') if settings.get('target') != lid or not applies or not all(e.get('position') and e.get('scale') and e.get('target') == lid for e in applies): fail('applied', 'No Position+Scale application to the rendered footage', f) return good, detail, frame_records
def probe(path): return json.loads(run(['ffprobe', '-v', 'error', '-show_streams', '-show_format', '-of', 'json', path]))
def decode(path): raw = run(['ffmpeg', '-v', 'error', '-xerror', '-i', path, '-an', '-vf', 'scale=270:480', '-fps_mode', 'passthrough', '-pix_fmt', 'rgb24', '-f', 'rawvideo', '-'], binary=True) if len(raw) % (270*480*3): raise GradingError('Malformed decoded frame stream') return np.frombuffer(raw, np.uint8).reshape(-1, 480, 270, 3)
def verify(args): output = Path(args.output); report = Path(args.report_dir); report.mkdir(parents=True, exist_ok=True) for name in ('reward.txt', 'reward.json'): (report/name).unlink(missing_ok=True) rows = {k: {'id': k, 'requirement': text, 'possible': w, 'earned': None, 'state': 'unknown'} for k, (text, w) in RUBRIC.items()} error = None; diagnostics = {}; trace = None def mark(k, ok, why): rows[k].update(earned=RUBRIC[k][1] if ok else 0, state='met' if ok else 'unmet', explanation=why) try: ann = json.loads(Path(args.annotations).read_text()) if ann.get('status') != 'reviewed' or len(ann['frames']) != N or [x['frame'] for x in ann['frames']] != list(range(N)): raise GradingError('Missing reviewed private head annotations') if sha(args.source) != ann['source_sha256']: raise GradingError('Wrong private source reference') trace, events, workflow_ok = evidence(Path(args.evidence), output, args.mode, args.fixture) mark('workflow', workflow_ok, 'Complete private tool audit; GUI-only prohibits terminal, scripts, APIs, expressions and direct project edits. Terminal mode permits them; EffectCraft GUI use is required in both.') project = output/'basketball_tracking.ecproj'; video = output/'vertical_bballer.mp4' if not project.exists(): for k in RUBRIC: if k != 'workflow': mark(k, False, 'Required editable project absent from complete collection') else: try: p = json.loads(project.read_text()) except (ValueError, OSError) as exc: raise GradingError('Unreadable native submission; distinguish corruption from collection failure') from exc q = copy.deepcopy(p); linked = {} for key, item in q['items'].items(): if item['kind']['type'] != 'Footage': continue native_path = Path(item['kind']['path']) if native_path.is_absolute(): actual = Path(args.workspace)/str(native_path).lstrip('/') if args.workspace else native_path else: actual = project.parent/native_path actual = actual.resolve() linked[key] = actual.is_file() and sha(actual) == ann['source_sha256'] and not item['kind'].get('missing') item['kind']['path'] = str(actual) from native_curves import reader native_reader = reader(p, q, report, args.effectcraft_cli, run, dump, GradingError) good, detail, frame_records = inspect_native(p, ann, events, linked, native_reader) imported = any(e.get('source_sha256') == ann['source_sha256'] for e in event_for(events, 'import_source')) good['source'] = good['source'] and imported for k, ok in good.items(): mark(k, ok, detail[k] or 'Native properties, private source annotations and runner receipts agree') diagnostics['native_failures'] = detail dump(report/'frame_checks.json', frame_records) valid = False; match = False if video.is_file(): info = probe(video); streams = [s for s in info['streams'] if s['codec_type'] == 'video'] vs = streams[0] if len(streams) == 1 else {} valid = (vs.get('codec_name') == 'h264' and vs.get('width') == 1080 and vs.get('height') == 1920 and vs.get('r_frame_rate') == '24/1' and vs.get('sample_aspect_ratio', '1:1') in ('1:1', 'N/A') and not any(s.get('rotation', 0) % 360 for s in vs.get('side_data_list', []))) if float(info['format'].get('duration', 0)) > 20: raise GradingError('Submission exceeds bounded decoder duration') times = json.loads(run(['ffprobe', '-v', 'error', '-select_streams', 'v:0', '-show_entries', 'frame=best_effort_timestamp_time', '-of', 'json', video]))['frames'] ts = [float(f['best_effort_timestamp_time']) for f in times] valid = valid and len(ts) == N and all(abs(t-i/24) < 2e-6 for i, t in enumerate(ts)) exported = decode(video) if good['source'] and good['composition'] and good['timing']: # Copy only to relocate linked files into the grader's collected workspace. # Candidate transforms/tracks remain unchanged. Never execute candidate expressions. for n in (n for l in getcomp(q)['kind']['layers'] for n in walk(l['props'])): if (n.get('expr') or {}).get('enabled') or n.get('expression_enabled') or n.get('expressionEnabled'): raise GradingError('Candidate expression requires sandboxed native evaluation') render_project = report/'render-input.ecproj'; dump(render_project, q) native = report/'native-render.mp4' run([args.effectcraft_cli, '--project', render_project, 'render', '--comp', getcomp(q)['name'], '--out', native, '--format', 'h264', '--resolution', 'full', '--bitrate', '16000', '--audio', 'on']) expected = decode(native) if len(exported) == len(expected) == N: errors = np.mean(np.abs(exported.astype(np.int16)-expected.astype(np.int16)), axis=(1, 2, 3)) # Local regions prevent a small border/overlay being diluted by the whole frame. blocks = np.abs(exported.astype(np.int16)-expected.astype(np.int16)).reshape(N, 8, 60, 6, 45, 3).mean(axis=(2, 4, 5)) match = bool(errors.max() <= 6 and blocks.max() <= 16) diagnostics['export_comparison'] = {'frames': N, 'max_frame_mae': float(errors.max()), 'max_tile_mae': float(blocks.max()), 'frame_limit': 6, 'tile_limit': 16} exported_event = any(e.get('project_sha256') == sha(project) and e.get('video_sha256') == sha(video) for e in event_for(events, 'export')) match = match and exported_event diagnostics['probe'] = info mark('export', valid and match, 'Full decode, 223 timestamps, H.264 1080×1920, native-render comparison of every frame and EffectCraft export receipt') except Exception as exc: error = str(exc) reward = None if error else sum(r['earned'] for r in rows.values())/100 result = {'status': 'verifier_error' if error else 'graded', 'mode': args.mode, 'fixture_only': args.fixture, 'reward': reward, 'criteria': list(rows.values()), 'unresolved_points': sum(r['possible'] for r in rows.values() if r['state'] == 'unknown'), 'error': error, 'diagnostics': diagnostics, 'reference': {'source_sha256': sha(args.source) if Path(args.source).is_file() else None, 'annotations_sha256': sha(args.annotations) if Path(args.annotations).is_file() else None}, 'limits': ['Flat schema-2 Position+Scale stabilization is supported; nonlinear keys use native EffectCraft property evaluation. Unsupported structures produce no score pending adapter extension.', 'Approximate reviewed source head envelopes permit small annotation uncertainty; output framing need not match the example crop.', 'Process evidence must be collected privately by the runner. Synthetic fixtures prove checker behavior, not GUI authorship.']} dump(report/'rubric_report.json', result) # Fixture scores are never emitted as publishable Harbor rewards. if error is None and not args.fixture: (report/'reward.txt').write_text(str(reward)+'\n') return result
def main(): p = argparse.ArgumentParser() p.add_argument('--output', required=True) p.add_argument('--source', required=True) p.add_argument('--annotations', default=str(Path(__file__).parent/'private/heads.json')) p.add_argument('--evidence', required=True) p.add_argument('--report-dir', required=True) p.add_argument('--mode', choices=['terminal', 'gui'], required=True) p.add_argument('--workspace', help='Root of collected agent filesystem; never silently replace missing links with oracle media') p.add_argument('--effectcraft-cli', default='effectcraft-cli') p.add_argument('--fixture', action='store_true') a = p.parse_args(); r = verify(a) print(json.dumps({k: r[k] for k in ('status', 'reward', 'fixture_only', 'error')})) return 2 if r['error'] else 0
if __name__ == '__main__': raise SystemExit(main())tasks/EC-L1-109-basketball-tracking-gui-v1/README.mdAdded+15
tasks/EC-L1-109-basketball-tracking-gui-v1/instruction.mdAdded+11
tasks/EC-L1-109-basketball-tracking-gui-v1/task.tomlAdded+26
tasks/EC-L1-109-basketball-tracking-gui-v1/tests/DockerfileAdded+27
tasks/EC-L1-109-basketball-tracking-gui-v1/tests/licenses/canyon-license.mdAdded+18
tasks/EC-L1-109-basketball-tracking-gui-v1/tests/mode.jsonAdded+1
tasks/EC-L1-109-basketball-tracking-gui-v1/tests/native_curves.pyAdded+42
tasks/EC-L1-109-basketball-tracking-gui-v1/tests/test.shAdded+2
tasks/EC-L1-109-basketball-tracking-gui-v1/tests/verify.pyAdded+496
tasks/golf-tracer-01/tests/reference/svg_frames/000000.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000001.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000002.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000003.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000004.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000005.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000006.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000007.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000008.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000009.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000010.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000011.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000012.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000013.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000014.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000015.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000016.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000017.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000018.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000019.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000020.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000021.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000022.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000023.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000024.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000025.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000026.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000027.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000028.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000029.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000030.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000031.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000032.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000033.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000034.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000035.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000036.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000037.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000038.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000039.svgAdded
tasks/golf-tracer-01/tests/reference/svg_frames/000043.svgAdded