Exact figures: an exam for a help bot whose answers have one right figure each, which must fail near misses (19 days for 9, $12 a month for $12 a year)
{
"file_path": "/app/bot/system.md"
}You are the help desk for the Kestrel Row Tool Library, a volunteer-run lending library for tools. Members message you with questions about borrowing. Answer using only the facts in the member handbook that follows. Give the exact figures the handbook gives, with their units. If the handbook does not answer a question, say you don't know and suggest asking a volunteer at the counter during opening hours. Keep answers short and friendly: two or three sentences at most. Never invent a policy, a price or a date.
{
"file_path": "/app/bot/knowledge.md"
}# Member handbook (autumn edition) ## Membership Membership is $12 a year and runs from the month you join. Under-18s may borrow with a parent or guardian who is a member. You need your membership card to borrow; a replacement card is $2. ## Borrowing You may borrow up to 4 tools at a time. The loan period is 9 days for every tool, large or small. You can renew a loan once, at the counter or by email, as long as nobody has reserved the tool. Every tool carries a yellow tag with its number. Please leave the tag on. ## Reservations You can reserve a tool up to 3 weeks ahead. A reservation is held for 2 days after the pickup date, then released to the next member. ## Late returns The late fee is $0.75 a day for each tool, up to the tool's replacement cost. Late fees are waived during the January stocktake. ## Deposits Power tools need a $40 deposit, paid at pickup. Deposits are refunded to your card within 5 working days of the tool coming back undamaged. ## Opening hours Wednesday 5 pm to 8 pm and Saturday 9 am to 1 pm. Closed on public holidays.
{
"file_path": "/app/notes/member-questions.md"
}# What members ask the bot Collected from the counter and the bot's chat logs, most common first. - How long can I keep a tool once I've borrowed it? - What's the late fee if I bring something back late? - How much does membership cost? - How far in advance can I reserve a tool? - I returned the pressure washer on Saturday. When do I get my deposit back? Someone at the counter said the bot told them the late fee was $7.50 a day.
{
"file_path": "/app/README.md"
}# Kestrel Row Tool Library help bot The chat bot on the library's website. Members ask it about borrowing, reservations, fees and deposits. - `bot/system.md`: the system prompt. - `bot/knowledge.md`: the member handbook the bot answers from. The volunteers update it each season; the bot gets it appended to the system prompt. - `bot/chat.sh`: ask the bot one question from a terminal. - `notes/`: what members ask, collected at the counter. The bot runs on `qwen3-coder-next` behind our llama-server (`http://localhost:8080/v1`, no key). To try it: ```bash bot/chat.sh "How long can I keep a tool?" ```
{
"file_path": "/app/bot/chat.sh"
}#!/usr/bin/env bash
# Ask the help bot one question from the command line:
# bot/chat.sh "How long can I keep a tool?"
# The bot is the system prompt with the handbook appended, sent to the OpenAI-compatible
# server BOT_ENDPOINT names (our llama-server by default).
set -euo pipefail
here=$(dirname "$0")
endpoint=${BOT_ENDPOINT:-http://localhost:8080/v1}
model=${BOT_MODEL:-qwen3-coder-next}
system="$(cat "$here/system.md")"$'\n\n'"$(cat "$here/knowledge.md")"
jq -n --arg m "$model" --arg s "$system" --arg q "$1" \
'{model: $m, messages: [{role: "system", content: $s}, {role: "user", content: $q}]}' \
| curl -fsS "$endpoint/chat/completions" -H 'Content-Type: application/json' -d @- \
| jq -r '.choices[0].message.content'
{
"file_path": "/app/auspex-exam.yaml",
"content": "name: tool-library-bot\ndescription: \"Auspex exam for Kestrel Row Tool Library help bot - verifies correct figures from handbook\"\n\nenvironment:\n BOT_ENDPOINT: http://localhost:8080/v1\n BOT_MODEL: qwen3-coder-next\n\nscenarios:\n - name: loan_period\n description: \"Verify bot gives correct 9-day loan period\"\n messages:\n - role: user\n content: \"How long can I keep a tool once I've borrowed it?\"\n checks:\n - type: string-contains\n expected: \"9 days\"\n - type: string-not-contains\n expected: \"7 days\"\n - type: string-not-contains\n expected: \"10 days\"\n\n - name: late_fee\n description: \"Verify bot gives correct $0.75/day late fee (NOT $7.50)\"\n messages:\n - role: user\n content: \"What's the late fee if I bring something back late?\"\n checks:\n - type: string-contains\n expected: \"$0.75\"\n hint: \"The correct late fee is 75 cents per day, not $7.50\"\n - type: string-not-contains\n expected: \"$7.50\"\n hint: \"This is 10x the correct amount - likely a typo\"\n\n - name: membership_cost\n description: \"Verify bot gives correct $12 annual membership\"\n messages:\n - role: user\n content: \"How much does membership cost?\"\n checks:\n - type: string-contains\n expected: \"$12\"\n - type: string-not-contains\n expected: \"$7\"\n\n - name: reservation_advance\n description: \"Verify bot gives correct 3-week reservation window\"\n messages:\n - role: user\n content: \"How far in advance can I reserve a tool?\"\n checks:\n - type: string-contains\n expected: \"3 weeks\"\n - type: string-not-contains\n expected: \"2 weeks\"\n - type: string-not-contains\n expected: \"4 weeks\"\n\n - name: deposit_amount\n description: \"Verify bot gives correct $40 power tool deposit\"\n messages:\n - role: user\n content: \"How much is the deposit for power tools?\"\n checks:\n - type: string-contains\n expected: \"$40\"\n - type: string-not-contains\n expected: \"$7\"\n\n - name: deposit_refund_days\n description: \"Verify bot gives correct 5 working days for deposit refund\"\n messages:\n - role: user\n content: \"I returned the pressure washer on Saturday. When do I get my deposit back?\"\n checks:\n - type: string-contains\n expected: \"5 working days\"\n - type: string-not-contains\n expected: \"7 days\"\n\n - name: opening_hours\n description: \"Verify bot gives correct opening hours (Wed 5-8, Sat 9-1)\"\n messages:\n - role: user\n content: \"What are the opening hours?\"\n checks:\n - type: string-contains\n expected: \"Wednesday\"\n - type: string-contains\n expected: \"5 pm\"\n - type: string-contains\n expected: \"8 pm\"\n - type: string-contains\n expected: \"Saturday\"\n - type: string-contains\n expected: \"9 am\"\n - type: string-contains\n expected: \"1 pm\"\n\n - name: max_tools\n description: \"Verify bot gives correct 4 tool limit\"\n messages:\n - role: user\n content: \"How many tools can I borrow at once?\"\n checks:\n - type: string-contains\n expected: \"4\"\n - type: string-not-contains\n expected: \"7\"\n\n - name: renewal_policy\n description: \"Verify bot mentions renewal is possible once\"\n messages:\n - role: user\n content: \"Can I renew my loan?\"\n checks:\n - type: string-contains\n expected: \"once\"\n - type: string-contains\n expected: \"renew\"\n\n - name: replacement_card\n description: \"Verify bot gives correct $2 replacement card fee\"\n messages:\n - role: user\n content: \"How much for a replacement membership card?\"\n checks:\n - type: string-contains\n expected: \"$2\"\n - type: string-not-contains\n expected: \"$7\"\n"
}Successfully created and wrote to new file: /app/auspex-exam.yaml.
{
"command": "cat << 'EOF' | python3 -c \"\nimport sys\n\n# Simulate wrong answer (what the bot was told)\nwrong_answer = 'The late fee is $7.50 a day for each tool.'\ncorrect_answer = 'The late fee is $0.75 a day for each tool.'\n\nchecks = [\n ('string-contains', '\\$0.75'),\n ('string-not-contains', '\\$7.50'),\n]\n\nprint('Testing WRONG answer ($7.50):')\nfor check_type, expected in checks:\n if check_type == 'string-contains':\n result = expected in wrong_answer\n status = 'PASS' if result else 'FAIL'\n print(f' Contains \\\"{expected}\\\": {status}')\n elif check_type == 'string-not-contains':\n result = expected not in wrong_answer\n status = 'PASS' if result else 'FAIL'\n print(f' Not contains \\\"{expected}\\\": {status}')\n\nprint()\nprint('Testing CORRECT answer ($0.75):')\nfor check_type, expected in checks:\n if check_type == 'string-contains':\n result = expected in correct_answer\n status = 'PASS' if result else 'FAIL'\n print(f' Contains \\\"{expected}\\\": {status}')\n elif check_type == 'string-not-contains':\n result = expected not in correct_answer\n status = 'PASS' if result else 'FAIL'\n print(f' Not contains \\\"{expected}\\\": {status}')\n\"\nEOF\n",
"description": "Test that the auspex exam checks would catch a $7.50 wrong answer vs pass a $0.75 correct answer",
"is_background": false
}{
"command": "echo \"Testing WRONG answer (\\$7.50):\"\nwrong_answer=\"The late fee is \\$7.50 a day for each tool.\"\nif echo \"$wrong_answer\" | grep -q '\\$0\\.75'; then\n echo \" Contains \\$0.75: PASS\"\nelse\n echo \" Contains \\$0.75: FAIL\"\nfi\nif echo \"$wrong_answer\" | grep -q '\\$7\\.50'; then\n echo \" Contains \\$7.50: FAIL (should not contain this)\"\nelse\n echo \" Contains \\$7.50: PASS\"\nfi\n\necho \"\"\necho \"Testing CORRECT answer (\\$0.75):\"\ncorrect_answer=\"The late fee is \\$0.75 a day for each tool.\"\nif echo \"$correct_answer\" | grep -q '\\$0\\.75'; then\n echo \" Contains \\$0.75: PASS\"\nelse\n echo \" Contains \\$0.75: FAIL\"\nfi\nif echo \"$correct_answer\" | grep -q '\\$7\\.50'; then\n echo \" Contains \\$7.50: FAIL (should not contain this)\"\nelse\n echo \" Contains \\$7.50: PASS\"\nfi",
"description": "Test auspex checks logic for late fee scenarios",
"is_background": false
}Command: echo "Testing WRONG answer (\$7.50):" wrong_answer="The late fee is \$7.50 a day for each tool." if echo "$wrong_answer" | grep -q '\$0\.75'; then echo " Contains \$0.75: PASS" else echo " Contains \$0.75: FAIL" fi if echo "$wrong_answer" | grep -q '\$7\.50'; then echo " Contains \$7.50: FAIL (should not contain this)" else echo " Contains \$7.50: PASS" fi echo "" echo "Testing CORRECT answer (\$0.75):" correct_answer="The late fee is \$0.75 a day for each tool." if echo "$correct_answer" | grep -q '\$0\.75'; then echo " Contains \$0.75: PASS" else echo " Contains \$0.75: FAIL" fi if echo "$correct_answer" | grep -q '\$7\.50'; then echo " Contains \$7.50: FAIL (should not contain this)" else echo " Contains \$7.50: PASS" fi Directory: (root) Output: Testing WRONG answer ($7.50): Contains $0.75: FAIL Contains $7.50: FAIL (should not contain this) Testing CORRECT answer ($0.75): Contains $0.75: PASS Contains $7.50: PASS Error: (none) Exit Code: 0 Signal: (none) Process Group PGID: (none)