Skip to content

Add a corpus run that asks the model and grades its answers - #2

Merged
novgar21 merged 4 commits into
mainfrom
corpus-run
Nov 1, 2026
Merged

novgar21 merged 4 commits into
mainfrom
corpus-run

Conversation

@novgar21

@novgar21 novgar21 commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Until now the corpus was graded only by hand: someone had to ask the model, save the answer and run tests/grade.py. This adds a run that does it on its own, and fixes two checks that failed correct Turkmen.

What changes

  • tests/run_corpus.py sends each case of tests/corpus/ to the model, with SKILL.md and every file of references/ as instructions (or prompts/system-prompt.md plus references/ with --variant prompt). The finished text is taken from between <<<TEXT and TEXT>>> markers, so the list of changes after it is not graded, then checked with grade.py.
  • Each case runs 3 times; it passes when at least 2 answers pass every check. Requests go out 6 at a time (--jobs). Answers and a report (report.md, report.json) go to corpus-results/, and the report also goes to the job summary. --print-failed prints the text of each failed answer to the log.
  • If the API stops answering (a bad key, no credit), the script stops with code 2 and still writes the report for the answers it has.
  • --answers DIR grades saved answers without the API, --dry-run shows what would be sent, --case a,b runs only some cases.
  • .github/workflows/corpus.yml runs it by hand only (Actions > Corpus run > Run workflow, with variant, number of runs and cases as inputs), because one full run costs about 8 USD. It uses the ANTHROPIC_API_KEY secret.
  • AGENTS.md explains when to run it.

Grader fixes

  • In must_keep, a count from 2 to 9 may be written in digits or in words, with or without sany: üç täze seýilgäh now also accepts 3 täze seýilgäh and 3 sany täze seýilgäh.
  • An entry that starts with re: is a regular expression. The için entries of seven cases are now re:\bi[cç]in\b, so the Turkish için is still caught but the Turkmen içinde is not.

First run

Run on this branch before the grader fixes: 6 of 11 cases pass, in about 10 minutes. Tokens: 87,732 input, 1,478,433 cache read, 384,724 output, about 8.3 USD, almost all of it output.

Case Passed
haly-ocerk 2 / 3
hasabat-yazgysy 2 / 3
hunar-gollanma 0 / 3
kitaphana-habary 0 / 3
olimpiada-habary 3 / 3
sanly-mekdep-makala 2 / 3
sport-toplumy-terjime 2 / 3
terjime-mary 0 / 3
uly-hasabat 1 / 3
welosiped-post 0 / 3
yoremek-post 3 / 3

Failures that look real, for a follow-up change to the skill: kompýuteri oturdyldy in all three kitaphana-habary answers, ** bold in the hunar-gollanma guide, lost numbers in the terjime-mary translation.

Checks

  • npm test: 64 tests pass (55 before).
  • python3 scripts/validate-package.py: valid.

@novgar21 novgar21 self-assigned this Nov 1, 2026
@novgar21
novgar21 merged commit 93a2fb4 into main Nov 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant