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/01-A-name-formats-gui-v3/README.mdAdded+12
- tasks/01-A-name-formats-gui-v3/environment/DockerfileAdded+39
- tasks/01-A-name-formats-gui-v3/environment/files.pyAdded+52
- tasks/01-A-name-formats-gui-v3/environment/filmcraft-wrapper.shAdded+4
- tasks/01-A-name-formats-gui-v3/environment/filmcraft.desktopAdded+6
- tasks/01-A-name-formats-gui-v3/environment/install-gui.pyAdded+59
- tasks/01-A-name-formats-gui-v3/environment/start-editor.shAdded+14
- tasks/01-A-name-formats-gui-v3/instruction.mdAdded+18
- tasks/01-A-name-formats-gui-v3/task.tomlAdded+25
- tasks/01-A-name-formats-gui-v3/tests/DockerfileAdded+31
- tasks/01-A-name-formats-gui-v3/tests/access.jsonAdded+1
- tasks/01-A-name-formats-gui-v3/tests/deterministic_checks.pyAdded+101
- tasks/01-A-name-formats-gui-v3/tests/gui_evidence.pyAdded+62
- tasks/01-A-name-formats-gui-v3/tests/source-manifest.jsonAdded+34
- tasks/01-A-name-formats-gui-v3/tests/test.shAdded+6
- tasks/01-A-name-formats-gui-v3/tests/verifier-config.jsonAdded+5
- tasks/01-A-name-formats-gui-v3/tests/verifier_runtime.pyAdded+72
- tasks/01-A-name-formats-gui-v3/tests/verify.pyAdded+281
- tasks/01-B-name-batch-gui-v4/README.mdAdded+8
- tasks/01-B-name-batch-gui-v4/environment/DockerfileAdded+38
- tasks/01-B-name-batch-gui-v4/environment/desktop/task-01/start.fcprojAdded+1
- tasks/01-B-name-batch-gui-v4/environment/files.pyAdded+52
- tasks/01-B-name-batch-gui-v4/environment/filmcraft-wrapper.shAdded+4
- tasks/01-B-name-batch-gui-v4/environment/filmcraft.desktopAdded+6
- tasks/01-B-name-batch-gui-v4/environment/install-gui.pyAdded+59
- tasks/01-B-name-batch-gui-v4/environment/start-editor.shAdded+14
- tasks/01-B-name-batch-gui-v4/instruction.mdAdded+14
- tasks/01-B-name-batch-gui-v4/task.tomlAdded+25
- tasks/01-B-name-batch-gui-v4/tests/DockerfileAdded+31
- tasks/01-B-name-batch-gui-v4/tests/access.jsonAdded+1
- tasks/01-B-name-batch-gui-v4/tests/deterministic_checks.pyAdded+101
- tasks/01-B-name-batch-gui-v4/tests/gui_evidence.pyAdded+62
- tasks/01-B-name-batch-gui-v4/tests/initial-project.fcprojAdded+1
- tasks/01-B-name-batch-gui-v4/tests/media_helpers.pyAdded+91
- tasks/01-B-name-batch-gui-v4/tests/source-manifest.jsonAdded+114
- tasks/01-B-name-batch-gui-v4/tests/test.shAdded+6
- tasks/01-B-name-batch-gui-v4/tests/verifier-config.jsonAdded+8
- tasks/01-B-name-batch-gui-v4/tests/verifier_runtime.pyAdded+72
- tasks/01-B-name-batch-gui-v4/tests/verify.pyAdded+170
- tasks/golf-tracer-05/RUBRIC.mdAdded+46
- tasks/golf-tracer-05/instruction.mdAdded+11
- tasks/golf-tracer-05/task.tomlAdded+22
- tasks/golf-tracer-05/tests/calibration.jsonAdded+7
- tasks/golf-tracer-05/tests/svgpath.pyAdded+193
- tasks/golf-tracer-05/tests/tracer-intervals.jsonAdded+16
- tasks/golf-tracer-09/environment/DockerfileAdded+7
- tasks/golf-tracer-09/tests/reference/svg_frames/000000.svgAdded
- tasks/golf-tracer-09/tests/reference/svg_frames/000001.svgAdded
- tasks/golf-tracer-09/tests/reference/svg_frames/000002.svgAdded
- tasks/golf-tracer-09/tests/reference/svg_frames/000003.svgAdded
123456789101112# 01-A-name-formats-gui-v3
Harbor schema 1.4 package, Filmcraft 0.7.2, access: gui.Agent build context: environment/. Separate verifier build context: tests/.Sources and installers are bundled; no host-only symlink dependencies.
Operator configuration, run commands, checks and limitations:[Setup guide](../../reports/task01-name-formats-v3/README.md).
The GUI version requires the supplied Computer1 adapter with no bash tool.The terminal version enables the bash tool. Use configure.py in the setup guide.Docker runtime validation remains unverified; no benchmark has been launched.123456789101112131415161718192021222324252627282930313233343536373839FROM debian:bookworm-slim@sha256:3783cc01769c7b2b1b83a5c5ad96c815348e28ed7da68e2e3687004faa906251ENV DEBIAN_FRONTEND=noninteractiveARG TARGETARCHRUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg python3 python3-tk python3-numpy python3-pil ca-certificates \ xvfb xfce4-session xfwm4 xfce4-panel xfce4-settings xfdesktop4 thunar mousepad xterm \ x11vnc xdotool wmctrl imagemagick webp dbus-x11 zenity xdg-desktop-portal xdg-desktop-portal-gtk \ fonts-dejavu-core fonts-liberation libgl1-mesa-dri libgl1 libglu1-mesa \ mesa-vulkan-drivers libvulkan1 libegl1 libx11-6 libx11-xcb1 libxcursor1 libxi6 \ libxrandr2 libxkbcommon0 libwayland-client0 libgtk-3-0 libsm6 libice6 \ libxrender1 libxext6 libxkbcommon-x11-0 libxcb-cursor0 libxcb-icccm4 \ libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 \ libxcb-xinput0 libpulse0 libasound2 libnss3 procps util-linux \ && rm -rf /var/lib/apt/lists/*COPY vendor/filmcraft-${TARGETARCH}.tar.gz /tmp/filmcraft.tar.gzRUN case "$TARGETARCH" in \ amd64) filmcraft_sha=4171c4bf5f57fd29475655f8a6df4719feda8c8f3ed95b2475d8dc112ad3be86 ;; \ arm64) filmcraft_sha=4af56f649a6fb19dcae386abd59921ec6c9190b725014517075fa4d81123c68a ;; \ *) exit 1 ;; esac \ && echo "${filmcraft_sha} /tmp/filmcraft.tar.gz" | sha256sum -c - \ && mkdir -p /opt/filmcraft \ && tar -xzf /tmp/filmcraft.tar.gz -C /opt/filmcraft --strip-components=1 \ && cp -a /opt/filmcraft/share/. /usr/local/share/ \ && ln -s /opt/filmcraft/bin/filmcraft-cli /usr/local/bin/filmcraft-cli \ && rm /tmp/filmcraft.tar.gzENV RAYON_NUM_THREADS=4 SDL_AUDIODRIVER=dummy LIBGL_ALWAYS_SOFTWARE=1 WGPU_BACKEND=vulkan LANG=C.UTF-8 DISPLAY=:1COPY media/ /root/Desktop/task-01/media/COPY assets/ /root/Desktop/task-01/assets/COPY start-editor.sh filmcraft-wrapper.sh /usr/local/bin/COPY filmcraft.desktop /root/Desktop/Filmcraft.desktopRUN mkdir -p /root/Desktop/task-01/output /logs/artifacts \ && chmod +x /usr/local/bin/start-editor.sh /usr/local/bin/filmcraft-wrapper.sh /root/Desktop/Filmcraft.desktop \ && ln -s /usr/local/bin/filmcraft-wrapper.sh /usr/local/bin/filmcraft \ && chmod -R a+rX /root/Desktop/task-01/media /root/Desktop/task-01/assetsCOPY files.py /opt/gui-only/files.pyCOPY install-gui.py /opt/gui-only/install.pyRUN python3 /opt/gui-only/install.pyWORKDIR /rootCMD ["/usr/local/bin/start-editor.sh"]12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152#!/usr/bin/python3"""GUI file browsing and fixed app launchers; no shell or executable-file launch."""import os,subprocess,sysfrom pathlib import Pathimport tkinter as tkfrom tkinter import ttk,messageboxAPPS={'FilmCraft':['/usr/local/bin/filmcraft','--graphics','software']}root=tk.Tk();root.title('Files');root.geometry('960x700')path=tk.StringVar(value='/root/Desktop');status=tk.StringVar()bar=ttk.Frame(root);bar.pack(fill='x')def launch(name,filename=None): args=APPS[name][:] if not Path(args[0]).exists():return if filename:args.append(str(filename)) subprocess.Popen(args,stdin=subprocess.DEVNULL,stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL,start_new_session=True)for name in APPS: if Path(APPS[name][0]).exists():ttk.Button(bar,text='Open '+name,command=lambda n=name:launch(n)).pack(side='left',padx=4,pady=6)nav=ttk.Frame(root);nav.pack(fill='x')def go(value):path.set(str(value));refresh()ttk.Button(nav,text='Up',command=lambda:go(Path(path.get()).parent)).pack(side='left')entry=ttk.Entry(nav,textvariable=path);entry.pack(side='left',fill='x',expand=True);entry.bind('<Return>',lambda _:refresh())ttk.Button(nav,text='Go',command=lambda:refresh()).pack(side='left')short=ttk.Frame(root);short.pack(fill='x')for name,value in [('Desktop','/root/Desktop'),('Home','/root'),('Media','/root/Desktop/task-01/media'),('Assets','/root/Desktop/task-01/assets'),('Output','/root/Desktop/task-01/output'),('Linux filesystem','/')]:ttk.Button(short,text=name,command=lambda v=value:go(v)).pack(side='left')view=ttk.Treeview(root,columns=('type','size'),show='tree headings');view.heading('#0',text='Name');view.heading('type',text='Type');view.heading('size',text='Size');view.pack(fill='both',expand=True)ttk.Label(root,textvariable=status).pack(fill='x')items={}def refresh(): p=Path(path.get()).expanduser() if not p.is_dir():messagebox.showerror('Files','Choose a folder path.');return path.set(str(p.resolve()));view.delete(*view.get_children());items.clear() try: for x in sorted(p.iterdir(),key=lambda x:(not x.is_dir(),x.name.lower())): try:typ='Folder' if x.is_dir() else 'File';size='' if x.is_dir() else str(x.stat().st_size)+' bytes' except OSError:typ='Unavailable';size='' i=view.insert('', 'end',text=x.name,values=(typ,size));items[i]=x status.set(str(len(items))+' items') except OSError as e:status.set(str(e))def open_selected(_=None): sel=view.selection() if not sel:return p=items[sel[0]] if p.is_dir():go(p);return suffix=p.suffix.lower() if suffix=='.fcproj':launch('FilmCraft',p);return if suffix in {'.mp4','.mov','.mkv','.avi','.webm','.mp3','.wav','.png','.jpg','.jpeg'}: name='FilmCraft';launch(name,p);return if suffix in {'.txt','.md','.csv','.json','.xml','.toml','.log'} and p.stat().st_size<1000000: w=tk.Toplevel(root);w.title(p.name);t=tk.Text(w,wrap='word');t.pack(fill='both',expand=True);t.insert('1.0',p.read_text(errors='replace'));t.configure(state='disabled');return messagebox.showinfo('Files','This file can be browsed but cannot be launched. Open media and projects in the editor using its file dialogs.')view.bind('<Double-1>',open_selected);view.bind('<Return>',open_selected)refresh();root.mainloop()1234#!/bin/sh# Limit decoder parallelism to avoid excessive preview memory.filmcraft_cpus=$(python3 -c 'import os; print(",".join(map(str,sorted(os.sched_getaffinity(0))[:4])))')exec taskset -c "$filmcraft_cpus" /opt/filmcraft/bin/filmcraft "$@"123456[Desktop Entry]Type=ApplicationName=FilmcraftExec=/usr/local/bin/filmcraft --empty --no-recover --graphics softwareIcon=applications-multimediaTerminal=false1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859"""Trusted environment setup. Run before exposing screenshots/actions to a model."""import jsonimport osfrom pathlib import Pathimport subprocessimport xml.etree.ElementTree as ET
# Restore navigation packages from trusted, offline Debian assets before guarding commands.if Path('/opt/gui-only/nonexistent-debs').exists(): subprocess.run(['dpkg','-i',*[str(p) for p in Path('/opt/gui-only/nonexistent-debs').glob('*.deb')]],check=True,stdout=subprocess.DEVNULL)
BLOCKED = 'xterm uxterm lxterm koi8rxterm x-terminal-emulator xfce4-terminal gnome-terminal gnome-terminal-server konsole mate-terminal lxterminal qterminal terminator tilix sakura rxvt urxvt zutty xfce4-appfinder xfrun4 exo-desktop-item-edit xfce4-settings-editor xfce4-settings-manager thunar Thunar mousepad xfce4-keyboard-settings xfce4-mime-settings'.split()stub = Path('/usr/local/bin/gui-only-denied')stub.write_text('''#!/bin/shmkdir -p /logs/artifactsprintf '%s %s\\n' "$(date -u +%FT%TZ)" "$0" >> /logs/artifacts/gui-only-denied.logexit 126''')stub.chmod(0o755)for name in BLOCKED: for directory in ['/usr/bin','/usr/local/bin','/bin']: p = Path(directory)/name if directory == '/bin' and Path('/bin').resolve() == Path('/usr/bin'):continue if p.exists() or p.is_symlink():p.unlink() p.symlink_to(stub)# Remove shell launch surfaces without removing native editor file dialogs.for root in ['/root/Desktop','/usr/share/applications','/usr/local/share/applications','/root/.local/share/applications']: for p in Path(root).glob('*.desktop'): text=p.read_text(errors='replace').lower() if any(x in text for x in ['terminal','appfinder','xfrun','settings-editor','keyboard-settings','mime-settings','desktop-item-edit','text-editor','mousepad','chromium','web-browser']):p.unlink()# Only the harness launches the editor; disable duplicate session autostarts.for root in ['/root/.config/autostart','/etc/xdg/autostart']: for p in Path(root).glob('*.desktop'): if any(x in p.read_text(errors='replace').lower() for x in ['shotcut','filmcraft','x11vnc']): p.write_text('[Desktop Entry]\nType=Application\nHidden=true\n')for root in ['/etc/xdg/xfce4/xfconf/xfce-perchannel-xml','/root/.config/xfce4/xfconf/xfce-perchannel-xml']: p=Path(root)/'xfce4-keyboard-shortcuts.xml' if p.exists(): tree=ET.parse(p) for parent in tree.iter(): for child in list(parent): if any(x in child.get('value','').lower() for x in ['terminal','appfinder','xfrun']):parent.remove(child) tree.write(p,encoding='unicode')kiosk=Path('/etc/xdg/xfce4/kiosk/kioskrc');kiosk.parent.mkdir(parents=True,exist_ok=True)kiosk.write_text('[xfce4-panel]\nCustomizePanel=NONE\n[xfdesktop]\nCustomizeDesktopMenu=NONE\nCustomizeWindowlist=NONE\nUserMenu=ALL\n[xfce4-session]\nCustomizeCompatibility=NONE\nCustomizeSecurity=NONE\n')# Custom file-manager commands can launch shells. Keep file navigation/native dialogs.actions=Path('/root/.config/Thunar/uca.xml');actions.parent.mkdir(parents=True,exist_ok=True);actions.write_text('<actions/>\n')for name in BLOCKED: r=subprocess.run(['/usr/bin/'+name,'--version'],capture_output=True,timeout=5) if r.returncode !=126:raise RuntimeError('GUI-only guard failed: '+name)Path('/logs/artifacts').mkdir(parents=True,exist_ok=True)Path('/logs/artifacts/gui-only-policy.json').write_text(json.dumps({'version':2,'os_navigation':True,'terminal_tools':False,'blocked_launchers':BLOCKED,'self_check':'passed'},indent=2))print('GUI_ONLY_SELF_CHECK_PASSED')
# Fixed GUI file browser and app launchers do not execute arbitrary commands.p=Path('/root/Desktop/Files.desktop');p.write_text('[Desktop Entry]\nType=Application\nName=Files\nExec=/usr/bin/python3 /opt/gui-only/files.py\nIcon=system-file-manager\nTerminal=false\n');p.chmod(0o755)for app,command in [('FilmCraft','/usr/local/bin/filmcraft --graphics software')]: if not Path(command.split()[0]).exists():continue p=Path('/root/Desktop')/(app+'.desktop');p.write_text('[Desktop Entry]\nType=Application\nName='+app+'\nExec='+command+'\nIcon=applications-multimedia\nTerminal=false\n');p.chmod(0o755)1234567891011121314#!/bin/shset -eumkdir -p /logs/artifacts /root/.local/share/filmcraft /root/.config/filmcraftif [ ! -S /tmp/.X11-unix/X1 ]; then Xvfb :1 -screen 0 1280x900x24 -ac +extension RANDR >/tmp/task01-xvfb.log 2>&1 &fiexport DISPLAY=:1sleep 1if [ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ]; then eval "$(dbus-launch --sh-syntax)"fistartxfce4 >/tmp/task01-xfce.log 2>&1 &sleep 2exec /usr/local/bin/filmcraft --empty --no-recover --graphics software >/tmp/task01-filmcraft.log 2>&1123456789101112131415161718Can you go through `/root/Desktop/task-01/media` in Filmcraft and look for `coffee-beans-closeup-4k.mp4`, `pouring-coffee-carafe-4k.mp4`, and `hands-cup-pickup-4k.mp4`. I want to assemble them in that order, using the first five seconds of each video at normal speed with straight cuts between them. The assembled video should be 15 seconds long, with cuts at 5 and 10 seconds and no gaps or overlaps. Make sure you are using Filmcraft— I want to edit this timeline sequence manually later.
Export four H.264 MP4 files at 30 fps:
- `final-01-horizontal.mp4`: 1920×1080 horizontal, without branding.- `final-01-horizontal-branded.mp4`: 1920×1080 horizontal, with branding.- `final-01-vertical.mp4`: 1080×1920 vertical, without branding.- `final-01-vertical-branded.mp4`: 1080×1920 vertical, with branding.
Fit each shot entirely inside the horizontal frame without cropping or stretching; aspect-ratio borders are fine. For the vertical versions, fill the frame using a centered crop without stretching, keeping the same clip order and timing. Use `/root/Desktop/task-01/assets/MiamiCoffeeInc.jpeg` as the branding image in the two branded versions. Keep the entire image visible, upright, at 100% opacity, with its original proportions and background. Place it in the bottom-right corner throughout all 15 seconds, without animation:- Horizontal: 320 pixels wide (approximately 158 pixels high), with its right and bottom edges 48 pixels from the frame edges.- Vertical: 240 pixels wide (approximately 119 pixels high), with its right and bottom edges 32 pixels from the frame edges.
The two unbranded exports should contain no added branding image. Save all four exports in `/root/Desktop/task-01/output`. Also save the editable Filmcraft project there as `proj-task-01.fcproj`, with all three original video sources and the branding image linked. Keep the horizontal and vertical edits and branding overlays editable so I can revise them later.
Use Filmcraft for the edit and preserve the editable Filmcraft timelines and branding overlays.
Use GUI interaction only. You may use GUI file pickers and file managers and write and run scripts inside Filmcraft through its GUI to operate Filmcraft. Do not use terminals, xterm, uxterm, shells, shell launchers, direct command-execution tools, or external scripting consoles. Filmcraft scripts must not launch external processes or commands.12345678910111213141516171819202122232425schema_version = "1.4"artifacts = ["/root/Desktop/task-01", "/root/.local/share/filmcraft", "/root/.config/filmcraft", "/logs/artifacts", "/tmp/task01-filmcraft.log", "/tmp/task01-xfce.log"][task]name = "sid/01-A-name-formats-gui-v3"version = "3.0.0"[agent]timeout_sec = 28800network_mode = "no-network"[environment]network_mode = "no-network"build_timeout_sec = 3600cpus = 4memory_mb = 16384storage_mb = 30720os = "linux"[verifier]timeout_sec = 3600environment_mode = "separate"[verifier.environment]network_mode = "no-network"build_timeout_sec = 3600cpus = 4memory_mb = 8192storage_mb = 30720os = "linux"12345678910111213141516171819202122232425262728293031FROM debian:bookworm-slim@sha256:3783cc01769c7b2b1b83a5c5ad96c815348e28ed7da68e2e3687004faa906251ENV DEBIAN_FRONTEND=noninteractiveARG TARGETARCHRUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg python3 python3-tk python3-numpy python3-pil python3-opencv fontconfig tesseract-ocr ca-certificates \ xvfb xfce4-session xfwm4 xfce4-panel xfce4-settings xfdesktop4 thunar mousepad xterm \ x11vnc xdotool wmctrl imagemagick webp dbus-x11 zenity xdg-desktop-portal xdg-desktop-portal-gtk \ fonts-dejavu-core fonts-liberation libgl1-mesa-dri libgl1 libglu1-mesa \ mesa-vulkan-drivers libvulkan1 libegl1 libx11-6 libx11-xcb1 libxcursor1 libxi6 \ libxrandr2 libxkbcommon0 libwayland-client0 libgtk-3-0 libsm6 libice6 \ libxrender1 libxext6 libxkbcommon-x11-0 libxcb-cursor0 libxcb-icccm4 \ libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 \ libxcb-xinput0 libpulse0 libasound2 libnss3 procps util-linux \ && rm -rf /var/lib/apt/lists/*COPY vendor/filmcraft-${TARGETARCH}.tar.gz /tmp/filmcraft.tar.gzRUN case "$TARGETARCH" in \ amd64) filmcraft_sha=4171c4bf5f57fd29475655f8a6df4719feda8c8f3ed95b2475d8dc112ad3be86 ;; \ arm64) filmcraft_sha=4af56f649a6fb19dcae386abd59921ec6c9190b725014517075fa4d81123c68a ;; \ *) exit 1 ;; esac \ && echo "${filmcraft_sha} /tmp/filmcraft.tar.gz" | sha256sum -c - \ && mkdir -p /opt/filmcraft \ && tar -xzf /tmp/filmcraft.tar.gz -C /opt/filmcraft --strip-components=1 \ && cp -a /opt/filmcraft/share/. /usr/local/share/ \ && ln -s /opt/filmcraft/bin/filmcraft-cli /usr/local/bin/filmcraft-cli \ && rm /tmp/filmcraft.tar.gzENV RAYON_NUM_THREADS=4 SDL_AUDIODRIVER=dummy LIBGL_ALWAYS_SOFTWARE=1 WGPU_BACKEND=vulkan LANG=C.UTF-8 DISPLAY=:1COPY . /tests/RUN mkdir -p /root/Desktop/task-01/output /logs/verifier /logs/artifacts \ && chmod +x /tests/test.shWORKDIR /rootCMD ["sleep", "infinity"]1{"access": "gui"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101"""Private deterministic verifier support; failures of grading never become task deductions."""import json, math, os, re, subprocessfrom pathlib import Pathimport numpy as npfrom PIL import ImageTICKS=254016000000class GradingError(RuntimeError): pass
def commands(trajectory): for step in trajectory.get('steps',[]): if step.get('source')!='agent':continue obs=step.get('observation',{}).get('results',[]) for call in step.get('tool_calls',[]): args=call.get('arguments',{});text=args.get('command') or args.get('text') or '' response=next((o for o in obs if o.get('source_call_id')==call.get('tool_call_id')),{}) output='\n'.join(c.get('text','') for c in response.get('content',[]) if c.get('type')=='text') yield step.get('step_id'),text,output,response
def _action_checks(trajectory, workspace, target_names, assets=None): entries=list(commands(trajectory));app=[];previews=[];queued=[];done=[];started=[];pixel_evidence={} for sid,cmd,out,obs in entries: # A successful editing/export response, rather than help/probe/agent prose. if 'filmcraft-cli' in cmd and any(x in cmd for x in ['timeline.place','file.save','export.queue',' render ',' import ',' exec ']) and ('status=ok' in out or '"ok": true' in out) and any(x in out for x in ['"added"','"item"','"items"','"project"','"result"','saved','"bytes"','"ok"']):app.append(sid) if 'export.queue.start' in cmd:started.append(sid) # Queue-state output proves names/status, not the command's claimed intent. for name in ['final01-1080p.mp4','final01-720p.mp4','final-1080p.mp4']: if re.search(re.escape(name)+r'[^\n]{0,100}\bready\b',out):queued.append((sid,name)) if re.search(re.escape(name)+r'[^\n]{0,100}\bdone\b',out):done.append((sid,name)) if any(x in cmd for x in ['display ','feh ','ristretto ','preview','source.open']) and any(c.get('type')=='image' for c in obs.get('content',[])) and ('status=ok' in out or not out):previews.append(sid) # GUI calls are corroborated by application window observations, not text claims. observations=workspace/'logs/artifacts/runtime-observations.jsonl' if observations.is_file(): for line in observations.read_text().splitlines(): try:r=json.loads(line) except ValueError:continue if 'filmcraft' in r.get('windows','').lower() and any(s.get('tool_calls') for s in trajectory.get('steps',[]) if s.get('source')=='agent'): app.append('observed-filmcraft-window');break pair=[] batch=any(all(any(qsid<start and name==n for qsid,name in queued) for n in pair) and all(any(dsid>=start and name==n for dsid,name in done) for n in pair) for start in started) # Source-associated observations require a source thumbnail creation and delivered preview. source_view={} for n in target_names: extracts=[sid for sid,cmd,out,obs in entries if ('ffmpeg' in cmd or 'preview' in cmd or 'source.open' in cmd) and (n in cmd or n in out) and ('status=ok' in out or not out)] source_view[n]=any(preview>=extract for preview in previews for extract in extracts) if assets is not None and (assets/'operator-screenshots').is_dir() and not all(source_view.values()) and not all(n.startswith(('coffee-','pouring-','hands-')) for n in target_names): from gui_evidence import viewed_sources pixel_view,pixel_evidence=viewed_sources(trajectory,assets,target_names) for name in target_names:source_view[name]=source_view[name] or pixel_view[name] if assets is not None and not batch and (assets/'operator-screenshots').is_dir() and json.loads((assets/'verifier-config.json').read_text()).get('queue_exports'): from gui_evidence import gui_queue gui=gui_queue(trajectory,assets,pair);batch=gui['batch'] queued.extend(('gui',e['names']) for e in gui['events'] if e['ready']);done.extend(('gui',e['names']) for e in gui['events'] if e['done']) return {'app_use':bool(app),'app_steps':app,'source_view':source_view,'preview_steps':previews,'source_view_evidence':pixel_evidence,'batch':batch,'queue_evidence':{'ready':queued,'started':started,'done':done}}
def native_dissolve(selected,clips,j): if not selected or len(clips)<=j:return None a,b=clips[j-1],clips[j];cut=b['start']/TICKS return next((t for t in selected['transitions'] if t.get('effect',{}).get('effect')=='cross_dissolve' and t['effect'].get('enabled',True) and t.get('from')==a['id'] and t.get('to')==b['id'] and t.get('duration',0)>0 and t['start']/TICKS<=cut<=(t['start']+t['duration'])/TICKS),None)
def blend_measure(A,B,O): A=A.astype(float);B=B.astype(float);O=O.astype(float);d=B-A;alpha=float(np.clip(((O-A)*d).sum()/max(1,float((d*d).sum())),0,1));error=float(np.abs(O-(A*(1-alpha)+B*alpha)).mean());return alpha,error
def rendered_assembly(frames,clips,selected,refs): """Check every frame against its source or the paired blend, with source-edge holds.""" if frames is None or not len(frames):return {'full':False,'tails':[False]*3,'joins':[False]*2,'end':False,'errors':[]} errors=[];join_samples=[[],[]];tails=[[],[],[]] trans=[native_dissolve(selected,clips,j) for j in [1,2]] def source(i,t): c=clips[i];f=round((c['source_in']/TICKS+t-c['start']/TICKS)*30);return refs[i][max(0,min(len(refs[i])-1,f))] for f,O in enumerate(frames): t=f/30;beyond_picture=False;fps=selected.get('seq',{}).get('settings',{}).get('frame_rate',{'num':30,'den':1});tail_tolerance=fps['den']/fps['num']+1/30 picture_end=max((c['start']+c['duration'])/TICKS for c in clips) if picture_end<=t<picture_end+tail_tolerance:beyond_picture=True;t=picture_end-1e-7 i=next((i for i,c in enumerate(clips) if c['start']/TICKS<=t<(c['start']+c['duration'])/TICKS),None) if i is None:errors.append(255.);continue blend=next(((j,tr) for j,tr in enumerate(trans) if tr and tr['start']/TICKS<=t<(tr['start']+tr['duration'])/TICKS),None) if blend: j,tr=blend;alpha,err=blend_measure(source(j,t),source(j+1,t),O);join_samples[j].append((alpha,err));tails[j].append(err);tails[j+1].append(err) else: A=source(i,t).astype(float);err=float(abs(O.astype(float)-A).mean()) if not beyond_picture:tails[i].append(err) errors.append(err) def good(v):return bool(bool(v) and np.quantile(v,.99)<=12 and max(v)<=22) joins=[] for samples in join_samples: alphas=[x[0] for x in samples];errs=[x[1] for x in samples];mixed=sum(.12<a<.88 for a in alphas) joins.append(len(samples)>=3 and mixed>=max(2,len(samples)//5) and alphas[-1]-alphas[0]>.5 and all(b>=a-.08 for a,b in zip(alphas,alphas[1:])) and good(errs)) end=max((c['start']+c['duration'])/TICKS for c in clips);endok=abs(len(frames)/30-end)<=max(1/30,selected.get('seq',{}).get('settings',{}).get('frame_rate',{'num':30,'den':1})['den']/selected.get('seq',{}).get('settings',{}).get('frame_rate',{'num':30,'den':1})['num'])+1/30 and good(errors[-3:]) return {'full':good(errors) and all(joins),'tails':[good(v) for v in tails],'joins':joins,'end':endok,'p99_mae':float(np.quantile(errors,.99)),'max_mae':max(errors),'join_samples':join_samples}
def require_complete(result): from verifier_runtime import validate_report return validate_report(result)
# One immutable private trace is evaluated repeatedly for four exports in one grading process._ACTION_CACHE={}def action_checks(trajectory,workspace,target_names,assets=None): import hashlib,copy key=(hashlib.sha256(json.dumps(trajectory,sort_keys=True).encode()).hexdigest(),str(workspace),tuple(target_names),str(assets)) if key not in _ACTION_CACHE:_ACTION_CACHE[key]=_action_checks(trajectory,workspace,target_names,assets) return copy.deepcopy(_ACTION_CACHE[key])1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162"""Deterministic OCR support for actual GUI observations, never agent narrative."""import json,re,subprocess,tempfile,hashlibfrom pathlib import Pathfrom PIL import Image
def gui_queue(trajectory,assets,expected): events=[];cache_path=assets/'gui-ocr-cache.json';cache=json.loads(cache_path.read_text()) if cache_path.exists() else {} for step in trajectory.get('steps',[]): if step.get('source')!='agent':continue for result in step.get('observation',{}).get('results',[]): for part in result.get('content',[]): if part.get('type')!='image':continue name=Path(part.get('source',{}).get('path','')).name;p=assets/'operator-screenshots'/name if not p.is_file():continue digest=hashlib.sha256(p.read_bytes()).hexdigest() key=name+':'+digest if key in cache:text=cache[key] else: with tempfile.TemporaryDirectory() as temp: image=Image.open(p);image.resize((image.width*2,image.height*2)).save(Path(temp)/'screen.png') r=subprocess.run(['tesseract',str(Path(temp)/'screen.png'),'stdout','--psm','11'],capture_output=True,text=True,timeout=20);text=' '.join(r.stdout.split()).lower() cache[key]=text;cache_path.write_text(json.dumps(cache)) if 'queue' not in text and 'export' not in text:continue names=[n for n in expected if n.lower().replace('.mp4','') in text or n.lower() in text] if len(names)==len(expected):events.append({'step':step['step_id'],'names':names,'ready':any(x in text for x in ['ready','pending','queued']),'done':any(x in text for x in ['completed','done','finished']),'text':text}) return {'batch':any(a['ready'] and b['done'] and a['step']<b['step'] for a in events for b in events),'events':events}
def viewed_sources(trajectory,assets,names): """Match source pixels to delivered screenshots using fixed SIFT/RANSAC thresholds.""" import cv2,numpy as np paths=set() for step in trajectory.get('steps',[]): if step.get('source')!='agent':continue for result in step.get('observation',{}).get('results',[]): for part in result.get('content',[]): if part.get('type')=='image':paths.add(Path(part.get('source',{}).get('path','')).name) sift=cv2.SIFT_create(nfeatures=1500);screens=[] for name in sorted(paths): p=assets/'operator-screenshots'/name if not p.is_file():continue img=cv2.imread(str(p),cv2.IMREAD_GRAYSCALE) if img is None:continue k,d=sift.detectAndCompute(img,None) if d is not None:screens.append((name,k,d)) if not screens:raise RuntimeError('No delivered screenshots available for deterministic source-view check') found={n:False for n in names};evidence={};matcher=cv2.BFMatcher() for name in names: capture=cv2.VideoCapture(str(assets/'reference'/name)) for second in [0,1,2,4]: capture.set(cv2.CAP_PROP_POS_MSEC,second*1000);ok,img=capture.read() if not ok:continue img=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY);img=cv2.resize(img,(640,round(img.shape[0]*640/img.shape[1])));k,d=sift.detectAndCompute(img,None) if d is None:continue for shot,ks,ds in screens: pairs=matcher.knnMatch(d,ds,k=2);good=[a for pair in pairs if len(pair)==2 for a,b in [pair] if a.distance<.70*b.distance] if len(good)<12:continue src=np.float32([k[m.queryIdx].pt for m in good]);dst=np.float32([ks[m.trainIdx].pt for m in good]);H,inliers=cv2.findHomography(src,dst,cv2.RANSAC,3) if H is not None and inliers is not None and int(inliers.sum())>=10 and int(inliers.sum())/len(good)>=.5: found[name]=True;evidence[name]={'screenshot':shot,'source_second':second,'inliers':int(inliers.sum())};break if found[name]:break capture.release() return found,evidence12345678910111213141516171819202122232425262728293031323334{ "coffee-beans-closeup-4k.mp4": { "sha256": "ea4d290e4cc4fedd8f6bec568e54a307dcbdfaff69f8352fd1c9b2a06cab510a", "bytes": 33451395, "width": 4096, "height": 2160, "duration": 17.784433, "sample_aspect_ratio": "1:1" }, "pouring-coffee-carafe-4k.mp4": { "sha256": "b20436e83fbd2845229990b63e27cb2904ee0db080a619d8ae4ec979d4d0a776", "bytes": 43861265, "width": 3840, "height": 2160, "duration": 34.52, "sample_aspect_ratio": "1:1" }, "hands-cup-pickup-4k.mp4": { "sha256": "e9ba1185e7135cab1caa15ee156f2c168e83db04e78ecb54ea870181817fe88c", "bytes": 7366009, "width": 3840, "height": 2160, "duration": 7.338, "sample_aspect_ratio": "1:1" }, "MiamiCoffeeInc.jpeg": { "sha256": "eb854ca9ef91e87cd34068df8001e5e8feba2d1607b123d33f759d70132cb312", "bytes": 106590, "width": 1024, "height": 506, "duration": 0.04, "sample_aspect_ratio": "1:1" }}123456#!/bin/shset -eu# Operator evidence is delivered only to the isolated grader.i=0while [ ! -s /tests/operator-evidence-ready.json ] && [ "$i" -lt 150 ]; do sleep 2; i=$((i+1)); donepython3 /tests/verify.py --workspace / --report-dir /logs/verifier12345{ "runtime_version": "20261016.2", "queue_exports": [], "weights_unchanged": true}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172"""Private deterministic grading runtime. Never emit a task reward for grader errors."""import json,math,shutil,subprocess,hashlibfrom pathlib import Pathclass VerifierInfrastructureError(RuntimeError):pass
def preflight(assets,access): for command in ['ffmpeg','ffprobe','filmcraft-cli','fc-match']: if not shutil.which(command):raise VerifierInfrastructureError('Required grading tool missing: '+command) for package in ['numpy','PIL']: try:__import__(package) except ImportError as e:raise VerifierInfrastructureError('Required grading dependency missing: '+package) from e trace=assets/'operator-trajectory.json' if not trace.is_file():raise VerifierInfrastructureError('Private operator trajectory missing') data=json.loads(trace.read_text()) if not isinstance(data.get('steps'),list):raise VerifierInfrastructureError('Invalid private trajectory schema') if access=='gui': try:__import__('cv2') except ImportError as e:raise VerifierInfrastructureError('Required GUI grading dependency missing: cv2') from e if not shutil.which('tesseract'):raise VerifierInfrastructureError('Required GUI grading tool missing: tesseract') missing=[] for step in data['steps']: for result in step.get('observation',{}).get('results',[]): for part in result.get('content',[]): if part.get('type')=='image' and part.get('source',{}).get('path'): name=Path(part['source']['path']).name if not (assets/'operator-screenshots'/name).is_file():missing.append(name) if missing:raise VerifierInfrastructureError('Missing private delivered screenshots: '+', '.join(sorted(set(missing))[:10])) ready=assets/'operator-evidence-ready.json' if ready.exists(): declared=json.loads(ready.read_text()) if declared.get('trajectory_sha256')!=hashlib.sha256(trace.read_bytes()).hexdigest() or not declared.get('screenshots_complete'):raise VerifierInfrastructureError('Private evidence ready marker does not match supplied trajectory') return {'trajectory_sha256':hashlib.sha256(trace.read_bytes()).hexdigest(),'access':access}
def validate_report(result): total=earned=0 for key,row in result['rubric'].items(): weights=sum(c['possible'] for c in row['checks']) if not math.isclose(weights,row['possible'],abs_tol=1e-5):raise VerifierInfrastructureError('Rubric weight mismatch: '+key) for c in row['checks']: if c['state'] not in ['met','unmet']:raise VerifierInfrastructureError('Unresolved weighted criterion: '+key+'/'+c['id']) if not str(c.get('evidence','')).strip():raise VerifierInfrastructureError('Missing check evidence: '+key+'/'+c['id']) points=sum(c['possible'] for c in row['checks'] if c['state']=='met') if not math.isclose(points,row['earned'],abs_tol=1e-5):raise VerifierInfrastructureError('Earned points mismatch: '+key) total+=row['possible'];earned+=points if not math.isclose(total,100,abs_tol=1e-5) or not math.isclose(earned,result['resolved_score'],abs_tol=1e-5):raise VerifierInfrastructureError('Score/weight total mismatch') if result.get('unresolved_points')!=0:raise VerifierInfrastructureError('Final reward cannot contain unresolved weighted checks') return result
def select_project(required): if required.is_file():return required # Exact stem without the app suffix is a filename error, not absent editing work. alternate=required.with_suffix('') if alternate.is_file(): try: if json.loads(alternate.read_text()).get('format')=='filmcraft.project':return alternate except (ValueError,OSError):pass return required
def cli_main(evaluate,default_assets): import argparse p=argparse.ArgumentParser();p.add_argument('--workspace',type=Path,required=True);p.add_argument('--report-dir',type=Path,required=True);p.add_argument('--assets',type=Path,default=default_assets);p.add_argument('--access',choices=['gui','terminal']);a=p.parse_args();a.report_dir.mkdir(parents=True,exist_ok=True) for name in ['reward.json','reward.txt','infrastructure-error.json']:(a.report_dir/name).unlink(missing_ok=True) try: access=a.access or json.loads((a.assets/'access.json').read_text())['access'];receipt=preflight(a.assets,access) result=validate_report(evaluate(a.workspace,a.report_dir,a.assets,access));result['grading_runtime']={'version':'20261016.2',**receipt} (a.report_dir/'rubric.json').write_text(json.dumps(result,indent=2)+'\n') (a.report_dir/'reward.json').write_text(json.dumps({'reward':result['resolved_score']/100,'score_points':result['resolved_score'],'unresolved_points':0})+'\n') print(json.dumps({'score_range':result['score_range'],'policy':result.get('policy')})) except Exception as e: for name in ['reward.json','reward.txt']:(a.report_dir/name).unlink(missing_ok=True) (a.report_dir/'infrastructure-error.json').write_text(json.dumps({'classification':'verifier_error','error_type':type(e).__name__,'error':str(e),'task_reward_published':False},indent=2)) raise123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281"""Filmcraft formats v3 verifier. Numeric rewards require complete deterministic checks.Run in a separate verifier container, or on externally collected artifacts.Missing grading evidence raises an infrastructure error; never infer app use."""import argparse,hashlib,json,math,os,shutil,subprocess,tempfilefrom pathlib import Pathfrom verifier_runtime import select_projectimport numpy as npfrom deterministic_checks import action_checks,GradingError,require_completefrom PIL import ImageTICKS=254016000000SOURCES=['coffee-beans-closeup-4k.mp4','pouring-coffee-carafe-4k.mp4','hands-cup-pickup-4k.mp4']BRAND='MiamiCoffeeInc.jpeg'EXPORTS={'final-01-horizontal.mp4':(1920,1080,False),'final-01-horizontal-branded.mp4':(1920,1080,True),'final-01-vertical.mp4':(1080,1920,False),'final-01-vertical-branded.mp4':(1080,1920,True)}POINTS=dict(zip(['a','c','d']+list('efghijklmnop'),[2,4,4,8,9,12,6,8,5,10,12,6,6,4,4]))LABELS=dict(zip(POINTS,['Filmcraft use','Four assets imported','Editable sequence created','Source order','First five seconds at normal speed','Decoded footage in four exports','Cuts and duration','H.264 MP4 dimensions and 30 fps','Export filenames and save directory','Fit and centered crop without stretching','Editable native project and links','Correct opaque branding image','Brand dimensions and margins','Continuous stationary branding','Unbranded outputs clean']))assert sum(POINTS.values())==100
def digest(p): h=hashlib.sha256() with p.open('rb') as f: for block in iter(lambda:f.read(1024*1024),b''):h.update(block) return h.hexdigest()def run(args,timeout=120):return subprocess.run(args,capture_output=True,timeout=timeout)def probe(p): r=run(['ffprobe','-v','error','-show_streams','-show_format','-of','json',str(p)]) if r.returncode:raise ValueError(r.stderr.decode(errors='replace')[-1000:]) d=json.loads(r.stdout);s=next(s for s in d['streams'] if s['codec_type']=='video') return d,sdef val(effect,name,default=None): p=effect.get('params',{}).get(name,{}) if p.get('keyframes'):return None v=p.get('value',{}) return next(iter(v.values()),default) if isinstance(v,dict) else v
def normal(c,media): if c.get('speed',1)!=1 or c.get('reverse') or c.get('frame_hold') is not None:return False interpret=media.get('interpret',{}) if interpret.get('frame_rate'):return None for e in c.get('effects',[]): if e.get('enabled',True) and e.get('effect')=='time_remap': speed=val(e,'speed',100) if speed is None:return None if speed!=100:return False return True
def geometry(c,media,w,h): """Resolve basic motion, including scale-to-frame and anchor offsets. Unknown effects/keyframes/PAR overrides defer to native/render review. """ v=media.get('info',{}).get('video') if not v:return None sw,sh=v['width'],v['height'];par=v.get('par',[1,1]);interp=media.get('interpret',{}) if interp.get('par') or par[0]!=par[1]:return None motion=None;opacity=100 for e in c.get('effects',[]): if not e.get('enabled',True):continue kind=e.get('effect') if kind=='motion':motion=e elif kind=='opacity': opacity=val(e,'opacity',100) if val(e,'blend',0)!=0:return None elif kind=='time_remap':continue else:return None if not motion:return None scale=val(motion,'scale',100);width=val(motion,'scale_width',100);uniform=val(motion,'uniform_scale',True) position=val(motion,'position',{'x':w/2,'y':h/2});anchor=val(motion,'anchor',{'x':sw/2,'y':sh/2});rotation=val(motion,'rotation',0) if any(x is None for x in [scale,width,uniform,position,anchor,rotation,opacity]):return None if rotation!=0:return {'upright':False,'opacity':opacity} base=min(w/sw,h/sh) if c.get('scale_to_frame') else 1 sy=base*scale/100;sx=sy if uniform else base*width/100 return {'x':position['x']-anchor['x']*sx,'y':position['y']-anchor['y']*sy,'w':sw*sx,'h':sh*sy,'sx':sx,'sy':sy,'upright':True,'opacity':opacity}
def decoded_frames(p,w,h,filter_prefix='',limit=None): vf=filter_prefix+(',' if filter_prefix else '')+f'scale={w}:{h}:flags=area' args=['ffmpeg','-v','error','-threads','2','-i',str(p),'-an','-vf',vf] if limit:args+=['-frames:v',str(limit)] args+=['-pix_fmt','rgb24','-f','rawvideo','pipe:1'] r=run(args,timeout=600) if r.returncode:raise ValueError(r.stderr.decode(errors='replace')[-1000:]) size=w*h*3 if len(r.stdout)%size:raise ValueError('Partial decoded frame') return np.frombuffer(r.stdout,dtype=np.uint8).reshape(-1,h,w,3)
def reference_frames(p,W,H): _,s=probe(p);sw,sh=s['width'],s['height'];scale=min(W/sw,H/sh) if W>H else max(W/sw,H/sh) rw=round(sw*scale);rh=round(sh*scale) vf=f'trim=start=0:end=5,setpts=PTS-STARTPTS,fps=30,scale={rw}:{rh}:flags=bicubic,setsar=1' vf+=f',pad={W}:{H}:(ow-iw)/2:(oh-ih)/2:black' if W>H else f',crop={W}:{H}:(iw-ow)/2:(ih-oh)/2' return decoded_frames(p,192 if W>H else 108,108 if W>H else 192,vf,150)
def evaluate(workspace,report_dir,assets,access): out=workspace/'root/Desktop/task-01/output';project=out/'proj-task-01.fcproj' required_project=project;project=select_project(project) report_dir.mkdir(parents=True,exist_ok=True) manifest=json.loads((assets/'source-manifest.json').read_text()) rows={k:{'requirement':LABELS[k],'possible':v,'checks':[]} for k,v in POINTS.items()} def add(k,id,points,state,evidence): rows[k]['checks'].append({'id':id,'possible':points,'state':'unknown' if state is None else 'met' if state else 'unmet','evidence':str(evidence)}) def resolve(path): p=Path(path) return workspace/path.lstrip('/') if p.is_absolute() else project.parent/p doc={};project_error=None if project.is_file(): try: doc=json.loads(project.read_text()) if doc.get('format')!='filmcraft.project':raise ValueError('Unsupported native project format') except Exception as e:project_error=str(e);doc={} items=doc.get('project',{}).get('items',{});links={} for id,item in items.items(): media=item.get('kind',{}).get('Media',{});path=media.get('media',{}).get('File',{}).get('path') if not path:continue p=resolve(path);sha=digest(p) if p.is_file() else None name=next((n for n,v in manifest.items() if v['sha256']==sha),None) links[id]={'name':name,'valid':bool(name) and not media.get('offline',False),'path':path,'media':media} imported={l['name'] for l in links.values() if l['valid']} for name in SOURCES+[BRAND]:add('c',name,1,name in imported,'Hash verified native media records; initial environment is empty') trace=assets/'operator-trajectory.json' if not trace.is_file():raise GradingError('Missing private operator trajectory for app use') actions=action_checks(json.loads(trace.read_text()),workspace,SOURCES,assets) add('a','action-evidence',2,actions['app_use'],'Requires operator review of agent trajectory/app execution; project alone is insufficient') native=None;native_error=None if project.is_file() and doc and shutil.which('filmcraft-cli'): result=run(['filmcraft-cli','--project',str(project),'inspect'],timeout=180) (report_dir/'native-inspection.stdout').write_bytes(result.stdout) (report_dir/'native-inspection.stderr').write_bytes(result.stderr) if result.returncode==0: try:native=json.loads(result.stdout) except ValueError:native_error='Native inspect emitted invalid JSON' else:native_error='Native load failed; review stderr for app/dependency versus project failure' seqs=[] for id,item in items.items(): s=item.get('kind',{}).get('Sequence') if not s:continue footage=[];brands=[];other=[];trans=[] tracks=s.get('video_tracks',[]);solo=any(t.get('solo') for t in tracks) for t in tracks: if not t.get('enabled',True) or (solo and not t.get('solo')):continue trans+=t.get('transitions',[]) for c in t.get('items',[]): if not c.get('enabled',True):continue link=links.get(str(c.get('item')),{});name=link.get('name') if name in SOURCES:footage.append(c) elif name==BRAND:brands.append(c) else:other.append(c) footage.sort(key=lambda c:c.get('start',0)) seqs.append({'id':id,'seq':s,'clips':footage,'brands':brands,'other':other,'trans':trans}) relevant=[s for s in seqs if s['clips']] editable=bool(relevant) and bool(native) add('d','new-source-backed-sequence',4,editable if native is not None or not project.exists() else None,'Native load and saved source-backed sequence; '+str(native_error)) # Conservative aggregation across all footage edits. Nested/nonstandard structures need review. orders=[[links[str(c['item'])]['name'] for c in s['clips']] for s in relevant] for i,name in enumerate(SOURCES): ok=bool(orders) and all(len(o)>i and o[i]==name for o in orders) add('e',f'position-{i}',2,ok if relevant or not project.exists() else None,orders) add('e','exact-order',2,bool(orders) and all(o==SOURCES for o in orders) and all(not s['other'] for s in relevant) if relevant or not project.exists() else None,orders) for name in SOURCES: clips=[c for s in relevant for c in s['clips'] if links[str(c['item'])]['name']==name] for prop in ['source-zero','five-seconds','normal']: values=[abs(c.get('source_in',0)/TICKS)<=1/30 if prop=='source-zero' else abs(c.get('duration',0)/TICKS-5)<=1/30 if prop=='five-seconds' else normal(c,links[str(c['item'])]['media']) for c in clips] ok=(all(values) if None not in values else None) if values else False if not project.exists() else None add('f',name+'/'+prop,1,ok,values) native_bounds=[] for idx in [1,2]: v=[len(s['clips'])>idx and abs(s['clips'][idx]['start']/TICKS-idx*5)<=1/30 and not s['trans'] for s in relevant] add('h',f'native-cut-{idx}',1,all(v) if v else False if not project.exists() else None,v) gap=[] for s in relevant: cs=s['clips'];gap.append(len(cs)==3 and not s['other'] and not s['trans'] and abs(cs[0]['start']/TICKS)<=1/30 and all(abs((cs[i-1]['start']+cs[i-1]['duration']-cs[i]['start'])/TICKS)<=1/30 for i in [1,2]) and abs((cs[-1]['start']+cs[-1]['duration'])/TICKS-15)<=1/30) add('h','native-duration-gapfree',1,all(gap) if gap else False if not project.exists() else None,gap) add('l','filename',1,required_project.is_file(),'Exact project submission filename') add('l','directory',1,project.is_file(),'Original workspace path; restore collected workspace layout') add('l','native-load',3,bool(native) if native is not None or not project.exists() else None,native_error or 'Native inspect success' if native else 'Native app load unverified') dims={(s['seq'].get('settings',{}).get('width'),s['seq'].get('settings',{}).get('height')) for s in relevant} brand_seqs=[s for s in seqs if any(links.get(str(c.get('item')),{}).get('name')==BRAND for t in s['seq'].get('video_tracks',[]) for c in t.get('items',[]))] add('l','editable-orientations-overlays',3,(editable and {(1920,1080),(1080,1920)}<=dims and bool(brand_seqs)) if native is not None or not project.exists() else None,'Source-backed footage and image clips; equivalent nested arrangements require review') for name in SOURCES+[BRAND]:add('l','link/'+name,1,name in imported,'Actual resolved source hash') cache={};probes={};visual={} for filename,(W,H,branded) in EXPORTS.items(): p=out/filename;present=p.is_file();frames=None;s={};d={};decode_error=None if present: try:d,s=probe(p);frames=decoded_frames(p,192 if W>H else 108,108 if W>H else 192) except Exception as e:decode_error=str(e) valid=frames is not None and len(frames)>0 probes[filename]={'present':present,'probe':d,'decode_error':decode_error,'frames':len(frames) if valid else 0} add('j',filename+'/name',.75,present,'Exact requested filename') add('j',filename+'/directory',.5,present,'Original submission workspace path') fps=s.get('avg_frame_rate','0/1').split('/');rate=float(fps[0])/max(1,float(fps[1])) timestamp_ok=False if valid: r=run(['ffprobe','-v','error','-select_streams','v:0','-show_entries','frame=best_effort_timestamp_time','-of','json',str(p)],timeout=180) if r.returncode==0: ts=[float(f['best_effort_timestamp_time']) for f in json.loads(r.stdout)['frames'] if 'best_effort_timestamp_time' in f] timestamp_ok=len(ts)==len(frames) and len(ts)>1 and max(abs((b-a)-1/30) for a,b in zip(ts,ts[1:]))<.0001 for prop,ok in [('container','mp4' in d.get('format',{}).get('format_name','')),('codec',s.get('codec_name')=='h264'),('dimensions',(s.get('width'),s.get('height'))==(W,H) and not any('rotation' in x and x['rotation']%360 for x in s.get('side_data_list',[])) and s.get('sample_aspect_ratio','1:1') in ['1:1','N/A']),('fps',abs(rate-30)<.001 and timestamp_ok)]:add('i',filename+'/'+prop,.5,valid and ok,'Decoded export probe/timestamps') matches=[];errors=[] if valid: for i,name in enumerate(SOURCES): key=(name,W,H) if key not in cache:cache[key]=reference_frames(assets/'reference'/name,W,H) ref=cache[key];segment=frames[i*150:(i+1)*150] if len(segment)!=150 or len(ref)!=150:matches.append(False);errors.append(None);continue mask=np.ones(segment.shape[1:3],bool) if branded: # Ignore branding-covered pixels only for footage comparison. bw=320 if W>H else 240;bh=bw*506/1024;margin=48 if W>H else 32 y0=max(0,int((H-margin-bh)/H*mask.shape[0])-2);x0=max(0,int((W-margin-bw)/W*mask.shape[1])-2) mask[y0:,x0:]=False delta=np.abs(segment.astype(np.float32)-ref.astype(np.float32))[:,mask,:].mean(axis=(1,2)) # Adjacent frames allow 25/29.97-to-30 resampling. Starts/cut boundaries stay explicit. for shift in [-1,1]: alt=np.roll(ref,shift,axis=0);alt_delta=np.abs(segment.astype(np.float32)-alt.astype(np.float32))[:,mask,:].mean(axis=(1,2));alt_delta[:2]=delta[:2];alt_delta[-2:]=delta[-2:];delta=np.minimum(delta,alt_delta) errors.append({'mean':float(delta.mean()),'p99':float(np.quantile(delta,.99)),'max':float(delta.max())}) matches.append(bool(np.quantile(delta,.99)<=12 and delta.max()<=22)) else:matches=[False]*3 visual[filename]={'segment_matches':matches,'errors':errors,'method':'All decoded frames at 1/10 display size; source-time reference, adjacent-frame allowance; MAE p99<=12, max<=22. Filmcraft-specific calibration still requires live fixtures.'} for i in range(3):add('g',filename+f'/segment-{i}',1,True if valid and matches[i] else False,visual[filename]) for i in [1,2]:add('h',filename+f'/cut-{i}',.25,True if valid and matches[i-1] and matches[i] and len(frames)==450 else False,'Decoded source mapping through boundary') duration=float(d.get('format',{}).get('duration',0));add('h',filename+'/duration-gapfree',.25,valid and len(frames)==450 and abs(duration-15)<=1/30 if not valid or all(matches) else None,'Decoded frame count and full-duration source mapping') # Project geometry corroborated by matching decoded footage. selected=[q for q in relevant if (q['seq']['settings'].get('width'),q['seq']['settings'].get('height'))==(W,H)] geoms=[] for i,name in enumerate(SOURCES): gs=[geometry(c,links[str(c['item'])]['media'],W,H) for q in selected for c in q['clips'] if links[str(c['item'])]['name']==name] understood=bool(gs) and all(g and 'sx' in g for g in gs) proportional=understood and all(abs(g['sx']-g['sy'])<1e-5 for g in gs) framed=understood and all(abs(g['x']-(W-g['w'])/2)<=2 and abs(g['y']-(H-g['h'])/2)<=2 and (abs(max(g['w']/W,g['h']/H)-1)<.003 if W>H else abs(min(g['w']/W,g['h']/H)-1)<.003) for g in gs) add('k',filename+f'/shot-{i}/frame',.5,True if valid and matches[i] and framed else False,gs) add('k',filename+f'/shot-{i}/proportional',1/3,True if valid and matches[i] and proportional else False,gs) brand_match=None if branded: bw=320 if W>H else 240;bh=bw*506/1024;margin=48 if W>H else 32 gs=[geometry(c,links[str(c['item'])]['media'],W,H) for q in seqs if (q['seq']['settings'].get('width'),q['seq']['settings'].get('height'))==(W,H) for t in q['seq'].get('video_tracks',[]) for c in t.get('items',[]) if links.get(str(c.get('item')),{}).get('name')==BRAND] gs=[g for g in gs if g] # Full-resolution crop every frame verifies entire JPEG/background and opacity. if valid: x=W-margin-bw;y=round(H-margin-bh);hh=round(bh) patch=decoded_frames(p,bw,hh,f'format=rgb24,crop={bw}:{hh}:{x}:{y}:exact=1') ref=np.asarray(Image.open(assets/'reference'/BRAND).convert('RGB').resize((bw,hh),Image.Resampling.BICUBIC)).astype(np.float32) dist=np.abs(patch.astype(np.float32)-ref).mean(axis=(1,2,3)) brand_match=bool(len(patch)==450 and np.quantile(dist,.99)<14 and dist.max()<22) visual[filename]['branding_error']={'mean':float(dist.mean()),'max':float(dist.max()),'all_frames':len(patch)} if len(patch) else {} upright=bool(gs) and any(g.get('upright') and 'w' in g for g in gs) geom=next((g for g in gs if g.get('upright') and 'w' in g and abs(g['w']-bw)<=2 and abs(W-g['x']-g['w']-margin)<=2 and abs(H-g['y']-g['h']-margin)<=2),None) for prop in ['identity','entire-upright','opacity']: ok=brand_match and bool(gs) if prop=='identity' else brand_match and upright if prop=='entire-upright' else brand_match and any(g.get('opacity')==100 for g in gs) add('m',filename+'/'+prop,1,True if ok else False,'Full-resolution branding crop across every frame and hash-linked image transforms') for prop,pts,ok in [('width',1,geom and abs(geom['w']-bw)<=2),('proportions',1,geom and abs(geom['w']/geom['h']-1024/506)<.02),('right',.5,geom and abs(W-geom['x']-geom['w']-margin)<=2),('bottom',.5,geom and abs(H-geom['y']-geom['h']-margin)<=2)]:add('n',filename+'/'+prop,pts,True if brand_match and ok else False,gs) intervals=[(c['start']/TICKS,(c['start']+c['duration'])/TICKS) for q in seqs if (q['seq']['settings'].get('width'),q['seq']['settings'].get('height'))==(W,H) for t in q['seq'].get('video_tracks',[]) for c in t.get('items',[]) if links.get(str(c.get('item')),{}).get('name')==BRAND] coverage=0 for a,b in sorted(intervals): if a<=coverage+1/30:coverage=max(coverage,b) add('o',filename+'/visible',1,True if brand_match and coverage>=15-1/30 else False,intervals) add('o',filename+'/stationary',1,True if brand_match and geom and coverage>=15-1/30 else False,'All decoded frames and static geometry/opacity') else:add('p',filename+'/clean',2,True if valid and all(matches) else False,'Full-frame source comparison throughout all segments; source text is allowed') # Optional operator-reviewed atoms with hash binding; never trust agent-authored evidence. submission={p.name:digest(p) for p in out.iterdir() if p.is_file()} if out.is_dir() else {} review_path=report_dir/'operator-review.json' review=json.loads(review_path.read_text()) if review_path.exists() else {} review_valid=review.get('submission_sha256')==submission and bool(review.get('reviewer')) and bool(review.get('evidence')) for k,row in rows.items(): assert math.isclose(sum(c['possible'] for c in row['checks']),row['possible']),k row['earned']=sum(c['possible'] for c in row['checks'] if c['state']=='met') row['unresolved']=sum(c['possible'] for c in row['checks'] if c['state']=='unknown') row['status']='unknown' if row['unresolved'] else 'met' if math.isclose(row['earned'],row['possible']) else 'partially_met' if row['earned'] else 'unmet' earned=sum(r['earned'] for r in rows.values());unknown=sum(r['unresolved'] for r in rows.values()) policy=review.get('policy','unknown') if review_valid else 'unknown' if access=='terminal':policy='pass' # No terminal prohibition; Filmcraft use scored separately. if policy not in ['pass','fail','unknown']:policy='unknown' result={'rubric_version':'01-A-name-formats-v3','rubric':rows,'resolved_score':round(earned,6),'unresolved_points':round(unknown,6),'score_range':[round(earned,6),round(earned+unknown,6)],'policy':policy,'access':access,'evaluation_validity':'resolved' if unknown==0 else 'partial evidence; review unknown checks','project_error':project_error,'native_error':native_error,'exports':probes,'visual_evidence':visual,'submission_sha256':submission,'operator_review_applied':review_valid,'limitations':['Checks use fixed native schema, decoded-frame tolerances and private action/screenshot evidence.','Unsupported structures or missing grading evidence raise a verifier error and withhold reward.','Fixture and saved-attempt regression results are recorded separately from oracle validation.']} require_complete(result) (report_dir/'rubric.json').write_text(json.dumps(result,indent=2)+'\n') (report_dir/'review-template.json').write_text(json.dumps({'reviewer':'','evidence':[],'submission_sha256':submission,'policy':'unknown','checks':{k+'/'+c['id']:{'state':'unknown','evidence':''} for k,r in rows.items() for c in r['checks'] if c['state']=='unknown'}},indent=2)+'\n') rewards={'reward':earned/100,'score_points':earned,'unresolved_points':unknown,'possible_upper_bound':(earned+unknown)/100} (report_dir/'reward.json').write_text(json.dumps(rewards,indent=2)+'\n') return result
def main(): from verifier_runtime import cli_main cli_main(evaluate,Path(__file__).resolve().parent)if __name__=='__main__':main()12345678# 01-B-name-batch-gui-v4
Harbor schema 1.4, Filmcraft 0.7.2, gui access.Three targets, five distractors, the supplied music file, and a starting distractor-only bin project.Two horizontal batch exports using source tails, editable cross dissolves and trimmed music.
[Operator setup and validation](../../reports/task01-B-name-batch-v4/README.md).Live app and oracle validation pending; no runs launched.1234567891011121314151617181920212223242526272829303132333435363738FROM debian:bookworm-slim@sha256:3783cc01769c7b2b1b83a5c5ad96c815348e28ed7da68e2e3687004faa906251ENV DEBIAN_FRONTEND=noninteractiveARG TARGETARCHRUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg python3 python3-tk python3-numpy python3-pil ca-certificates \ xvfb xfce4-session xfwm4 xfce4-panel xfce4-settings xfdesktop4 thunar mousepad xterm \ x11vnc xdotool wmctrl imagemagick webp dbus-x11 zenity xdg-desktop-portal xdg-desktop-portal-gtk \ fonts-dejavu-core fonts-liberation libgl1-mesa-dri libgl1 libglu1-mesa \ mesa-vulkan-drivers libvulkan1 libegl1 libx11-6 libx11-xcb1 libxcursor1 libxi6 \ libxrandr2 libxkbcommon0 libwayland-client0 libgtk-3-0 libsm6 libice6 \ libxrender1 libxext6 libxkbcommon-x11-0 libxcb-cursor0 libxcb-icccm4 \ libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 \ libxcb-xinput0 libpulse0 libasound2 libnss3 procps util-linux \ && rm -rf /var/lib/apt/lists/*COPY vendor/filmcraft-${TARGETARCH}.tar.gz /tmp/filmcraft.tar.gzRUN case "$TARGETARCH" in \ amd64) filmcraft_sha=4171c4bf5f57fd29475655f8a6df4719feda8c8f3ed95b2475d8dc112ad3be86 ;; \ arm64) filmcraft_sha=4af56f649a6fb19dcae386abd59921ec6c9190b725014517075fa4d81123c68a ;; \ *) exit 1 ;; esac \ && echo "${filmcraft_sha} /tmp/filmcraft.tar.gz" | sha256sum -c - \ && mkdir -p /opt/filmcraft \ && tar -xzf /tmp/filmcraft.tar.gz -C /opt/filmcraft --strip-components=1 \ && cp -a /opt/filmcraft/share/. /usr/local/share/ \ && ln -s /opt/filmcraft/bin/filmcraft-cli /usr/local/bin/filmcraft-cli \ && rm /tmp/filmcraft.tar.gzENV RAYON_NUM_THREADS=4 SDL_AUDIODRIVER=dummy LIBGL_ALWAYS_SOFTWARE=1 WGPU_BACKEND=vulkan LANG=C.UTF-8 DISPLAY=:1COPY desktop/ /root/Desktop/COPY start-editor.sh filmcraft-wrapper.sh /usr/local/bin/COPY filmcraft.desktop /root/Desktop/Filmcraft.desktopRUN mkdir -p /root/Desktop/final01/output /logs/artifacts \ && chmod +x /usr/local/bin/start-editor.sh /usr/local/bin/filmcraft-wrapper.sh /root/Desktop/Filmcraft.desktop \ && ln -s /usr/local/bin/filmcraft-wrapper.sh /usr/local/bin/filmcraft \ && chmod -R a+rX /root/Desktop/task-01/mediaCOPY files.py /opt/gui-only/files.pyCOPY install-gui.py /opt/gui-only/install.pyRUN python3 /opt/gui-only/install.pyWORKDIR /rootCMD ["/usr/local/bin/start-editor.sh"]1{"format": "filmcraft.project", "schema_version": 15, "generator": "FilmCraft 0.7.2", "project": {"name": "Starting media", "settings": {"renderer": "FilmCraft GPU Acceleration (wgpu)", "video_display": "Timecode", "audio_display_samples": true, "default_still_duration": 1270080000000, "default_transition_duration_frames": 24, "default_audio_transition_duration": 254016000000, "ingest": {"enabled": false, "action": "createProxies", "destination": null, "preset": ""}, "title_safe": [20.0, 20.0], "action_safe": [10.0, 10.0], "capture_format": "DV", "scratch": {"captured": null, "videoPreviews": null, "audioPreviews": null, "autoSave": null}}, "root": {"id": 0, "name": "Starting media", "children": [{"Item": 1}, {"Item": 2}, {"Item": 3}, {"Item": 4}, {"Item": 5}]}, "items": {"1": {"id": 1, "name": "IMG_7039.MOV", "label": "Violet", "kind": {"Media": {"media": {"File": {"path": "/root/Desktop/task-01/media/IMG_7039.MOV"}}, "info": {"name": "IMG_7039.MOV", "kind": "Movie", "duration": 2871650880000, "video": {"width": 3840, "height": 2160, "frame_rate": {"num": 25425, "den": 848}, "par": [1, 1], "codec": "H.264 (High)", "pixel_format": "YUV 4:2:0 8-bit", "color": {"matrix": "Bt709", "transfer": "Bt709", "primaries": "Bt709", "range": "Limited"}, "has_alpha": false, "bitrate": 15043926}, "audio_streams": [{"sample_rate": 44100, "channels": 2, "codec": "aac", "bits_per_sample": null}], "container": "MPEG-4", "start_timecode": null, "file_size": 33138797}, "interpret": {"frame_rate": null, "par": null, "ignore_alpha": false, "invert_alpha": false}, "mark_in": null, "mark_out": null, "markers": [], "offline": false, "proxy": null, "identity": null}}, "metadata": {}, "created": 1}, "2": {"id": 2, "name": "chart-daylight-5600k-0ev-rec709.mp4", "label": "Violet", "kind": {"Media": {"media": {"File": {"path": "/root/Desktop/task-01/media/chart-daylight-5600k-0ev-rec709.mp4"}}, "info": {"name": "chart-daylight-5600k-0ev-rec709.mp4", "kind": "Movie", "duration": 2540160000000, "video": {"width": 3840, "height": 2160, "frame_rate": {"num": 30, "den": 1}, "par": [1, 1], "codec": "H.264 (High)", "pixel_format": "YUV 4:2:0 8-bit", "color": {"matrix": "Bt709", "transfer": "Bt709", "primaries": "Bt709", "range": "Limited"}, "has_alpha": false, "bitrate": 15043926}, "audio_streams": [], "container": "MPEG-4", "start_timecode": null, "file_size": 87694}, "interpret": {"frame_rate": null, "par": null, "ignore_alpha": false, "invert_alpha": false}, "mark_in": null, "mark_out": null, "markers": [], "offline": false, "proxy": null, "identity": null}}, "metadata": {}, "created": 2}, "3": {"id": 3, "name": "moka-pot-brewing-4k.mp4", "label": "Violet", "kind": {"Media": {"media": {"File": {"path": "/root/Desktop/task-01/media/moka-pot-brewing-4k.mp4"}}, "info": {"name": "moka-pot-brewing-4k.mp4", "kind": "Movie", "duration": 7711925760000, "video": {"width": 3840, "height": 2160, "frame_rate": {"num": 25, "den": 1}, "par": [1, 1], "codec": "H.264 (High)", "pixel_format": "YUV 4:2:0 8-bit", "color": {"matrix": "Bt709", "transfer": "Bt709", "primaries": "Bt709", "range": "Limited"}, "has_alpha": false, "bitrate": 15043926}, "audio_streams": [{"sample_rate": 48000, "channels": 2, "codec": "aac", "bits_per_sample": null}], "container": "MPEG-4", "start_timecode": null, "file_size": 39926889}, "interpret": {"frame_rate": null, "par": null, "ignore_alpha": false, "invert_alpha": false}, "mark_in": null, "mark_out": null, "markers": [], "offline": false, "proxy": null, "identity": null}}, "metadata": {}, "created": 3}, "4": {"id": 4, "name": "hands-barista-latte-art-4k.mov", "label": "Violet", "kind": {"Media": {"media": {"File": {"path": "/root/Desktop/task-01/media/hands-barista-latte-art-4k.mov"}}, "info": {"name": "hands-barista-latte-art-4k.mov", "kind": "Movie", "duration": 2658700884672, "video": {"width": 3872, "height": 2160, "frame_rate": {"num": 30, "den": 1}, "par": [1, 1], "codec": "H.264 (High)", "pixel_format": "YUV 4:2:0 8-bit", "color": {"matrix": "Bt709", "transfer": "Bt709", "primaries": "Bt709", "range": "Limited"}, "has_alpha": false, "bitrate": 15043926}, "audio_streams": [{"sample_rate": 44100, "channels": 2, "codec": "aac", "bits_per_sample": null}], "container": "MPEG-4", "start_timecode": null, "file_size": 19301403}, "interpret": {"frame_rate": null, "par": null, "ignore_alpha": false, "invert_alpha": false}, "mark_in": null, "mark_out": null, "markers": [], "offline": false, "proxy": null, "identity": null}}, "metadata": {}, "created": 4}, "5": {"id": 5, "name": "basketball-conditioning-fort-belvoir.mp4", "label": "Violet", "kind": {"Media": {"media": {"File": {"path": "/root/Desktop/task-01/media/basketball-conditioning-fort-belvoir.mp4"}}, "info": {"name": "basketball-conditioning-fort-belvoir.mp4", "kind": "Movie", "duration": 3947832084672, "video": {"width": 3840, "height": 2160, "frame_rate": {"num": 24, "den": 1}, "par": [1, 1], "codec": "H.264 (High)", "pixel_format": "YUV 4:2:0 8-bit", "color": {"matrix": "Bt709", "transfer": "Bt709", "primaries": "Bt709", "range": "Limited"}, "has_alpha": false, "bitrate": 15043926}, "audio_streams": [{"sample_rate": 48000, "channels": 2, "codec": "aac", "bits_per_sample": null}], "container": "MPEG-4", "start_timecode": null, "file_size": 19536528}, "interpret": {"frame_rate": null, "par": null, "ignore_alpha": false, "invert_alpha": false}, "mark_in": null, "mark_out": null, "markers": [], "offline": false, "proxy": null, "identity": null}}, "metadata": {}, "created": 5}}, "next_id": 10}, "view": {"open_sequences": [], "active_sequence": null, "sequences": {}}}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152#!/usr/bin/python3"""GUI file browsing and fixed app launchers; no shell or executable-file launch."""import os,subprocess,sysfrom pathlib import Pathimport tkinter as tkfrom tkinter import ttk,messageboxAPPS={'FilmCraft':['/usr/local/bin/filmcraft','--graphics','software']}root=tk.Tk();root.title('Files');root.geometry('960x700')path=tk.StringVar(value='/root/Desktop');status=tk.StringVar()bar=ttk.Frame(root);bar.pack(fill='x')def launch(name,filename=None): args=APPS[name][:] if not Path(args[0]).exists():return if filename:args.append(str(filename)) subprocess.Popen(args,stdin=subprocess.DEVNULL,stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL,start_new_session=True)for name in APPS: if Path(APPS[name][0]).exists():ttk.Button(bar,text='Open '+name,command=lambda n=name:launch(n)).pack(side='left',padx=4,pady=6)nav=ttk.Frame(root);nav.pack(fill='x')def go(value):path.set(str(value));refresh()ttk.Button(nav,text='Up',command=lambda:go(Path(path.get()).parent)).pack(side='left')entry=ttk.Entry(nav,textvariable=path);entry.pack(side='left',fill='x',expand=True);entry.bind('<Return>',lambda _:refresh())ttk.Button(nav,text='Go',command=lambda:refresh()).pack(side='left')short=ttk.Frame(root);short.pack(fill='x')for name,value in [('Desktop','/root/Desktop'),('Home','/root'),('Output','/root/Desktop/final01/output'),('Linux filesystem','/')]:ttk.Button(short,text=name,command=lambda v=value:go(v)).pack(side='left')view=ttk.Treeview(root,columns=('type','size'),show='tree headings');view.heading('#0',text='Name');view.heading('type',text='Type');view.heading('size',text='Size');view.pack(fill='both',expand=True)ttk.Label(root,textvariable=status).pack(fill='x')items={}def refresh(): p=Path(path.get()).expanduser() if not p.is_dir():messagebox.showerror('Files','Choose a folder path.');return path.set(str(p.resolve()));view.delete(*view.get_children());items.clear() try: for x in sorted(p.iterdir(),key=lambda x:(not x.is_dir(),x.name.lower())): try:typ='Folder' if x.is_dir() else 'File';size='' if x.is_dir() else str(x.stat().st_size)+' bytes' except OSError:typ='Unavailable';size='' i=view.insert('', 'end',text=x.name,values=(typ,size));items[i]=x status.set(str(len(items))+' items') except OSError as e:status.set(str(e))def open_selected(_=None): sel=view.selection() if not sel:return p=items[sel[0]] if p.is_dir():go(p);return suffix=p.suffix.lower() if suffix=='.fcproj':launch('FilmCraft',p);return if suffix in {'.mp4','.mov','.mkv','.avi','.webm','.mp3','.wav','.png','.jpg','.jpeg'}: name='FilmCraft';launch(name,p);return if suffix in {'.txt','.md','.csv','.json','.xml','.toml','.log'} and p.stat().st_size<1000000: w=tk.Toplevel(root);w.title(p.name);t=tk.Text(w,wrap='word');t.pack(fill='both',expand=True);t.insert('1.0',p.read_text(errors='replace'));t.configure(state='disabled');return messagebox.showinfo('Files','This file can be browsed but cannot be launched. Open media and projects in the editor using its file dialogs.')view.bind('<Double-1>',open_selected);view.bind('<Return>',open_selected)refresh();root.mainloop()1234#!/bin/sh# Limit decoder parallelism to avoid excessive preview memory.filmcraft_cpus=$(python3 -c 'import os; print(",".join(map(str,sorted(os.sched_getaffinity(0))[:4])))')exec taskset -c "$filmcraft_cpus" /opt/filmcraft/bin/filmcraft "$@"123456[Desktop Entry]Type=ApplicationName=FilmcraftExec=/usr/local/bin/filmcraft --no-recover /root/Desktop/task-01/start.fcproj --graphics softwareIcon=applications-multimediaTerminal=false1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859"""Trusted environment setup. Run before exposing screenshots/actions to a model."""import jsonimport osfrom pathlib import Pathimport subprocessimport xml.etree.ElementTree as ET
# Restore navigation packages from trusted, offline Debian assets before guarding commands.if Path('/opt/gui-only/nonexistent-debs').exists(): subprocess.run(['dpkg','-i',*[str(p) for p in Path('/opt/gui-only/nonexistent-debs').glob('*.deb')]],check=True,stdout=subprocess.DEVNULL)
BLOCKED = 'xterm uxterm lxterm koi8rxterm x-terminal-emulator xfce4-terminal gnome-terminal gnome-terminal-server konsole mate-terminal lxterminal qterminal terminator tilix sakura rxvt urxvt zutty xfce4-appfinder xfrun4 exo-desktop-item-edit xfce4-settings-editor xfce4-settings-manager thunar Thunar mousepad xfce4-keyboard-settings xfce4-mime-settings'.split()stub = Path('/usr/local/bin/gui-only-denied')stub.write_text('''#!/bin/shmkdir -p /logs/artifactsprintf '%s %s\\n' "$(date -u +%FT%TZ)" "$0" >> /logs/artifacts/gui-only-denied.logexit 126''')stub.chmod(0o755)for name in BLOCKED: for directory in ['/usr/bin','/usr/local/bin','/bin']: p = Path(directory)/name if directory == '/bin' and Path('/bin').resolve() == Path('/usr/bin'):continue if p.exists() or p.is_symlink():p.unlink() p.symlink_to(stub)# Remove shell launch surfaces without removing native editor file dialogs.for root in ['/root/Desktop','/usr/share/applications','/usr/local/share/applications','/root/.local/share/applications']: for p in Path(root).glob('*.desktop'): text=p.read_text(errors='replace').lower() if any(x in text for x in ['terminal','appfinder','xfrun','settings-editor','keyboard-settings','mime-settings','desktop-item-edit','text-editor','mousepad','chromium','web-browser']):p.unlink()# Only the harness launches the editor; disable duplicate session autostarts.for root in ['/root/.config/autostart','/etc/xdg/autostart']: for p in Path(root).glob('*.desktop'): if any(x in p.read_text(errors='replace').lower() for x in ['shotcut','filmcraft','x11vnc']): p.write_text('[Desktop Entry]\nType=Application\nHidden=true\n')for root in ['/etc/xdg/xfce4/xfconf/xfce-perchannel-xml','/root/.config/xfce4/xfconf/xfce-perchannel-xml']: p=Path(root)/'xfce4-keyboard-shortcuts.xml' if p.exists(): tree=ET.parse(p) for parent in tree.iter(): for child in list(parent): if any(x in child.get('value','').lower() for x in ['terminal','appfinder','xfrun']):parent.remove(child) tree.write(p,encoding='unicode')kiosk=Path('/etc/xdg/xfce4/kiosk/kioskrc');kiosk.parent.mkdir(parents=True,exist_ok=True)kiosk.write_text('[xfce4-panel]\nCustomizePanel=NONE\n[xfdesktop]\nCustomizeDesktopMenu=NONE\nCustomizeWindowlist=NONE\nUserMenu=ALL\n[xfce4-session]\nCustomizeCompatibility=NONE\nCustomizeSecurity=NONE\n')# Custom file-manager commands can launch shells. Keep file navigation/native dialogs.actions=Path('/root/.config/Thunar/uca.xml');actions.parent.mkdir(parents=True,exist_ok=True);actions.write_text('<actions/>\n')for name in BLOCKED: r=subprocess.run(['/usr/bin/'+name,'--version'],capture_output=True,timeout=5) if r.returncode !=126:raise RuntimeError('GUI-only guard failed: '+name)Path('/logs/artifacts').mkdir(parents=True,exist_ok=True)Path('/logs/artifacts/gui-only-policy.json').write_text(json.dumps({'version':2,'os_navigation':True,'terminal_tools':False,'blocked_launchers':BLOCKED,'self_check':'passed'},indent=2))print('GUI_ONLY_SELF_CHECK_PASSED')
# Fixed GUI file browser and app launchers do not execute arbitrary commands.p=Path('/root/Desktop/Files.desktop');p.write_text('[Desktop Entry]\nType=Application\nName=Files\nExec=/usr/bin/python3 /opt/gui-only/files.py\nIcon=system-file-manager\nTerminal=false\n');p.chmod(0o755)for app,command in [('FilmCraft','/usr/local/bin/filmcraft --graphics software /root/Desktop/task-01/start.fcproj')]: if not Path(command.split()[0]).exists():continue p=Path('/root/Desktop')/(app+'.desktop');p.write_text('[Desktop Entry]\nType=Application\nName='+app+'\nExec='+command+'\nIcon=applications-multimedia\nTerminal=false\n');p.chmod(0o755)1234567891011121314#!/bin/shset -eumkdir -p /logs/artifacts /root/.local/share/filmcraft /root/.config/filmcraftif [ ! -S /tmp/.X11-unix/X1 ]; then Xvfb :1 -screen 0 1280x900x24 -ac +extension RANDR >/tmp/task01-xvfb.log 2>&1 &fiexport DISPLAY=:1sleep 1if [ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ]; then eval "$(dbus-launch --sh-syntax)"fistartxfce4 >/tmp/task01-xfce.log 2>&1 &sleep 2exec /usr/local/bin/filmcraft --no-recover /root/Desktop/task-01/start.fcproj --graphics software >/tmp/task01-filmcraft.log 2>&11234567891011121314Can you go through `/root/Desktop/task-01/media` in Filmcraft and look for `coffee-beans-closeup-4k.mp4`, `pouring-coffee-carafe-4k.mp4`, and `hands-cup-pickup-4k.mp4`. I want to assemble them in that order, using the last five seconds of each video at normal speed with cross dissolve transitions between them. The folder and the open project contain other videos too; use only these three videos in the assembled sequence.
You'll also find a sound file in the media folder. Add it as music to the assembled video. Trim the music to end when the picture ends so it does not keep playing over a black video tail.
Make sure you are using Filmcraft—I want to use this timeline sequence for other edits that I'll do manually.
Queue two exports of the same assembled video together and export them in one batch, both horizontal H.264 MP4 files at 30 fps:
- `final01-1080p.mp4`: 1920×1080.- `final01-720p.mp4`: 1280×720.
Fit each shot entirely inside the frame without cropping or stretching; aspect-ratio borders are fine. Keep the same footage, transitions and music in both exports. Save both exports in `/root/Desktop/final01/output`. Also save the editable Filmcraft project there as `proj-task-01.fcproj`, with all three original video sources and the sound file linked. Keep the video clips, cross dissolves and music editable.
Use GUI interaction only. You may write and run scripts through Filmcraft's GUI. Do not use a terminal, xterm, uxterm, shell, external script runner, or direct command/process-execution tools.12345678910111213141516171819202122232425schema_version = "1.4"artifacts = ["/root/Desktop", "/root/.local/share/filmcraft", "/root/.config/filmcraft", "/logs/artifacts", "/tmp/task01-filmcraft.log", "/tmp/task01-xfce.log"][task]name = "sid/01-B-name-batch-gui-v4"version = "4.0.0"[agent]timeout_sec = 28800network_mode = "no-network"[environment]network_mode = "no-network"build_timeout_sec = 3600cpus = 4memory_mb = 16384storage_mb = 30720os = "linux"[verifier]timeout_sec = 3600environment_mode = "separate"[verifier.environment]network_mode = "no-network"build_timeout_sec = 3600cpus = 4memory_mb = 8192storage_mb = 30720os = "linux"12345678910111213141516171819202122232425262728293031FROM debian:bookworm-slim@sha256:3783cc01769c7b2b1b83a5c5ad96c815348e28ed7da68e2e3687004faa906251ENV DEBIAN_FRONTEND=noninteractiveARG TARGETARCHRUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg python3 python3-tk python3-numpy python3-pil python3-opencv fontconfig tesseract-ocr ca-certificates \ xvfb xfce4-session xfwm4 xfce4-panel xfce4-settings xfdesktop4 thunar mousepad xterm \ x11vnc xdotool wmctrl imagemagick webp dbus-x11 zenity xdg-desktop-portal xdg-desktop-portal-gtk \ fonts-dejavu-core fonts-liberation libgl1-mesa-dri libgl1 libglu1-mesa \ mesa-vulkan-drivers libvulkan1 libegl1 libx11-6 libx11-xcb1 libxcursor1 libxi6 \ libxrandr2 libxkbcommon0 libwayland-client0 libgtk-3-0 libsm6 libice6 \ libxrender1 libxext6 libxkbcommon-x11-0 libxcb-cursor0 libxcb-icccm4 \ libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 \ libxcb-xinput0 libpulse0 libasound2 libnss3 procps util-linux \ && rm -rf /var/lib/apt/lists/*COPY vendor/filmcraft-${TARGETARCH}.tar.gz /tmp/filmcraft.tar.gzRUN case "$TARGETARCH" in \ amd64) filmcraft_sha=4171c4bf5f57fd29475655f8a6df4719feda8c8f3ed95b2475d8dc112ad3be86 ;; \ arm64) filmcraft_sha=4af56f649a6fb19dcae386abd59921ec6c9190b725014517075fa4d81123c68a ;; \ *) exit 1 ;; esac \ && echo "${filmcraft_sha} /tmp/filmcraft.tar.gz" | sha256sum -c - \ && mkdir -p /opt/filmcraft \ && tar -xzf /tmp/filmcraft.tar.gz -C /opt/filmcraft --strip-components=1 \ && cp -a /opt/filmcraft/share/. /usr/local/share/ \ && ln -s /opt/filmcraft/bin/filmcraft-cli /usr/local/bin/filmcraft-cli \ && rm /tmp/filmcraft.tar.gzENV RAYON_NUM_THREADS=4 SDL_AUDIODRIVER=dummy LIBGL_ALWAYS_SOFTWARE=1 WGPU_BACKEND=vulkan LANG=C.UTF-8 DISPLAY=:1COPY . /tests/RUN mkdir -p /root/Desktop/final01/output /logs/verifier /logs/artifacts \ && chmod +x /tests/test.shWORKDIR /rootCMD ["sleep", "infinity"]1{"access": "gui"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101"""Private deterministic verifier support; failures of grading never become task deductions."""import json, math, os, re, subprocessfrom pathlib import Pathimport numpy as npfrom PIL import ImageTICKS=254016000000class GradingError(RuntimeError): pass
def commands(trajectory): for step in trajectory.get('steps',[]): if step.get('source')!='agent':continue obs=step.get('observation',{}).get('results',[]) for call in step.get('tool_calls',[]): args=call.get('arguments',{});text=args.get('command') or args.get('text') or '' response=next((o for o in obs if o.get('source_call_id')==call.get('tool_call_id')),{}) output='\n'.join(c.get('text','') for c in response.get('content',[]) if c.get('type')=='text') yield step.get('step_id'),text,output,response
def _action_checks(trajectory, workspace, target_names, assets=None): entries=list(commands(trajectory));app=[];previews=[];queued=[];done=[];started=[];pixel_evidence={} for sid,cmd,out,obs in entries: # A successful editing/export response, rather than help/probe/agent prose. if 'filmcraft-cli' in cmd and any(x in cmd for x in ['timeline.place','file.save','export.queue',' render ',' import ',' exec ']) and ('status=ok' in out or '"ok": true' in out) and any(x in out for x in ['"added"','"item"','"items"','"project"','"result"','saved','"bytes"','"ok"']):app.append(sid) if 'export.queue.start' in cmd:started.append(sid) # Queue-state output proves names/status, not the command's claimed intent. for name in ['final01-1080p.mp4','final01-720p.mp4','final-1080p.mp4']: if re.search(re.escape(name)+r'[^\n]{0,100}\bready\b',out):queued.append((sid,name)) if re.search(re.escape(name)+r'[^\n]{0,100}\bdone\b',out):done.append((sid,name)) if any(x in cmd for x in ['display ','feh ','ristretto ','preview','source.open']) and any(c.get('type')=='image' for c in obs.get('content',[])) and ('status=ok' in out or not out):previews.append(sid) # GUI calls are corroborated by application window observations, not text claims. observations=workspace/'logs/artifacts/runtime-observations.jsonl' if observations.is_file(): for line in observations.read_text().splitlines(): try:r=json.loads(line) except ValueError:continue if 'filmcraft' in r.get('windows','').lower() and any(s.get('tool_calls') for s in trajectory.get('steps',[]) if s.get('source')=='agent'): app.append('observed-filmcraft-window');break pair=['final01-1080p.mp4', 'final01-720p.mp4'] batch=any(all(any(qsid<start and name==n for qsid,name in queued) for n in pair) and all(any(dsid>=start and name==n for dsid,name in done) for n in pair) for start in started) # Source-associated observations require a source thumbnail creation and delivered preview. source_view={} for n in target_names: extracts=[sid for sid,cmd,out,obs in entries if ('ffmpeg' in cmd or 'preview' in cmd or 'source.open' in cmd) and (n in cmd or n in out) and ('status=ok' in out or not out)] source_view[n]=any(preview>=extract for preview in previews for extract in extracts) if assets is not None and (assets/'operator-screenshots').is_dir() and not all(source_view.values()) and not all(n.startswith(('coffee-','pouring-','hands-')) for n in target_names): from gui_evidence import viewed_sources pixel_view,pixel_evidence=viewed_sources(trajectory,assets,target_names) for name in target_names:source_view[name]=source_view[name] or pixel_view[name] if assets is not None and not batch and (assets/'operator-screenshots').is_dir() and json.loads((assets/'verifier-config.json').read_text()).get('queue_exports'): from gui_evidence import gui_queue gui=gui_queue(trajectory,assets,pair);batch=gui['batch'] queued.extend(('gui',e['names']) for e in gui['events'] if e['ready']);done.extend(('gui',e['names']) for e in gui['events'] if e['done']) return {'app_use':bool(app),'app_steps':app,'source_view':source_view,'preview_steps':previews,'source_view_evidence':pixel_evidence,'batch':batch,'queue_evidence':{'ready':queued,'started':started,'done':done}}
def native_dissolve(selected,clips,j): if not selected or len(clips)<=j:return None a,b=clips[j-1],clips[j];cut=b['start']/TICKS return next((t for t in selected['transitions'] if t.get('effect',{}).get('effect')=='cross_dissolve' and t['effect'].get('enabled',True) and t.get('from')==a['id'] and t.get('to')==b['id'] and t.get('duration',0)>0 and t['start']/TICKS<=cut<=(t['start']+t['duration'])/TICKS),None)
def blend_measure(A,B,O): A=A.astype(float);B=B.astype(float);O=O.astype(float);d=B-A;alpha=float(np.clip(((O-A)*d).sum()/max(1,float((d*d).sum())),0,1));error=float(np.abs(O-(A*(1-alpha)+B*alpha)).mean());return alpha,error
def rendered_assembly(frames,clips,selected,refs): """Check every frame against its source or the paired blend, with source-edge holds.""" if frames is None or not len(frames):return {'full':False,'tails':[False]*3,'joins':[False]*2,'end':False,'errors':[]} errors=[];join_samples=[[],[]];tails=[[],[],[]] trans=[native_dissolve(selected,clips,j) for j in [1,2]] def source(i,t): c=clips[i];f=round((c['source_in']/TICKS+t-c['start']/TICKS)*30);return refs[i][max(0,min(len(refs[i])-1,f))] for f,O in enumerate(frames): t=f/30;beyond_picture=False;fps=selected.get('seq',{}).get('settings',{}).get('frame_rate',{'num':30,'den':1});tail_tolerance=fps['den']/fps['num']+1/30 picture_end=max((c['start']+c['duration'])/TICKS for c in clips) if picture_end<=t<picture_end+tail_tolerance:beyond_picture=True;t=picture_end-1e-7 i=next((i for i,c in enumerate(clips) if c['start']/TICKS<=t<(c['start']+c['duration'])/TICKS),None) if i is None:errors.append(255.);continue blend=next(((j,tr) for j,tr in enumerate(trans) if tr and tr['start']/TICKS<=t<(tr['start']+tr['duration'])/TICKS),None) if blend: j,tr=blend;alpha,err=blend_measure(source(j,t),source(j+1,t),O);join_samples[j].append((alpha,err));tails[j].append(err);tails[j+1].append(err) else: A=source(i,t).astype(float);err=float(abs(O.astype(float)-A).mean()) if not beyond_picture:tails[i].append(err) errors.append(err) def good(v):return bool(bool(v) and np.quantile(v,.99)<=12 and max(v)<=22) joins=[] for samples in join_samples: alphas=[x[0] for x in samples];errs=[x[1] for x in samples];mixed=sum(.12<a<.88 for a in alphas) joins.append(len(samples)>=3 and mixed>=max(2,len(samples)//5) and alphas[-1]-alphas[0]>.5 and all(b>=a-.08 for a,b in zip(alphas,alphas[1:])) and good(errs)) end=max((c['start']+c['duration'])/TICKS for c in clips);endok=abs(len(frames)/30-end)<=max(1/30,selected.get('seq',{}).get('settings',{}).get('frame_rate',{'num':30,'den':1})['den']/selected.get('seq',{}).get('settings',{}).get('frame_rate',{'num':30,'den':1})['num'])+1/30 and good(errors[-3:]) return {'full':good(errors) and all(joins),'tails':[good(v) for v in tails],'joins':joins,'end':endok,'p99_mae':float(np.quantile(errors,.99)),'max_mae':max(errors),'join_samples':join_samples}
def require_complete(result): from verifier_runtime import validate_report return validate_report(result)
# One immutable private trace is evaluated repeatedly for four exports in one grading process._ACTION_CACHE={}def action_checks(trajectory,workspace,target_names,assets=None): import hashlib,copy key=(hashlib.sha256(json.dumps(trajectory,sort_keys=True).encode()).hexdigest(),str(workspace),tuple(target_names),str(assets)) if key not in _ACTION_CACHE:_ACTION_CACHE[key]=_action_checks(trajectory,workspace,target_names,assets) return copy.deepcopy(_ACTION_CACHE[key])1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162"""Deterministic OCR support for actual GUI observations, never agent narrative."""import json,re,subprocess,tempfile,hashlibfrom pathlib import Pathfrom PIL import Image
def gui_queue(trajectory,assets,expected): events=[];cache_path=assets/'gui-ocr-cache.json';cache=json.loads(cache_path.read_text()) if cache_path.exists() else {} for step in trajectory.get('steps',[]): if step.get('source')!='agent':continue for result in step.get('observation',{}).get('results',[]): for part in result.get('content',[]): if part.get('type')!='image':continue name=Path(part.get('source',{}).get('path','')).name;p=assets/'operator-screenshots'/name if not p.is_file():continue digest=hashlib.sha256(p.read_bytes()).hexdigest() key=name+':'+digest if key in cache:text=cache[key] else: with tempfile.TemporaryDirectory() as temp: image=Image.open(p);image.resize((image.width*2,image.height*2)).save(Path(temp)/'screen.png') r=subprocess.run(['tesseract',str(Path(temp)/'screen.png'),'stdout','--psm','11'],capture_output=True,text=True,timeout=20);text=' '.join(r.stdout.split()).lower() cache[key]=text;cache_path.write_text(json.dumps(cache)) if 'queue' not in text and 'export' not in text:continue names=[n for n in expected if n.lower().replace('.mp4','') in text or n.lower() in text] if len(names)==len(expected):events.append({'step':step['step_id'],'names':names,'ready':any(x in text for x in ['ready','pending','queued']),'done':any(x in text for x in ['completed','done','finished']),'text':text}) return {'batch':any(a['ready'] and b['done'] and a['step']<b['step'] for a in events for b in events),'events':events}
def viewed_sources(trajectory,assets,names): """Match source pixels to delivered screenshots using fixed SIFT/RANSAC thresholds.""" import cv2,numpy as np paths=set() for step in trajectory.get('steps',[]): if step.get('source')!='agent':continue for result in step.get('observation',{}).get('results',[]): for part in result.get('content',[]): if part.get('type')=='image':paths.add(Path(part.get('source',{}).get('path','')).name) sift=cv2.SIFT_create(nfeatures=1500);screens=[] for name in sorted(paths): p=assets/'operator-screenshots'/name if not p.is_file():continue img=cv2.imread(str(p),cv2.IMREAD_GRAYSCALE) if img is None:continue k,d=sift.detectAndCompute(img,None) if d is not None:screens.append((name,k,d)) if not screens:raise RuntimeError('No delivered screenshots available for deterministic source-view check') found={n:False for n in names};evidence={};matcher=cv2.BFMatcher() for name in names: capture=cv2.VideoCapture(str(assets/'reference'/name)) for second in [0,1,2,4]: capture.set(cv2.CAP_PROP_POS_MSEC,second*1000);ok,img=capture.read() if not ok:continue img=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY);img=cv2.resize(img,(640,round(img.shape[0]*640/img.shape[1])));k,d=sift.detectAndCompute(img,None) if d is None:continue for shot,ks,ds in screens: pairs=matcher.knnMatch(d,ds,k=2);good=[a for pair in pairs if len(pair)==2 for a,b in [pair] if a.distance<.70*b.distance] if len(good)<12:continue src=np.float32([k[m.queryIdx].pt for m in good]);dst=np.float32([ks[m.trainIdx].pt for m in good]);H,inliers=cv2.findHomography(src,dst,cv2.RANSAC,3) if H is not None and inliers is not None and int(inliers.sum())>=10 and int(inliers.sum())/len(good)>=.5: found[name]=True;evidence[name]={'screenshot':shot,'source_second':second,'inliers':int(inliers.sum())};break if found[name]:break capture.release() return found,evidence1{"format": "filmcraft.project", "schema_version": 15, "generator": "FilmCraft 0.7.2", "project": {"name": "Starting media", "settings": {"renderer": "FilmCraft GPU Acceleration (wgpu)", "video_display": "Timecode", "audio_display_samples": true, "default_still_duration": 1270080000000, "default_transition_duration_frames": 24, "default_audio_transition_duration": 254016000000, "ingest": {"enabled": false, "action": "createProxies", "destination": null, "preset": ""}, "title_safe": [20.0, 20.0], "action_safe": [10.0, 10.0], "capture_format": "DV", "scratch": {"captured": null, "videoPreviews": null, "audioPreviews": null, "autoSave": null}}, "root": {"id": 0, "name": "Starting media", "children": [{"Item": 1}, {"Item": 2}, {"Item": 3}, {"Item": 4}, {"Item": 5}]}, "items": {"1": {"id": 1, "name": "IMG_7039.MOV", "label": "Violet", "kind": {"Media": {"media": {"File": {"path": "/root/Desktop/task-01/media/IMG_7039.MOV"}}, "info": {"name": "IMG_7039.MOV", "kind": "Movie", "duration": 2871650880000, "video": {"width": 3840, "height": 2160, "frame_rate": {"num": 25425, "den": 848}, "par": [1, 1], "codec": "H.264 (High)", "pixel_format": "YUV 4:2:0 8-bit", "color": {"matrix": "Bt709", "transfer": "Bt709", "primaries": "Bt709", "range": "Limited"}, "has_alpha": false, "bitrate": 15043926}, "audio_streams": [{"sample_rate": 44100, "channels": 2, "codec": "aac", "bits_per_sample": null}], "container": "MPEG-4", "start_timecode": null, "file_size": 33138797}, "interpret": {"frame_rate": null, "par": null, "ignore_alpha": false, "invert_alpha": false}, "mark_in": null, "mark_out": null, "markers": [], "offline": false, "proxy": null, "identity": null}}, "metadata": {}, "created": 1}, "2": {"id": 2, "name": "chart-daylight-5600k-0ev-rec709.mp4", "label": "Violet", "kind": {"Media": {"media": {"File": {"path": "/root/Desktop/task-01/media/chart-daylight-5600k-0ev-rec709.mp4"}}, "info": {"name": "chart-daylight-5600k-0ev-rec709.mp4", "kind": "Movie", "duration": 2540160000000, "video": {"width": 3840, "height": 2160, "frame_rate": {"num": 30, "den": 1}, "par": [1, 1], "codec": "H.264 (High)", "pixel_format": "YUV 4:2:0 8-bit", "color": {"matrix": "Bt709", "transfer": "Bt709", "primaries": "Bt709", "range": "Limited"}, "has_alpha": false, "bitrate": 15043926}, "audio_streams": [], "container": "MPEG-4", "start_timecode": null, "file_size": 87694}, "interpret": {"frame_rate": null, "par": null, "ignore_alpha": false, "invert_alpha": false}, "mark_in": null, "mark_out": null, "markers": [], "offline": false, "proxy": null, "identity": null}}, "metadata": {}, "created": 2}, "3": {"id": 3, "name": "moka-pot-brewing-4k.mp4", "label": "Violet", "kind": {"Media": {"media": {"File": {"path": "/root/Desktop/task-01/media/moka-pot-brewing-4k.mp4"}}, "info": {"name": "moka-pot-brewing-4k.mp4", "kind": "Movie", "duration": 7711925760000, "video": {"width": 3840, "height": 2160, "frame_rate": {"num": 25, "den": 1}, "par": [1, 1], "codec": "H.264 (High)", "pixel_format": "YUV 4:2:0 8-bit", "color": {"matrix": "Bt709", "transfer": "Bt709", "primaries": "Bt709", "range": "Limited"}, "has_alpha": false, "bitrate": 15043926}, "audio_streams": [{"sample_rate": 48000, "channels": 2, "codec": "aac", "bits_per_sample": null}], "container": "MPEG-4", "start_timecode": null, "file_size": 39926889}, "interpret": {"frame_rate": null, "par": null, "ignore_alpha": false, "invert_alpha": false}, "mark_in": null, "mark_out": null, "markers": [], "offline": false, "proxy": null, "identity": null}}, "metadata": {}, "created": 3}, "4": {"id": 4, "name": "hands-barista-latte-art-4k.mov", "label": "Violet", "kind": {"Media": {"media": {"File": {"path": "/root/Desktop/task-01/media/hands-barista-latte-art-4k.mov"}}, "info": {"name": "hands-barista-latte-art-4k.mov", "kind": "Movie", "duration": 2658700884672, "video": {"width": 3872, "height": 2160, "frame_rate": {"num": 30, "den": 1}, "par": [1, 1], "codec": "H.264 (High)", "pixel_format": "YUV 4:2:0 8-bit", "color": {"matrix": "Bt709", "transfer": "Bt709", "primaries": "Bt709", "range": "Limited"}, "has_alpha": false, "bitrate": 15043926}, "audio_streams": [{"sample_rate": 44100, "channels": 2, "codec": "aac", "bits_per_sample": null}], "container": "MPEG-4", "start_timecode": null, "file_size": 19301403}, "interpret": {"frame_rate": null, "par": null, "ignore_alpha": false, "invert_alpha": false}, "mark_in": null, "mark_out": null, "markers": [], "offline": false, "proxy": null, "identity": null}}, "metadata": {}, "created": 4}, "5": {"id": 5, "name": "basketball-conditioning-fort-belvoir.mp4", "label": "Violet", "kind": {"Media": {"media": {"File": {"path": "/root/Desktop/task-01/media/basketball-conditioning-fort-belvoir.mp4"}}, "info": {"name": "basketball-conditioning-fort-belvoir.mp4", "kind": "Movie", "duration": 3947832084672, "video": {"width": 3840, "height": 2160, "frame_rate": {"num": 24, "den": 1}, "par": [1, 1], "codec": "H.264 (High)", "pixel_format": "YUV 4:2:0 8-bit", "color": {"matrix": "Bt709", "transfer": "Bt709", "primaries": "Bt709", "range": "Limited"}, "has_alpha": false, "bitrate": 15043926}, "audio_streams": [{"sample_rate": 48000, "channels": 2, "codec": "aac", "bits_per_sample": null}], "container": "MPEG-4", "start_timecode": null, "file_size": 19536528}, "interpret": {"frame_rate": null, "par": null, "ignore_alpha": false, "invert_alpha": false}, "mark_in": null, "mark_out": null, "markers": [], "offline": false, "proxy": null, "identity": null}}, "metadata": {}, "created": 5}}, "next_id": 10}, "view": {"open_sequences": [], "active_sequence": null, "sequences": {}}}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091import hashlib,json,subprocessfrom pathlib import Pathfrom functools import lru_cacheimport numpy as npTICKS=254016000000def digest(p): h=hashlib.sha256() with p.open('rb') as f: for block in iter(lambda:f.read(1024*1024),b''):h.update(block) return h.hexdigest()def run(args,timeout=120):return subprocess.run(args,capture_output=True,timeout=timeout)def probe(p): r=run(['ffprobe','-v','error','-show_streams','-show_format','-of','json',str(p)]) if r.returncode:raise ValueError(r.stderr.decode(errors='replace')[-1000:]) d=json.loads(r.stdout);s=next(s for s in d['streams'] if s['codec_type']=='video') return d,sdef val(effect,name,default=None): p=effect.get('params',{}).get(name,{}) if p.get('keyframes'):return None v=p.get('value',{}) return next(iter(v.values()),default) if isinstance(v,dict) else v
def normal(c,media): if c.get('speed',1)!=1 or c.get('reverse') or c.get('frame_hold') is not None:return False interpret=media.get('interpret',{}) if interpret.get('frame_rate'):return None for e in c.get('effects',[]): if e.get('enabled',True) and e.get('effect')=='time_remap': speed=val(e,'speed',100) if speed is None:return None if speed!=100:return False return True
def geometry(c,media,w,h): """Resolve basic motion, including scale-to-frame and anchor offsets. Unknown effects/keyframes/PAR overrides defer to native/render review. """ v=media.get('info',{}).get('video') if not v:return None sw,sh=v['width'],v['height'];par=v.get('par',[1,1]);interp=media.get('interpret',{}) if interp.get('par') or par[0]!=par[1]:return None motion=None;opacity=100 for e in c.get('effects',[]): if not e.get('enabled',True):continue kind=e.get('effect') if kind=='motion':motion=e elif kind=='opacity': opacity=val(e,'opacity',100) if val(e,'blend',0)!=0:return None elif kind=='time_remap':continue else:return None if not motion:return None scale=val(motion,'scale',100);width=val(motion,'scale_width',100);uniform=val(motion,'uniform_scale',True) position=val(motion,'position',{'x':w/2,'y':h/2});anchor=val(motion,'anchor',{'x':sw/2,'y':sh/2});rotation=val(motion,'rotation',0) if any(x is None for x in [scale,width,uniform,position,anchor,rotation,opacity]):return None if rotation!=0:return {'upright':False,'opacity':opacity} base=min(w/sw,h/sh) if c.get('scale_to_frame') else 1 sy=base*scale/100;sx=sy if uniform else base*width/100 return {'x':position['x']-anchor['x']*sx,'y':position['y']-anchor['y']*sy,'w':sw*sx,'h':sh*sy,'sx':sx,'sy':sy,'upright':True,'opacity':opacity}
def decoded_frames(p,w,h,filter_prefix='',limit=None): vf=filter_prefix+(',' if filter_prefix else '')+f'scale={w}:{h}:flags=area' args=['ffmpeg','-v','error','-threads','2','-i',str(p),'-an','-vf',vf] if limit:args+=['-frames:v',str(limit)] args+=['-pix_fmt','rgb24','-f','rawvideo','pipe:1'] r=run(args,timeout=600) if r.returncode:raise ValueError(r.stderr.decode(errors='replace')[-1000:]) size=w*h*3 if len(r.stdout)%size:raise ValueError('Partial decoded frame') return np.frombuffer(r.stdout,dtype=np.uint8).reshape(-1,h,w,3)
def reference_frames(p,W,H): _,s=probe(p);sw,sh=s['width'],s['height'];scale=min(W/sw,H/sh) if W>H else max(W/sw,H/sh) rw=round(sw*scale);rh=round(sh*scale) vf=f'trim=start=0:end=5,setpts=PTS-STARTPTS,fps=30,scale={rw}:{rh}:flags=bicubic,setsar=1' vf+=f',pad={W}:{H}:(ow-iw)/2:(oh-ih)/2:black' if W>H else f',crop={W}:{H}:(iw-ow)/2:(ih-oh)/2' return decoded_frames(p,192 if W>H else 108,108 if W>H else 192,vf,150)
@lru_cache(maxsize=16)def video_end(path): """True video-track presentation end, excluding longer audio/container tails.""" r=run(['ffprobe','-v','error','-select_streams','v:0','-show_frames','-show_entries','frame=best_effort_timestamp_time,pkt_duration_time,duration_time','-of','json',str(path)],600) if r.returncode:raise ValueError('Cannot decode source presentation timing') frames=json.loads(r.stdout).get('frames',[]) _,stream=probe(path) num,den=map(float,stream.get('avg_frame_rate','30/1').split('/')) fallback=den/num ends=[float(f['best_effort_timestamp_time'])+float(f.get('duration_time',f.get('pkt_duration_time',fallback))) for f in frames if 'best_effort_timestamp_time' in f] if not ends:raise ValueError('Source has no decoded video timing') return max(ends)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114{ "IMG_7039.MOV": { "staged_path": "/root/Desktop/task-01/media/IMG_7039.MOV", "local_source": "/Users/sidsantbak/Documents/ChatGPT/StudioWorld/video-tasks/Golf Swings/IMG_7039.MOV", "role": "Distractor \u2014 golfer / missed shot", "sha256": "557ea9e59871f8ae8fc38fa6c0db994a30792556b3d73ef1489db1206cfe42e1", "bytes": 33138797, "width": 3840, "height": 2160, "duration": 11.305, "sample_aspect_ratio": "1:1", "side_data_list": [ { "side_data_type": "Display Matrix", "displaymatrix": "\n00000000: 0 65536 0\n00000001: -65536 0 0\n00000002: 141557760 0 1073741824\n", "rotation": -90 } ] }, "coffee-beans-closeup-4k.mp4": { "staged_path": "/root/Desktop/task-01/media/coffee-beans-closeup-4k.mp4", "local_source": "/Users/sidsantbak/Documents/ChatGPT/StudioWorld/video-tasks/BRoll/coffee-beans-closeup-4k.mp4", "role": "Target 1 \u2014 roasted beans", "sha256": "ea4d290e4cc4fedd8f6bec568e54a307dcbdfaff69f8352fd1c9b2a06cab510a", "bytes": 33451395, "width": 4096, "height": 2160, "duration": 17.784433, "sample_aspect_ratio": "1:1", "side_data_list": [] }, "chart-daylight-5600k-0ev-rec709.mp4": { "staged_path": "/root/Desktop/task-01/media/chart-daylight-5600k-0ev-rec709.mp4", "local_source": "/Users/sidsantbak/Documents/ChatGPT/StudioWorld/video-tasks/ColorChart/chart-daylight-5600k-0ev-rec709.mp4", "role": "Distractor \u2014 color chart", "sha256": "ef0100ebab59169f8a320adf3d9e703edad06b355bdea03b57586dbf0c129960", "bytes": 87694, "width": 3840, "height": 2160, "duration": 10.0, "sample_aspect_ratio": "1:1", "side_data_list": [] }, "moka-pot-brewing-4k.mp4": { "staged_path": "/root/Desktop/task-01/media/moka-pot-brewing-4k.mp4", "local_source": "/Users/sidsantbak/Documents/ChatGPT/StudioWorld/video-tasks/BRoll/moka-pot-brewing-4k.mp4", "role": "Distractor \u2014 moka pot", "sha256": "f2f61f324e6dc125b7f779c848e0e73abf5ca4e9428eda659336a88c91af54c8", "bytes": 39926889, "width": 3840, "height": 2160, "duration": 30.36, "sample_aspect_ratio": "1:1", "side_data_list": [] }, "pouring-coffee-carafe-4k.mp4": { "staged_path": "/root/Desktop/task-01/media/pouring-coffee-carafe-4k.mp4", "local_source": "/Users/sidsantbak/Documents/ChatGPT/StudioWorld/video-tasks/BRoll/pouring-coffee-carafe-4k.mp4", "role": "Target 2 \u2014 espresso dispensing into clear glass", "sha256": "b20436e83fbd2845229990b63e27cb2904ee0db080a619d8ae4ec979d4d0a776", "bytes": 43861265, "width": 3840, "height": 2160, "duration": 34.52, "sample_aspect_ratio": "1:1", "side_data_list": [] }, "hands-barista-latte-art-4k.mov": { "staged_path": "/root/Desktop/task-01/media/hands-barista-latte-art-4k.mov", "local_source": "/Users/sidsantbak/Documents/ChatGPT/StudioWorld/video-tasks/BRoll/hands-barista-latte-art-4k.mov", "role": "Distractor \u2014 latte art", "sha256": "1f6d81b67170901053b97869bb268ecd022e5a19118655a32f90517b950d7dc5", "bytes": 19301403, "width": 3872, "height": 2160, "duration": 10.466667, "sample_aspect_ratio": "1:1", "side_data_list": [] }, "basketball-conditioning-fort-belvoir.mp4": { "staged_path": "/root/Desktop/task-01/media/basketball-conditioning-fort-belvoir.mp4", "local_source": "/Users/sidsantbak/Documents/ChatGPT/StudioWorld/video-tasks/Balls falling/basketball-conditioning-fort-belvoir.mp4", "role": "Distractor \u2014 basketball", "sha256": "4c66d01717b7592693d1d160aeea9494b2cb7647a125bb20d42ab4ccce27369a", "bytes": 19536528, "width": 3840, "height": 2160, "duration": 15.541667, "sample_aspect_ratio": "1:1", "side_data_list": [] }, "hands-cup-pickup-4k.mp4": { "staged_path": "/root/Desktop/task-01/media/hands-cup-pickup-4k.mp4", "local_source": "/Users/sidsantbak/Documents/ChatGPT/StudioWorld/video-tasks/BRoll/hands-cup-pickup-4k.mp4", "role": "Target 3 \u2014 white cup/spoon/saucer outside", "sha256": "e9ba1185e7135cab1caa15ee156f2c168e83db04e78ecb54ea870181817fe88c", "bytes": 7366009, "width": 3840, "height": 2160, "duration": 7.338, "sample_aspect_ratio": "1:1", "side_data_list": [] }, "817913__johnmode__1980s-song-fragment-01.mp3": { "local_source": "/Users/sidsantbak/Documents/ChatGPT/StudioWorld/video-tasks/817913__johnmode__1980s-song-fragment-01.mp3", "staged_path": "/root/Desktop/task-01/media/817913__johnmode__1980s-song-fragment-01.mp3", "role": "Music", "sha256": "7f94a7b1be14a4787c1fe8166d6597ec34ef9b4ddc40a0221eb4855bc1893be4", "bytes": 1261496, "duration": 31.536, "sample_rate": 48000, "channels": 2 }}123456#!/bin/shset -eu# Operator evidence is delivered only to the isolated grader.i=0while [ ! -s /tests/operator-evidence-ready.json ] && [ "$i" -lt 150 ]; do sleep 2; i=$((i+1)); donepython3 /tests/verify.py --workspace / --report-dir /logs/verifier12345678{ "runtime_version": "20261016.2", "queue_exports": [ "final01-1080p.mp4", "final01-720p.mp4" ], "weights_unchanged": true}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172"""Private deterministic grading runtime. Never emit a task reward for grader errors."""import json,math,shutil,subprocess,hashlibfrom pathlib import Pathclass VerifierInfrastructureError(RuntimeError):pass
def preflight(assets,access): for command in ['ffmpeg','ffprobe','filmcraft-cli','fc-match']: if not shutil.which(command):raise VerifierInfrastructureError('Required grading tool missing: '+command) for package in ['numpy','PIL']: try:__import__(package) except ImportError as e:raise VerifierInfrastructureError('Required grading dependency missing: '+package) from e trace=assets/'operator-trajectory.json' if not trace.is_file():raise VerifierInfrastructureError('Private operator trajectory missing') data=json.loads(trace.read_text()) if not isinstance(data.get('steps'),list):raise VerifierInfrastructureError('Invalid private trajectory schema') if access=='gui': try:__import__('cv2') except ImportError as e:raise VerifierInfrastructureError('Required GUI grading dependency missing: cv2') from e if not shutil.which('tesseract'):raise VerifierInfrastructureError('Required GUI grading tool missing: tesseract') missing=[] for step in data['steps']: for result in step.get('observation',{}).get('results',[]): for part in result.get('content',[]): if part.get('type')=='image' and part.get('source',{}).get('path'): name=Path(part['source']['path']).name if not (assets/'operator-screenshots'/name).is_file():missing.append(name) if missing:raise VerifierInfrastructureError('Missing private delivered screenshots: '+', '.join(sorted(set(missing))[:10])) ready=assets/'operator-evidence-ready.json' if ready.exists(): declared=json.loads(ready.read_text()) if declared.get('trajectory_sha256')!=hashlib.sha256(trace.read_bytes()).hexdigest() or not declared.get('screenshots_complete'):raise VerifierInfrastructureError('Private evidence ready marker does not match supplied trajectory') return {'trajectory_sha256':hashlib.sha256(trace.read_bytes()).hexdigest(),'access':access}
def validate_report(result): total=earned=0 for key,row in result['rubric'].items(): weights=sum(c['possible'] for c in row['checks']) if not math.isclose(weights,row['possible'],abs_tol=1e-5):raise VerifierInfrastructureError('Rubric weight mismatch: '+key) for c in row['checks']: if c['state'] not in ['met','unmet']:raise VerifierInfrastructureError('Unresolved weighted criterion: '+key+'/'+c['id']) if not str(c.get('evidence','')).strip():raise VerifierInfrastructureError('Missing check evidence: '+key+'/'+c['id']) points=sum(c['possible'] for c in row['checks'] if c['state']=='met') if not math.isclose(points,row['earned'],abs_tol=1e-5):raise VerifierInfrastructureError('Earned points mismatch: '+key) total+=row['possible'];earned+=points if not math.isclose(total,100,abs_tol=1e-5) or not math.isclose(earned,result['resolved_score'],abs_tol=1e-5):raise VerifierInfrastructureError('Score/weight total mismatch') if result.get('unresolved_points')!=0:raise VerifierInfrastructureError('Final reward cannot contain unresolved weighted checks') return result
def select_project(required): if required.is_file():return required # Exact stem without the app suffix is a filename error, not absent editing work. alternate=required.with_suffix('') if alternate.is_file(): try: if json.loads(alternate.read_text()).get('format')=='filmcraft.project':return alternate except (ValueError,OSError):pass return required
def cli_main(evaluate,default_assets): import argparse p=argparse.ArgumentParser();p.add_argument('--workspace',type=Path,required=True);p.add_argument('--report-dir',type=Path,required=True);p.add_argument('--assets',type=Path,default=default_assets);p.add_argument('--access',choices=['gui','terminal']);a=p.parse_args();a.report_dir.mkdir(parents=True,exist_ok=True) for name in ['reward.json','reward.txt','infrastructure-error.json']:(a.report_dir/name).unlink(missing_ok=True) try: access=a.access or json.loads((a.assets/'access.json').read_text())['access'];receipt=preflight(a.assets,access) result=validate_report(evaluate(a.workspace,a.report_dir,a.assets,access));result['grading_runtime']={'version':'20261016.2',**receipt} (a.report_dir/'rubric.json').write_text(json.dumps(result,indent=2)+'\n') (a.report_dir/'reward.json').write_text(json.dumps({'reward':result['resolved_score']/100,'score_points':result['resolved_score'],'unresolved_points':0})+'\n') print(json.dumps({'score_range':result['score_range'],'policy':result.get('policy')})) except Exception as e: for name in ['reward.json','reward.txt']:(a.report_dir/name).unlink(missing_ok=True) (a.report_dir/'infrastructure-error.json').write_text(json.dumps({'classification':'verifier_error','error_type':type(e).__name__,'error':str(e),'task_reward_published':False},indent=2)) raise123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170"""B-name-batch v4: last-five-second ranges, cross dissolves and supplied music.Unknown native structures/action/render evidence remain explicit. No fixed runtime."""import argparse,json,math,shutil,subprocessfrom pathlib import Pathfrom verifier_runtime import select_projectimport numpy as npfrom deterministic_checks import action_checks,native_dissolve,rendered_assembly,GradingError,require_completefrom media_helpers import digest,probe,run,normal,geometry,decoded_frames,video_end,TICKSSOURCES=['coffee-beans-closeup-4k.mp4','pouring-coffee-carafe-4k.mp4','hands-cup-pickup-4k.mp4']MUSIC='817913__johnmode__1980s-song-fragment-01.mp3'EXPORTS=[('final01-1080p.mp4',1920,1080),('final01-720p.mp4',1280,720)]POINTS=dict(zip(list('acdefghijklmno'),[2,4,4,8,9,12,10,6,8,4,6,12,10,5]))LABELS=dict(zip(POINTS,['Filmcraft use','Three targets available in Filmcraft','Editable assembled sequence','Correct target order only','Last five seconds normal forward speed','Editable and rendered cross dissolves','Both exports contain matching tail assembly','Picture continuity and no black tail','Two H.264 MP4s at 30 fps','Exact names and original output folder','Full-image fit without stretching','Editable native footage, dissolves, music and links','Supplied music audible and trimmed to picture end','Both exports queued together and batch executed']))assert sum(POINTS.values())==100
def pcm(path): r=run(['ffmpeg','-v','error','-i',str(path),'-vn','-ac','1','-ar','8000','-f','f32le','pipe:1'],180) return np.frombuffer(r.stdout,dtype='<f4') if r.returncode==0 else np.array([])
def evaluate(workspace,report_dir,assets,access): report_dir.mkdir(parents=True,exist_ok=True);out=workspace/'root/Desktop/final01/output';project=out/'proj-task-01.fcproj';manifest=json.loads((assets/'source-manifest.json').read_text());initial=json.loads((assets/'initial-project.fcproj').read_text()) required_project=project;project=select_project(project) rows={k:{'requirement':LABELS[k],'possible':v,'checks':[]} for k,v in POINTS.items()} def add(k,id,pts,state,evidence):rows[k]['checks'].append({'id':id,'possible':pts,'state':'unknown' if state is None else 'met' if state else 'unmet','evidence':str(evidence)}) doc={};error=None if project.is_file(): try: doc=json.loads(project.read_text()) if doc.get('format')!='filmcraft.project':raise ValueError('Unrecognized native format') except Exception as e:error=str(e);doc={} items=doc.get('project',{}).get('items',{});links={};submission={str(p.relative_to(workspace)):digest(p) for p in out.iterdir() if p.is_file()} if out.is_dir() else {} for id,item in items.items(): m=item.get('kind',{}).get('Media',{});path=m.get('media',{}).get('File',{}).get('path') if not path:continue p=workspace/path.lstrip('/') if Path(path).is_absolute() else project.parent/path;sha=digest(p) if p.is_file() else None;n=next((n for n,r in manifest.items() if r['sha256']==sha),None) links[id]={'name':n,'valid':bool(n) and not m.get('offline'), 'media':m,'path':path} if p.is_file():submission[str(p.relative_to(workspace))]=sha imported={l['name'] for l in links.values() if l['valid']} trace_path=assets/'operator-trajectory.json' if not trace_path.is_file():raise GradingError('Missing operator-supplied trajectory for app and batch checks') actions=action_checks(json.loads(trace_path.read_text()),workspace,SOURCES,assets) add('a','recorded-use',2,actions['app_use'],actions['app_steps']) for n in SOURCES:add('c',n,4/3,n in imported,'Actual source hash compared with initial distractor-only bin') native=None if project.is_file() and doc and shutil.which('filmcraft-cli'): r=run(['filmcraft-cli','--project',str(project),'inspect'],180);(report_dir/'native-inspection.stdout').write_bytes(r.stdout);(report_dir/'native-inspection.stderr').write_bytes(r.stderr) if r.returncode==0: try:native=json.loads(r.stdout) except Exception:pass seqs=[] for id,item in items.items(): s=item.get('kind',{}).get('Sequence') if not s:continue video=[];audio=[];trans=[] for kind,bag in [('video_tracks',video),('audio_tracks',audio)]: tracks=s.get(kind,[]);solo=any(t.get('solo') for t in tracks) for t in tracks: if not t.get('enabled',True) or t.get('muted',False) or solo and not t.get('solo'):continue bag.extend(c for c in t.get('items',[]) if c.get('enabled',True)); if kind=='video_tracks':trans.extend(t.get('transitions',[])) video.sort(key=lambda c:c.get('start',0));seqs.append({'id':id,'seq':s,'video':video,'audio':audio,'transitions':trans}) active=str(doc.get('view',{}).get('active_sequence',''));selected=next((s for s in seqs if s['id']==active),None) or max(seqs,key=lambda s:sum(links.get(str(c.get('item')),{}).get('name') in SOURCES for c in s['video']),default=None) clips=selected['video'] if selected else [];order=[links.get(str(c.get('item')),{}).get('name') for c in clips];standard=bool(selected) and all(str(c.get('item')) in links for c in clips);absent=None if project.is_file() else False add('d','source-backed-new-sequence',4,bool(native) and bool(clips) if native is not None else absent,'No sequences in initial fixture; successful native reopen still required') for i,n in enumerate(SOURCES):add('e',f'position-{i}',2,(i<len(order) and order[i]==n) if standard else absent,order) add('e','only-targets',2,order==SOURCES if standard else absent,'Distractors may stay in bins') for n in SOURCES: cs=[c for c in clips if links.get(str(c.get('item')),{}).get('name')==n] for prop in ['tail-start','five-second-range','normal-speed']: values=[] for c in cs: m=links[str(c['item'])]['media'];duration=video_end(assets/'reference'/n) values.append(abs(c.get('source_in',0)/TICKS-(duration-5))<=1/30 if prop=='tail-start' else abs(c.get('duration',0)/TICKS-5)<=1/30 and abs((c.get('source_in',0)+c.get('duration',0))/TICKS-duration)<=1/30 if prop=='five-second-range' else normal(c,m)) ok=(None if None in values else all(values)) if values else False if standard or not project.is_file() else None add('f',n+'/'+prop,1,ok,'Native contribution/edge handles: '+str(values)+'; alternate transition-range representations need review') for i in [1,2]: add('g',f'join-{i}/native-editable',3,bool(native_dissolve(selected,clips,i)),'Enabled source-linked native dissolve at actual join: '+json.dumps(selected['transitions'] if selected else [])) picture_end=max((c.get('start',0)+c.get('duration',0))/TICKS for c in clips) if clips else None rate=(selected['seq']['settings'].get('frame_rate') or {'num':30,'den':1}) if selected else {'num':30,'den':1} frame_tolerance=max(1/30,rate['den']/rate['num'])+1e-6 music_clips=[c for c in selected['audio'] if links.get(str(c.get('item')),{}).get('name')==MUSIC and normal(c,links[str(c['item'])]['media']) is not False] if selected else [] add('n','linked-sound-in-timeline',2,bool(music_clips) if selected else absent,'Supplied music SHA256 must resolve from an active audio contribution') add('n','native-music-picture-end',2,all(abs((c['start']+c['duration'])/TICKS-picture_end)<=frame_tolerance for c in music_clips) if music_clips and picture_end else absent,'Actual music end compared with video end; '+str(picture_end)) intervals=sorted((c.get('start',0)/TICKS,(c.get('start',0)+c.get('duration',0))/TICKS) for c in clips) continuity=None if standard and intervals: covered=0;continuity=True for start,end in intervals: if start>covered+1/30:continuity=False covered=max(covered,end) add('i','native-continuity',1,continuity if clips else absent,'Union of contributing video intervals; alternate nested/transition arrangements require review') add('i','native-sequence-export-end',1,bool(selected) and all(t.get('start',0)+t.get('duration',0)<=round(picture_end*TICKS) for t in selected['transitions']) and (selected['seq'].get('mark_out') is None or abs(selected['seq']['mark_out']/TICKS-picture_end)<=1/30),'Sequence picture end and active export range') refs=[decoded_frames(assets/'reference'/n,192,108,'fps=30,scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2') for n in SOURCES] if standard and order==SOURCES else [] exports=[];source_pcm=pcm(assets/'reference'/MUSIC) for filename,W,H in EXPORTS: p=out/filename;present=p.is_file();d={};s={};frames=None;decode_error=None if present: try: d,s=probe(p) if float(d['format'].get('duration',0))>120:raise ValueError('Decode budget exceeded') frames=decoded_frames(p,192,108) except Exception as e:decode_error=str(e) if decode_error:raise GradingError('Export decode/probe failed: '+decode_error) valid=frames is not None and len(frames)>0;duration=float(s.get('duration',d.get('format',{}).get('duration',0))) timestamp=False if valid: r=run(['ffprobe','-v','error','-select_streams','v:0','-show_entries','frame=best_effort_timestamp_time','-of','json',str(p)],180) if not r.returncode: ts=[float(x['best_effort_timestamp_time']) for x in json.loads(r.stdout)['frames'] if 'best_effort_timestamp_time' in x];timestamp=len(ts)>1 and max(abs(b-a-1/30) for a,b in zip(ts,ts[1:]))<.0001 fps=s.get('avg_frame_rate','0/1').split('/');rate=float(fps[0])/max(1,float(fps[1])) for prop,ok in [('container','mp4' in d.get('format',{}).get('format_name','')),('codec',s.get('codec_name')=='h264'),('dimensions',(s.get('width'),s.get('height'))==(W,H) and s.get('sample_aspect_ratio','1:1') in ['1:1','N/A'] and not any(x.get('rotation',0)%360 for x in s.get('side_data_list',[]))),('fps',abs(rate-30)<.001 and timestamp)]:add('j',filename+'/'+prop,1,ok if valid else None if present else False,'Actual decoded probe/timestamps') add('k',filename+'/name',1,present,'Exact filename');add('k',filename+'/directory',1,present,'Original final01/output path') assembly=rendered_assembly(frames,clips,selected,refs) if valid and refs else {'full':False,'tails':[False]*3,'joins':[False]*2,'end':False} visual=[] for i,n in enumerate(SOURCES): c=next((c for c in clips if links.get(str(c.get('item')),{}).get('name')==n),None);match=None if valid and c and standard: # Compare an unblended midpoint outside overlap. Dissolve frames are separately reviewed. t=c['start']/TICKS+c['duration']/TICKS/2;overlap=any(x is not c and x['start']/TICKS<=t<(x['start']+x['duration'])/TICKS for x in clips) if not overlap: source_time=c.get('source_in',0)/TICKS+(t-c['start']/TICKS);ref_path=assets/'reference'/n rr=run(['ffmpeg','-v','error','-ss',str(source_time),'-i',str(ref_path),'-frames:v','1','-vf',f'scale={W}:{H}:force_original_aspect_ratio=decrease,pad={W}:{H}:(ow-iw)/2:(oh-ih)/2,scale=192:108','-pix_fmt','rgb24','-f','rawvideo','pipe:1'],120) if len(rr.stdout)==192*108*3 and round(t*30)<len(frames):match=float(np.abs(np.frombuffer(rr.stdout,dtype=np.uint8).reshape(108,192,3).astype(float)-frames[round(t*30)].astype(float)).mean())<15 add('h',filename+'/'+n+'/interior',.5,bool(match),'Interior time-mapped sample; full source range requires separate evidence');visual.append(match) add('h',filename+'/'+n+'/full-tail-range',7/6,assembly['tails'][i],'All decoded tail frames including paired source contributions: '+json.dumps(assembly)) for prop in ['full-image-fit','proportional-scale']: g=geometry(c,links[str(c['item'])]['media'],selected['seq']['settings']['width'],selected['seq']['settings']['height']) if c and standard else None sw,sh=(selected['seq']['settings']['width'],selected['seq']['settings']['height']) if selected else (W,H) fit=bool(g and 'sx' in g and g['x']>=-2 and g['y']>=-2 and g['x']+g['w']<=sw+2 and g['y']+g['h']<=sh+2 and abs(max(g['w']/sw,g['h']/sh)-1)<.003) proportional=bool(g and 'sx' in g and abs(g['sx']-g['sy'])<1e-5) add('l',filename+'/'+n+'/'+prop,.5,assembly['tails'][i] and (fit if prop=='full-image-fit' else proportional),'Native sequence transforms with proportional export scaling and all-frame source comparison: '+str(g)) for i in [1,2]:add('g',f'join-{i}/'+filename,1.5,assembly['joins'][i-1],'All transition frames compared with outgoing/incoming source mixtures; monotonic blend and no fade-to-black: '+json.dumps(assembly)) add('i',filename+'/continuity',1,assembly['full'],'Every decoded frame matches source or progressive blend; source-inherent black allowed') add('i',filename+'/picture-end-no-black-tail',1,assembly['end'],'Decoded frame count and final three frames matched to actual source picture end') audio=pcm(p) if valid else np.array([]);audible=len(audio)>0 and float(np.sqrt((audio.astype(float)**2).mean()))>1e-5 correlation=None if audible and len(source_pcm)>len(audio): # Best gain-invariant waveform correlation at coarse source offsets; not a forced start time. stride=8;a=audio[::stride].astype(float);a-=a.mean();best=0 for offset in range(0,len(source_pcm)-len(audio),800): b=source_pcm[offset:offset+len(audio):stride].astype(float);b-=b.mean();den=np.linalg.norm(a)*np.linalg.norm(b) if den:best=max(best,float(np.dot(a,b)/den)) correlation=best add('n',filename+'/audible-matching-music',2,bool(audible and correlation is not None and correlation>.75 and music_clips),'Decoded RMS and native supplied-source waveform correlation '+str(correlation)+'; gain/mixing/codec delay require calibrated review') audio_streams=[x for x in d.get('streams',[]) if x.get('codec_type')=='audio'];audio_end=max((float(x.get('start_time',0))+float(x.get('duration',0)) for x in audio_streams),default=None) add('n',filename+'/audio-end',1,bool(audio_end is not None and picture_end is not None and abs(audio_end-picture_end)<=frame_tolerance+1024/48000),'Audio stream end with one video-frame tolerance for AAC padding '+str(audio_end)+'; picture end '+str(picture_end)+'; inspect final audible samples and calibrate encoder padding') exports.append({'name':filename,'probe':d,'decode_error':decode_error,'frames':len(frames) if valid else 0,'duration':duration,'interior_matches':visual,'music_correlation':correlation}) add('m','name',1,required_project.is_file(),'proj-task-01.fcproj');add('m','directory',1,project.is_file(),'final01/output');add('m','native-load',2,bool(native) if native is not None else absent,'Pinned native reopen') add('m','editable-original-footage',2,True if native and standard and order==SOURCES else absent,'Native loaded editable original-source timeline required; flattened export insufficient') add('m','editable-dissolves',1,bool(native) and all(native_dissolve(selected,clips,i) for i in [1,2]),'Native reopen and enabled source-linked editable cross dissolves') add('m','editable-music-trim',1,True if native and music_clips else absent,'Native editable source-backed audio clip and trim') for n in SOURCES+[MUSIC]:add('m','link/'+n,1,n in imported,'Actual resolving original asset hash') add('o','queued-two-exports-before-start',2,actions['batch'],actions['queue_evidence']) add('o','batch-processes-both-jobs',3,actions['batch'] and all((out/n).is_file() for n,_,_ in EXPORTS),actions['queue_evidence']) review_path=report_dir/'operator-review.json';review=json.loads(review_path.read_text()) if review_path.is_file() else {};reviewed=bool(submission) and review.get('submission_sha256')==submission and review.get('reviewer') and review.get('evidence') for k,row in rows.items(): assert math.isclose(sum(c['possible'] for c in row['checks']),row['possible']),k row['earned']=sum(c['possible'] for c in row['checks'] if c['state']=='met');row['unresolved']=sum(c['possible'] for c in row['checks'] if c['state']=='unknown');row['status']='unknown' if row['unresolved'] else 'met' if math.isclose(row['earned'],row['possible']) else 'partially_met' if row['earned'] else 'unmet' earned=sum(r['earned'] for r in rows.values());unknown=sum(r['unresolved'] for r in rows.values());policy='pass' if access=='terminal' else review.get('policy','unknown') if reviewed else 'unknown' if policy not in ['pass','fail','unknown']:policy='unknown' result={'rubric_version':'01-B-name-batch-v4-deterministic-20261016','rubric':rows,'resolved_score':round(earned,6),'unresolved_points':round(unknown,6),'score_range':[round(earned,6),round(earned+unknown,6)],'policy':policy,'exports':exports,'native_picture_end':picture_end,'project_error':error,'submission_sha256':submission,'operator_review_applied':bool(reviewed),'limitations':['Checks use fixed native schema, decoded-frame tolerances and private action/screenshot evidence.','Unsupported structures or missing grading evidence raise a verifier error and withhold reward.','Fixture and saved-attempt regression results are recorded separately from oracle validation.']} require_complete(result) (report_dir/'rubric.json').write_text(json.dumps(result,indent=2)+'\n');(report_dir/'reward.json').write_text(json.dumps({'reward':earned/100,'score_points':earned,'unresolved_points':unknown,'possible_upper_bound':(earned+unknown)/100},indent=2)+'\n') (report_dir/'review-template.json').write_text(json.dumps({'reviewer':'','evidence':[],'submission_sha256':submission,'policy':'unknown','checks':{k+'/'+c['id']:{'state':'unknown','evidence':''} for k,row in rows.items() for c in row['checks'] if c['state']=='unknown'}},indent=2)+'\n');return result
def main(): from verifier_runtime import cli_main cli_main(evaluate,Path(__file__).resolve().parent)if __name__=='__main__':main()12345678910111213141516171819202122232425262728293031323334353637383940414243444546# golf-05-hunter-mahan-iron-slomo
Friction tracer task. Expressions allowed. One required render: /root/edit/traced/shot_01.mp4; SVG: /root/edit/svg/shot_01.svg. Output 1080×1920, 30 fps, H.264, full source duration, no audio stream. No Shotcut project or second export is graded.
| Criterion | Weight | Check ||---|---:|---|| Tracer SVG | 8% | Parseable transparent vector paths, no embedded footage or scripts. || Line position and camera alignment | 38% | Every output frame compared to the time-aligned, scaled reference SVG; symmetric Euclidean ±10px margin, ±20px for uncertain frames. Pixels inside the margin receive full position credit. || Visibility, growth, holds and gaps | 18% | Correct visible/blank states and progressive revealed footprint. || Tracked endpoint | 12% | Full credit within the same ±10px / ±20px margin; falls to zero at twice that distance. || Appearance | 8% | Red #FF0000, 9px stroke, no fill; reference footprint and colour checks. || Footage/audio preservation | 8% | Scaled original background remains intact; output must contain no audio stream; tolerated line-position zone excluded from background checks. || Friction render format | 8% | Decodable full-length 1080×1920, 30 fps H.264 render. |
Uncertain frames receive 0.35 weight. Missing/corrupt/nonconforming render or logged terminal use gives zero. Geometry precision and recall are both checked to penalize missing path sections and extra lines outside the margin. Render frames map to source reference timestamps; original SVG/JSON/CSV metadata remain preserved in tests/reference. Native project files are not inspected or graded. GUI provenance can be reviewed from the trajectory.
Ball tracer: nothing before impact; grow and hold according to reference timing.
Launch anchor f280 (invisible); first segment f281; grow through f495; hold to f495.
Additional host VLM grading: gpt-6-luna reviews up to 24 timestamped reference/candidate frame pairs. Tracking alignment 35%, growth/timing 25%, appearance 20%, footage preservation 20%. Returns a separate 0–1 score with evidence and limitations. No native project inspection. The SVG reward stays unchanged. API errors are reported separately.
Export grading update: wrong filename or duration does not zero the visual score. Any playable final MP4 under /root/edit is compared at the original timestamps; missing frames lose visual credit and excess duration reduces export compliance. File/format errors reduce only the 8% export category.
## User-annotated tracer intervals (October 9, 2026)
These inclusive zero-based source-frame intervals supersede older onset/hold timing. Convert by source FPS when exporting at 30 fps. Timestamp interval correctness receives 10%, with 8% retained for reference growth/timing (18% total). The interval score checks onset (±3 source frames), visibility, absence outside intervals and a 20% hold-area band when a stop is specified.
```json{ "schema_version": 1, "frame_index_base": 0, "frame_domain": "source", "bounds": "inclusive", "onset_tolerance_frames": 3, "hold_area_tolerance_fraction": 0.2, "annotation_source": "User annotations, October 9 2026", "intervals": [ { "id": "tracer_1", "start_frame": 281, "visible_end_frame": null } ]}```1234567891011Deliver a video of a shot tracer that follows the ball in Friction. Draw the tracers in Friction. This machine has no terminal or command line; do all work through the applications’ own interfaces. You can use expressions in Friction.
Source clip: /root/media/source.mp4 (05_hunter_mahan_iron_slomo.mp4). This task contains one video. Friction is already open; relaunch it from its launcher if needed. Shotcut is available for viewing the footage; assembly or a separate Shotcut export is not required.
1. **Tracers, in Friction.** Make a scene matching the clip’s full duration and original framing, with a 1080×1920 canvas at 30 fps. Import the clip, scaled proportionally to fill the canvas without cropping, and step through it frame by frame to find the moment the club strikes the ball. Zoom in on the ball. Use the Add Path tool and place points frame by frame. Draw one smooth path along the ball’s flight, starting exactly at the ball at impact and following it until it lands or leaves the frame. Nothing should be drawn before impact. Where the target disappears, extrapolate its next position from visible frames; do not invent a landing if it is not visible.
2. Give the path a thick red (#FF0000) stroke and no fill. Use **9 output pixels**, with round caps and joins. No taper, glow or fade. Add the **Sub-Path** path effect and keyframe it so the visible line grows with the target; on each growing frame its tip should sit on the ball. Friction expressions are allowed for these animations. Account for camera movement while preserving constant visible stroke thickness. The tracer must not alter the footage: no colour changes, crops or filters; keep the output muted and preserve the full clip duration.
3. You may save your Friction work under /root/edit/ for your own use; native project files are not graded. Render the full traced clip to **/root/edit/traced/shot_01.mp4** (1080×1920, 30 fps, H.264, muted with no audio stream). Export the scene’s transparent animated tracer path using File → Export → SVG to **/root/edit/svg/shot_01.svg**.
Author timing update (October 9, 2026): These intervals override earlier tracer onset, visibility, hold and reset instructions. Frames are inclusive and zero-based in the original source clip; convert using the original frame rate when rendering at 30 fps. Onset has a ±3-source-frame tolerance for very short encoded strokes. tracer_1: visible from frame 281 through the end of the clip. Outside these intervals, hide the tracer unless an earlier start is explicitly allowed.12345678910111213141516171819202122schema_version = "1.4"artifacts = ["/root/edit", "/logs/artifacts"][task]name = "sid/golf-05-hunter-mahan-iron-slomo"version = "1.2.0"description = "One original golf clip; SVG-reference ball flight tracer rendered in Friction; expressions allowed"authors = []keywords = ["video-editing", "friction", "shotcut", "gui", "golf", "svg-reference"][metadata]source_filename = "05_hunter_mahan_iron_slomo.mp4"reference_group = "shottracer"approval_status = "approved_for_launch"[verifier]timeout_sec = 1800.0[agent]timeout_sec = 14400.0[environment]build_timeout_sec = 1800.0os = "linux"mcp_servers = [][environment.env]APP = "friction"1234567{ "geometry": 0.9998902806479031, "timing": 0.9619249592440313, "tip": 1.0, "style": 0.8368558174741365, "preservation": 0.8432612200692169}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193"""Minimal SVG path geometry for the t16 rubric (pure Python, no deps).
svg_polylines(svg_text) -> list of polylines [[(x, y), ...], ...] in the SVG'suser units, with <g>/<path> transform="translate/scale/matrix" applied andthe viewBox mapped to width/height. Supports path commands M m L l H h V vC c S s Q q T t Z z (cubics/quads sampled at 12 points), plus <polyline>,<polygon> and <line>. Anything else is ignored — the rubric reports "no path".Friction's SVG export (ExportSvgDialog) and hand-written SVGs both fit this."""import mathimport reimport xml.etree.ElementTree as ET
_NUM = re.compile(r"[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?")
def _mat_mul(a, b): a11, a12, a13, a21, a22, a23 = a; b11, b12, b13, b21, b22, b23 = b return (a11 * b11 + a12 * b21, a11 * b12 + a12 * b22, a11 * b13 + a12 * b23 + a13, a21 * b11 + a22 * b21, a21 * b12 + a22 * b22, a21 * b13 + a22 * b23 + a23)
def _parse_transform(t): m = (1, 0, 0, 0, 1, 0) if not t: return m for name, args in re.findall(r"(\w+)\s*\(([^)]*)\)", t): v = [float(x) for x in _NUM.findall(args)] if name == "translate": tx, ty = (v + [0])[:2]; mm = (1, 0, tx, 0, 1, ty) elif name == "scale": sx = v[0]; sy = v[1] if len(v) > 1 else sx; mm = (sx, 0, 0, 0, sy, 0) elif name == "matrix" and len(v) == 6: a, b, c, d, e, f = v; mm = (a, c, e, b, d, f) elif name == "rotate": ang = math.radians(v[0]); ca, sa = math.cos(ang), math.sin(ang) mm = (ca, -sa, 0, sa, ca, 0) if len(v) == 3: cx, cy = v[1], v[2] mm = _mat_mul(_mat_mul((1, 0, cx, 0, 1, cy), mm), (1, 0, -cx, 0, 1, -cy)) else: continue m = _mat_mul(m, mm) return m
def _apply(m, x, y): return (m[0] * x + m[1] * y + m[2], m[3] * x + m[4] * y + m[5])
def _bezier(p0, p1, p2, p3=None, n=12): pts = [] for i in range(1, n + 1): t = i / n if p3 is None: # quadratic x = (1 - t) ** 2 * p0[0] + 2 * (1 - t) * t * p1[0] + t ** 2 * p2[0] y = (1 - t) ** 2 * p0[1] + 2 * (1 - t) * t * p1[1] + t ** 2 * p2[1] else: x = ((1 - t) ** 3 * p0[0] + 3 * (1 - t) ** 2 * t * p1[0] + 3 * (1 - t) * t ** 2 * p2[0] + t ** 3 * p3[0]) y = ((1 - t) ** 3 * p0[1] + 3 * (1 - t) ** 2 * t * p1[1] + 3 * (1 - t) * t ** 2 * p2[1] + t ** 3 * p3[1]) pts.append((x, y)) return pts
def path_polylines(d): tokens = re.findall(r"[MmLlHhVvCcSsQqTtZzAa]|" + _NUM.pattern, d or "") polys, cur, start = [], None, None x = y = 0.0; cmd = None; i = 0; last_ctrl = None nums = []
def take(k): nonlocal i vals = [float(t) for t in tokens[i:i + k]]; i += k return vals while i < len(tokens): t = tokens[i] if re.match(r"[A-Za-z]", t): cmd = t; i += 1 if cmd in "Zz": if cur and start: cur.append(start) cur = None; last_ctrl = None continue if cmd is None: i += 1; continue rel = cmd.islower(); c = cmd.upper() try: if c == "M": px, py = take(2); x, y = (x + px, y + py) if rel else (px, py) cur = [(x, y)]; polys.append(cur); start = (x, y); cmd = "l" if rel else "L"; last_ctrl = None elif c == "L": px, py = take(2); x, y = (x + px, y + py) if rel else (px, py); cur.append((x, y)); last_ctrl = None elif c == "H": (px,) = take(1); x = x + px if rel else px; cur.append((x, y)); last_ctrl = None elif c == "V": (py,) = take(1); y = y + py if rel else py; cur.append((x, y)); last_ctrl = None elif c == "C": v = take(6) if rel: v = [v[0] + x, v[1] + y, v[2] + x, v[3] + y, v[4] + x, v[5] + y] cur.extend(_bezier((x, y), (v[0], v[1]), (v[2], v[3]), (v[4], v[5]))); last_ctrl = (v[2], v[3]); x, y = v[4], v[5] elif c == "S": v = take(4) if rel: v = [v[0] + x, v[1] + y, v[2] + x, v[3] + y] c1 = (2 * x - last_ctrl[0], 2 * y - last_ctrl[1]) if last_ctrl else (x, y) cur.extend(_bezier((x, y), c1, (v[0], v[1]), (v[2], v[3]))); last_ctrl = (v[0], v[1]); x, y = v[2], v[3] elif c == "Q": v = take(4) if rel: v = [v[0] + x, v[1] + y, v[2] + x, v[3] + y] cur.extend(_bezier((x, y), (v[0], v[1]), (v[2], v[3]))); last_ctrl = (v[0], v[1]); x, y = v[2], v[3] elif c == "T": v = take(2) if rel: v = [v[0] + x, v[1] + y] c1 = (2 * x - last_ctrl[0], 2 * y - last_ctrl[1]) if last_ctrl else (x, y) cur.extend(_bezier((x, y), c1, (v[0], v[1]))); last_ctrl = c1; x, y = v elif c == "A": v = take(7); x, y = (x + v[5], y + v[6]) if rel else (v[5], v[6]); cur.append((x, y)); last_ctrl = None else: i += 1 except (IndexError, ValueError, TypeError): break return [p for p in polys if len(p) >= 2]
def _animate_last(el): for ch in el: if ch.tag.split("}")[-1] == "animate" and ch.get("values"): vals = [v.strip() for v in ch.get("values").split(";") if v.strip()] if vals: return max(vals, key=len) # the longest path string = fully grown return None
def animate_values(text): """Per-frame path strings of the first animated <path> (Friction export), or [] — lets a rubric see how the line grows frame by frame.""" try: root = ET.fromstring(text) except ET.ParseError: return [] for el in root.iter(): if el.tag.split("}")[-1] == "path": for ch in el: if ch.tag.split("}")[-1] == "animate" and ch.get("values"): return [v.strip() for v in ch.get("values").split(";")] return []
def svg_polylines(text): try: root = ET.fromstring(text) except ET.ParseError: return [] # viewBox -> width/height mapping vb = root.get("viewBox"); base = (1, 0, 0, 0, 1, 0) try: if vb: vx, vy, vw, vh = [float(v) for v in _NUM.findall(vb)] w = float(_NUM.findall(root.get("width", str(vw)))[0]); h = float(_NUM.findall(root.get("height", str(vh)))[0]) base = (w / vw, 0, -vx * w / vw, 0, h / vh, -vy * h / vh) except (ValueError, IndexError, ZeroDivisionError): pass out = []
def walk(el, m): m = _mat_mul(m, _parse_transform(el.get("transform"))) tag = el.tag.split("}")[-1] polys = [] if tag == "path": d = el.get("d") if not d: # Friction's SVG export (ExportSvgDialog) writes an animated path: # no d attribute, the per-frame path strings live in # <animate attributeName="d" values="M..;M..;..">. The LAST value # is the fully grown line (Sub-Path at 100 %); the sequence is # also the frame-by-frame growth, exposed via animate_values(). d = _animate_last(el) polys = path_polylines(d) elif tag in ("polyline", "polygon"): v = [float(t) for t in _NUM.findall(el.get("points", ""))] pts = list(zip(v[0::2], v[1::2])) if tag == "polygon" and pts: pts.append(pts[0]) polys = [pts] if len(pts) >= 2 else [] elif tag == "line": try: polys = [[(float(el.get("x1")), float(el.get("y1"))), (float(el.get("x2")), float(el.get("y2")))]] except (TypeError, ValueError): polys = [] for p in polys: out.append([_apply(m, x, y) for x, y in p]) for ch in el: walk(ch, m) walk(root, base) return out12345678910111213141516{ "schema_version": 1, "frame_index_base": 0, "frame_domain": "source", "bounds": "inclusive", "onset_tolerance_frames": 3, "hold_area_tolerance_fraction": 0.2, "annotation_source": "User annotations, October 9 2026", "intervals": [ { "id": "tracer_1", "start_frame": 281, "visible_end_frame": null } ]}1234567FROM refresh-golf-gui-base:20261005RUN rm -rf /root/media /root/reference /root/edit /opt/t16-reference && mkdir -p /root/edit/traced /root/edit/svgCOPY media/ /root/media/RUN test -s /root/media/source.mp4 && python3 -c "import cv2,numpy"ENV APP=frictionWORKDIR /rootCMD ["/usr/local/bin/start-editor"]tasks/01-A-name-formats-gui-v3/README.mdAdded+12
tasks/01-A-name-formats-gui-v3/environment/DockerfileAdded+39
tasks/01-A-name-formats-gui-v3/environment/files.pyAdded+52
tasks/01-A-name-formats-gui-v3/environment/filmcraft-wrapper.shAdded+4
tasks/01-A-name-formats-gui-v3/environment/filmcraft.desktopAdded+6
tasks/01-A-name-formats-gui-v3/environment/install-gui.pyAdded+59
tasks/01-A-name-formats-gui-v3/environment/start-editor.shAdded+14
tasks/01-A-name-formats-gui-v3/instruction.mdAdded+18
tasks/01-A-name-formats-gui-v3/task.tomlAdded+25
tasks/01-A-name-formats-gui-v3/tests/DockerfileAdded+31
tasks/01-A-name-formats-gui-v3/tests/access.jsonAdded+1
tasks/01-A-name-formats-gui-v3/tests/deterministic_checks.pyAdded+101
tasks/01-A-name-formats-gui-v3/tests/gui_evidence.pyAdded+62
tasks/01-A-name-formats-gui-v3/tests/source-manifest.jsonAdded+34
tasks/01-A-name-formats-gui-v3/tests/test.shAdded+6
tasks/01-A-name-formats-gui-v3/tests/verifier-config.jsonAdded+5
tasks/01-A-name-formats-gui-v3/tests/verifier_runtime.pyAdded+72
tasks/01-A-name-formats-gui-v3/tests/verify.pyAdded+281
tasks/01-B-name-batch-gui-v4/README.mdAdded+8
tasks/01-B-name-batch-gui-v4/environment/DockerfileAdded+38
tasks/01-B-name-batch-gui-v4/environment/desktop/task-01/start.fcprojAdded+1
tasks/01-B-name-batch-gui-v4/environment/files.pyAdded+52
tasks/01-B-name-batch-gui-v4/environment/filmcraft-wrapper.shAdded+4
tasks/01-B-name-batch-gui-v4/environment/filmcraft.desktopAdded+6
tasks/01-B-name-batch-gui-v4/environment/install-gui.pyAdded+59
tasks/01-B-name-batch-gui-v4/environment/start-editor.shAdded+14
tasks/01-B-name-batch-gui-v4/instruction.mdAdded+14
tasks/01-B-name-batch-gui-v4/task.tomlAdded+25
tasks/01-B-name-batch-gui-v4/tests/DockerfileAdded+31
tasks/01-B-name-batch-gui-v4/tests/access.jsonAdded+1
tasks/01-B-name-batch-gui-v4/tests/deterministic_checks.pyAdded+101
tasks/01-B-name-batch-gui-v4/tests/gui_evidence.pyAdded+62
tasks/01-B-name-batch-gui-v4/tests/initial-project.fcprojAdded+1
tasks/01-B-name-batch-gui-v4/tests/media_helpers.pyAdded+91
tasks/01-B-name-batch-gui-v4/tests/source-manifest.jsonAdded+114
tasks/01-B-name-batch-gui-v4/tests/test.shAdded+6
tasks/01-B-name-batch-gui-v4/tests/verifier-config.jsonAdded+8
tasks/01-B-name-batch-gui-v4/tests/verifier_runtime.pyAdded+72
tasks/01-B-name-batch-gui-v4/tests/verify.pyAdded+170
tasks/golf-tracer-05/RUBRIC.mdAdded+46
tasks/golf-tracer-05/instruction.mdAdded+11
tasks/golf-tracer-05/task.tomlAdded+22
tasks/golf-tracer-05/tests/calibration.jsonAdded+7
tasks/golf-tracer-05/tests/svgpath.pyAdded+193
tasks/golf-tracer-05/tests/tracer-intervals.jsonAdded+16
tasks/golf-tracer-09/environment/DockerfileAdded+7
tasks/golf-tracer-09/tests/reference/svg_frames/000000.svgAdded
tasks/golf-tracer-09/tests/reference/svg_frames/000001.svgAdded
tasks/golf-tracer-09/tests/reference/svg_frames/000002.svgAdded
tasks/golf-tracer-09/tests/reference/svg_frames/000003.svgAdded