#!/usr/bin/env bash # Fable scores one app's readability three times, blind to which agent or # app it is (only the language is named); the per-field median is kept. # builders/run-readability.sh set -euo pipefail slug=$1 repo=$(cd "$(dirname "$0")/.." && pwd) cd "$repo" language=$(cd harness && go run ./cmd/language "$slug") work=$(mktemp -d -p "${TMPDIR:-$HOME/.cache}") trap 'rm -rf "$work"' EXIT { sed "s/{LANGUAGE}/$language/g" builders/prompts/readability.md echo bakeoff source --slug "$slug" --dir "${APP_DIR:-apps/$slug}" | sed -e "s/todo-$slug/todo-app/g" -e "s|apps/$slug|apps/app|g" } > "$work/prompt.md" replies=() for i in 1 2 3; do claude -p --model claude-fable-5-1 --output-format json --tools "" \ --mcp-config '{"mcpServers":{}}' --strict-mcp-config --no-session-persistence \ < "$work/prompt.md" > "builders/logs/$slug.readability$i.json" python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["result"])' "builders/logs/$slug.readability$i.json" > "$work/reply$i" replies+=("$work/reply$i") done bakeoff readability --slug "$slug" --replies "$(IFS=,; echo "${replies[*]}")"