Skip to content

Add five Swedish Magic Compose eval cases - #1020

Merged
richshaw merged 4 commits into
mainfrom
claude/issue-993-swedish-evals
Nov 17, 2026
Merged

richshaw merged 4 commits into
mainfrom
claude/issue-993-swedish-evals

Conversation

@richshaw

Copy link
Copy Markdown
Owner

Fixes #993.

The problem

dev-evals.json had one Swedish case (ev_042), a Swedish description from an organizer with no language set. Nothing covered an organizer whose language is Swedish, Swedish dates and times, Swedish column names, the questions flow in Swedish, or an English description that only mentions Swedish words. Magic Compose's output varies by run and model, so this needs eval cases rather than a review.

The fix

Five cases in evals/magic-compose/dev-evals.json, all tagged swedish (pnpm eval:magic-compose --tag=swedish), using checks the harness already has:

  • ev_046 A Swedish organizer's knytkalas (organizerLanguage: sv): Saturday 11 December 2027, "kl. 11–14", 2 salads, 3 mains, bread, dessert. Expects Swedish, a date field, no English column names (item, date, time), 11:00, one slot per dish with its count as capacity, and no am/pm or 02:00 anywhere in the output (a 12-hour reading of "14").
  • ev_047 Volunteer shifts: "tre pass på 2 timmar varje dag, två volontärer per pass" over two days, 10–16. Expects 6 slots of capacity 2 at 10:00, 12:00 and 14:00 on both dates.
  • ev_048 A fika list over a range of Saturdays: "alla lördagar från 24 april till 29 maj 2027". Expects the six Saturdays exactly, one family each, no groupBy.
  • ev_049 Too vague to draft (organizerLanguage: sv): "Fikalista till klassen". Like ev_040 ("Snack sign up"), expects questions about when, not what, with an option naming fika and none in English.
  • ev_050 An English description naming Swedish things (organizerLanguage: sv): a midsommar picnic with sill. Expects an English draft that keeps sill, even though the organizer's language is Swedish.

Every date the cases expect is written in the prompt with its year; I checked each weekday.

The evals README now says 50 cases and lists the new ones under regression targets.

Decisions the issue didn't make

  • ev_049 checks words, not language_must_be. The likely reply is a single option, "Fika", which holds no marker word of any language, so language_must_be: sv would fail a right answer. It checks that an option names fika (fika, fikat, fikabröd) and none uses English (snack, coffee, bring, …) instead. I added no marker words.
  • ev_050 sets organizerLanguage: sv. With an English organizer the case would pass whatever the language rule said; a Swedish organizer is what tests that the description's language wins. That means eval:mcp skips it, as it does ev_045.
  • ev_047 and ev_048 set no organizerLanguage, so eval:mcp runs them and shows whether a connected assistant handles Swedish shifts and date ranges too.

Tests

  • scripts/lib/eval-harness.test.ts gains a block for ev_046–ev_050. For each case, a plausible right reply passes every check, and a wrong one fails exactly the checks it should: English column names, then "11am to 2pm" (ev_046); a row per volunteer (ev_047); a missing 1 May (ev_048); English options, and a draft instead of questions (ev_049); a Swedish draft that translated the items (ev_050). It also pins which cases set organizerLanguage.
  • prompt.test.ts reads the file and still passes, so no prompt repeats a worked example.
  • Ran and passed: pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test (244 files, 3473 tests).

Before merging

The evals have not been run. The issue asks for one run on the default model with each new case's result in the PR, but this session has no LLM_* settings. Please run pnpm eval:magic-compose --tag=swedish (and pnpm eval:mcp --tag=swedish, which runs ev_047 and ev_048) and post or paste the results. A case that fails on a reasonable draft points at the case, not the model, and is worth a follow-up.

https://claude.ai/code/session_016YZ9SWUV56YS8FjT8Ki8XH


Generated by Claude Code

ev_046 to ev_050 cover what the one Swedish case didn't: an organizer
whose language is Swedish, Swedish dates and 24-hour times, Swedish
column names, Swedish shifts and a range of Saturdays, the questions
flow in Swedish, and an English description that only names Swedish
things. Harness tests check that a right reply passes each case and a
wrong one fails the check it should.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SWUV56YS8FjT8Ki8XH
@richshaw richshaw added the pipeline:working A session is working on it right now label Nov 16, 2026 — with Claude
@richshaw
richshaw requested a balanced review from Copilot November 16, 2026 21:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@richshaw richshaw added pipeline:tophat pipeline:working A session is working on it right now and removed pipeline:working A session is working on it right now labels Nov 16, 2026 — with Claude

Copy link
Copy Markdown
Owner Author

Tophat: passed

Ran 1540950 locally. The PR changes only eval data (evals/magic-compose/dev-evals.json and its README) and a test file (scripts/lib/eval-harness.test.ts). No page, email, route or job changes, so there was nothing to click through. I ran the affected tests and checked the data instead.

Check Result What I saw
Harness, prompt and MCP-eval tests (scripts/lib/eval-harness.test.ts, src/lib/magic-compose/prompt.test.ts, src/mcp/evals) ✅ 4 files, 127 tests passed
The eval file parses, with 50 cases and no duplicate ids ✅ 50 cases. The swedish tag picks exactly ev_046 to ev_050
Every date a case expects falls on the weekday its prompt names ✅ 2027-12-11 is a Saturday; 2027-04-17 and 2027-04-18 are Saturday and Sunday; 2027-04-24 to 2027-05-29 are six Saturdays; 2027-06-26 is a Saturday
Prettier on the changed files ✅ Clean
pnpm eval:magic-compose --tag=swedish ⚠️ not run This session has no LLM_* settings. The PR's "Before merging" note still applies: the owner needs to run the evals and post the results

Nothing a person using OpenSignup sees changes, so this isn't UX. Because the PR asks the owner to run the evals before merging, it still stops at the owner.

No screenshots: nothing on screen changed. Session: https://claude.ai/code/session_016YZ9SV8FdFSdeSj5SQ43Fd


Generated by Claude Code

@richshaw richshaw added pipeline:review pipeline:working A session is working on it right now and removed pipeline:tophat pipeline:working A session is working on it right now labels Nov 16, 2026 — with Claude

@richshaw richshaw left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: passed (round 1)

The PR adds the five Swedish Magic Compose eval cases #993 outlines (ev_046 to ev_050, tag swedish) and uses only checks the harness already has. It also adds a test block that runs a plausible right reply and a wrong one through each case. I checked how each new expectation is evaluated in scripts/lib/eval-harness.ts. Label and slot-value checks are loose, case-insensitive substring matches, and the option checks match whole words. raw_output_must_not_match_patterns runs against JSON.stringify of the parsed reply. A quick check confirmed that "0?2:00" matches a "02:00" value and doesn't match "12:00" or "14:00". It also confirmed that the am/pm pattern catches "2 pm". The expected dates fall on the weekdays the prompts name (the tophat checked this too), and organizerLanguage is set only where a case needs it, which the test block pins.

Blocking (0): none.
Optional (2):

  • scripts/lib/eval-harness.test.ts:530: the ev_046 wrong-reply test exercises the am/pm pattern but not "0?2:00". Adding a slot whose tid is 02:00 would prove the second pattern catches a 12-hour reading too.
  • evals/magic-compose/dev-evals.json:893: questions.options_must_mention_any matches whole words, so fikat and fikabröd add something beyond fika. Fine as is.
    Earlier threads: none. Copilot couldn't review because its quota is used up.
    Checks: CI is green on 1540950 (lint-type-test, e2e, CodeQL). The tophat passed on this same SHA, with no runtime code changed since. I ran the regex check above locally.

Why it waits for the owner: the PR's "Before merging" section asks you to run pnpm eval:magic-compose --tag=swedish and pnpm eval:mcp --tag=swedish. #993's "Done when" needs one run on the default model in the PR, and pipeline sessions have no LLM_* settings. Please post the per-case results. A case that fails on a reasonable draft points at the case, not the model. Nothing a person using OpenSignup sees changes, so this isn't UX.

https://claude.ai/code/session_016YZ9SSzefoeQzGxKJcBDEa


Generated by Claude Code

@richshaw richshaw added pipeline:owner Passed; waits for the owner (UX or high-risk) and removed pipeline:review pipeline:working A session is working on it right now labels Nov 16, 2026 — with Claude
@richshaw

Copy link
Copy Markdown
Owner Author

Evals: all five Swedish cases pass

Ran on 1081920 (the head after the main merge; since the review at 1540950, that merge changed only two test files under src/mcp). Default model ~google/gemini-flash-latest via OpenRouter. Three runs each instead of one, because output varies between runs.

pnpm eval:magic-compose --tag=swedish     # 3 runs
pnpm eval:mcp --tag=swedish               # 3 runs (runs ev_047 and ev_048; skips the three cases with organizerLanguage, by design)
Case Magic Compose MCP What the model did
ev_046 knytkalas, Swedish organizer ✅ 3/3 skipped Swedish columns (Att ta med / Rätt, Datum, Tid), 2027-12-11 at 11:00, Sallad 2, Varmrätt 3, Bröd 1, Efterrätt 1. No am/pm or 02:00 anywhere.
ev_047 loppis volunteer shifts ✅ 3/3 ✅ 3/3 6 slots, capacity 2, at 10:00 / 12:00 / 14:00 on both days. Columns Datum + Starttid (MCP also adds Sluttid with the right end times).
ev_048 fika over a range of Saturdays ✅ 3/3 ✅ 3/3 Exactly the six Saturdays 24 Apr to 29 May, capacity 1, no groupBy.
ev_049 "Fikalista till klassen" ✅ 3/3 skipped Asks about when and how_many, never what. Option: "Ta med fika till klassen" (2 runs) or "Ta med fika" (1 run).
ev_050 midsommar picnic, English ✅ 3/3 skipped English draft (Item, Date, Time) with Sill, New potatoes, Strawberries and Drinks at 13:00, capacity 2 each.

Totals: Magic Compose 15/15 cases (96 checks, 0 failed); MCP 6/6 (36 checks, 0 failed). No LLM or parse errors.

A pointless column the checks don't catch (not blocking): in all three Magic Compose runs of ev_048, the draft adds a Match text column filled with "Match 1" to "Match 6" or "Hemmamatch 1" to "Hemmamatch 6". Nothing in it comes from the prompt, and the date already tells families which match is theirs, so it's a column the organizer would have to delete. MCP didn't do this: it used no extra column, or one that says "Ta med fika till kiosken". It isn't a Swedish problem (the prompt just says "hemmamatcher" without listing any), and a check for it would go beyond this PR, but it may be worth a follow-up.

Caveat: this was only the default model. Flash already follows most rules without help, so these cases pass here as regression guards. They don't yet show how weaker or open-weight models handle Swedish.

@richshaw richshaw added pipeline:fix and removed pipeline:owner Passed; waits for the owner (UX or high-risk) labels Nov 17, 2026
@richshaw richshaw added the pipeline:working A session is working on it right now label Nov 17, 2026 — with Claude

Copy link
Copy Markdown
Owner Author

Address: nothing to change in this PR

Thanks for the eval run. All five cases pass, so that covers the "Before merging" request and #993's "Done when".

https://claude.ai/code/session_016YZ9SVJQ59MJzrJtGaSUDD


Generated by Claude Code

@richshaw richshaw added pipeline:owner Passed; waits for the owner (UX or high-risk) and removed pipeline:fix pipeline:working A session is working on it right now labels Nov 17, 2026 — with Claude
@richshaw richshaw added pipeline:merge and removed pipeline:owner Passed; waits for the owner (UX or high-risk) labels Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Approved by the owner at 1081920.

The branch is behind main, so I've updated it; it merges once CI passes on the new head.

https://claude.ai/code/session_016YZ9SSnMjoyJ4iWMXTbyJg


Generated by Claude Code

@richshaw richshaw added the pipeline:working A session is working on it right now label Nov 17, 2026 — with Claude
@richshaw richshaw added pipeline:working A session is working on it right now and removed pipeline:working A session is working on it right now labels Nov 17, 2026 — with Claude

Copy link
Copy Markdown
Owner Author

Approved by the owner at 83c1465. The approval at 1081920 carries over: the only commits since are merges from main. CI is green on this head, so I'm merging it now.

https://claude.ai/code/session_016YZ9SVevLZEeujMHvBCKMc


Generated by Claude Code

@richshaw
richshaw merged commit 70475a5 into main Nov 17, 2026
5 checks passed
@richshaw
richshaw deleted the claude/issue-993-swedish-evals branch November 17, 2026 04:24
@richshaw richshaw removed pipeline:merge pipeline:working A session is working on it right now labels Nov 17, 2026 — with Claude
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.

Magic Compose has one Swedish eval case

3 participants