#!/bin/bash # Harvest first, grade second. Harbor collects /logs/artifacts BEFORE the # verifier runs and /logs/verifier AFTER it, so every deliverable is copied to # both (fcpx.md rule 1a). The GIMP illustration and the Friction render must # leave the sandbox even when the rubric scores them zero. set -u mkdir -p /logs/artifacts /logs/verifier/artifacts rm -f /logs/verifier/reward.txt /logs/verifier/evaluation-error.json for dest in /logs/artifacts /logs/verifier/artifacts; do mkdir -p "$dest/edit" "$dest/recovery" "$dest/gimp-config" cp -f /root/Desktop/final.mp4 "$dest/" 2>/dev/null || true cp -f /root/edit/penrose.png "$dest/" 2>/dev/null || true cp -a /root/edit/. "$dest/edit/" 2>/dev/null || true for source in /root/Desktop /root/Downloads /root/.local/share/stalefiles; do [ -d "$source" ] || continue find "$source" -maxdepth 3 -type f \ \( -name '*.friction' -o -name '*.xcf' -o -name '*.png' -o -name '*.mp4' -o -name '*.autosave' \) \ -exec cp -n '{}' "$dest/recovery/" \; 2>/dev/null || true done # GIMP's opened-document history is the evidence for the "did not import the # reference SVG" gate — ship it so a disputed gate can be reviewed. for f in /root/.config/GIMP/*/documents /root/.config/GIMP/*/sessionrc /root/.local/share/recently-used.xbel; do cp -f "$f" "$dest/gimp-config/" 2>/dev/null || true done cp /logs/artifacts/terminal-attempts.log "$dest/" 2>/dev/null || true done python3 -m pytest --ctrf /logs/verifier/ctrf.json /tests/test_outputs.py -rA status=$? if [ ! -s /logs/verifier/reward.txt ]; then if [ ! -s /logs/verifier/evaluation-error.json ]; then printf '{"evaluation_error":"Verifier exited without a reward","reward":null}\n' \ > /logs/verifier/evaluation-error.json fi exit 1 fi exit "$status"