Skip to content

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

Closed
novgar21 wants to merge 1 commit into
mainfrom
claude/project-thread-hlmamd
Closed

novgar21 wants to merge 1 commit into
mainfrom
claude/project-thread-hlmamd

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.

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. Answers and a report (report.md, report.json) go to corpus-results/, and the report also goes to the job summary.
  • --answers DIR grades saved answers without the API, --dry-run shows what would be sent.
  • .github/workflows/corpus.yml runs it on pull requests that touch SKILL.md, references/, prompts/, the checker or the corpus, and by hand (variant and number of runs as inputs). It uses the ANTHROPIC_API_KEY secret and skips forks.
  • tests/test_run_corpus.py: 5 tests for the marker parsing, the prompt build and the saved-answers mode. Reference answers pass; inputs fail.
  • AGENTS.md explains when to run it.

Checks

  • npm test: 60 tests pass (55 before).
  • python3 scripts/validate-package.py: valid.
  • The real model run is this PR's own Corpus run job, since it touches tests/run_corpus.py.

Cost: one run of 11 cases × 3 answers with prompt caching is estimated at a few dollars; the report prints the token counts.

@novgar21 novgar21 self-assigned this Nov 1, 2026
@novgar21 novgar21 closed this Nov 1, 2026
@novgar21
novgar21 deleted the claude/project-thread-hlmamd branch November 1, 2026 10:08
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