#!/bin/bash # guidance-target.sh — print the guidance file the grader will use for a task, # and the standard it grades under. # # Mirrors the GRADING_STANDARD selector in the task's tests/test.sh: the # consolidated standard applies when the consolidated asset triple is present # in the task's tests/ directory; otherwise grading falls back to the legacy # standard. Detector skills call this so they always assess the guidance file # the grader will actually read, on any task shape — consolidated-era, # legacy-era, or transitional directories that carry both files. # # Usage: # bash scripts/guidance-target.sh # # Output (one line): # # # Set GRADING_STANDARD=legacy to resolve the legacy file deliberately, the # same way you would when grading with that standard. set -eu arg="${1:?usage: bash scripts/guidance-target.sh }" dir="$arg" [ -d "$dir" ] || dir="harbor-tasks/$arg" tests="$dir/tests" [ -d "$tests" ] || { echo "ERROR: no tests/ directory at $dir" >&2; exit 1; } if [ "${GRADING_STANDARD:-consolidated}" = "legacy" ]; then echo "$tests/grader-guidance.md legacy" exit 0 fi if [ -f "$tests/grader-system-prompt-consolidated.md" ] \ && [ -f "$tests/grader-guidance-consolidated.md" ] \ && [ -f "$tests/render-grade-consolidated.py" ]; then echo "$tests/grader-guidance-consolidated.md consolidated" else echo "$tests/grader-guidance.md legacy" fi