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