Repository navigation
Description
Needs your OK: this changes the drafts Magic Compose gives organizers (a worked example, the field type guide and one new sentence in its prompt). Swap pipeline:proposed for pipeline:ready to have it built.
What happens
In the owner's eval run on #1020, all three Magic Compose drafts for ev_048 (a fika list for the team's home matches, every Saturday from 24 April to 29 May 2027) added a text column filled with "Match 1" to "Match 6" or "Hemmamatch 1" to "Hemmamatch 6". Nothing in the prompt names the matches; the date already tells each family which Saturday is theirs. So the organizer gets a column they have to delete. The MCP tools, run on the same case, didn't do this.
It isn't a Swedish problem: the prompt says "hemmamatcher" without listing any, and the model numbers them. No check in ev_048 catches it, so the case passes.
The prompt teaches the pattern itself:
- Example B in
src/lib/magic-compose/prompt.ts("weekly snack roster, 6 dated games") has agametext column holding "Game 1" to "Game 6" beside the date. It is the prompt's only worked example of a plain date list, and it shows exactly this column. FIELD_TYPE_GUIDEinsrc/lib/signup-rules.tsgivesgame name "Game 1"as its first example of a text field.- Rule 1 names a
"game" textfield as a typical per-slot field.
The drafter's rules (neverInventRule('drafter')) forbid inventing dates, opponents and schedules, but say nothing about a column whose values are just a counter.
Fix, in outline
- Pin it in the eval. Add two checks to
ev_048inevals/magic-compose/dev-evals.json:"fields.labels_must_not_match_any": ["match"]and"must_not_exceed_limits": { "max_fields": 2 }(the date, and at most one "what to bring" text field). Say why in itsrationale. - Test the checks in the
ev_048block ofscripts/lib/eval-harness.test.ts. The existing right reply still passes, and so does the same rota with a "Fika" text column beside the date. The rota with a "Hemmamatch" column ("Hemmamatch 1" to "Hemmamatch 6") and a "Fika" column fails exactlyfields.labels_must_not_match_anyandmust_not_exceed_limits. - Fix Example B. Drop the
gamefield and its values, so the example has one field,date, and six slots of{ "date": … }with capacity 2.groupBystaysnull(a pure date list). The heading becomes "Example B — weekly snack roster, 6 dated games, so the date alone tells them apart:". The title, description and user text stay as they are. - Fix the guide. In
FIELD_TYPE_GUIDE, the text bullet becomes- text → free-form short labels (opponent "Hawks", item "Snack + drinks"). - Fix rule 1's example.
("class" enum, "game" text, "time" value)becomes("class" enum, "opponent" text, "time" value), so no example in the prompt pairs games with a column named after them. - Tell the drafter. After "See Example F." in the prompt's DATES AND TIMES line, add:
Don't add a column whose values only count the rows ("Game 1", "Shift 2") when a date or time already tells them apart: see Example B.It goes inprompt.tsitself, not insignup-rules.ts. - Regenerate the golden file. Write the new render over
src/lib/magic-compose/__golden__/system-prompt.txt:buildMessages('x', { now: new Date('2026-05-15T00:00:00Z'), fallbackLocale: 'en' })[0].content, as the golden test inprompt.test.tsreads it.vitest -ucan't rewrite it. - Docs. In
evals/magic-compose/README.md, the Swedish line under regression targets (ev_046–ev_050) adds "with no column that only numbers the Saturdays". A CHANGELOG line under Changed says Magic Compose no longer adds a column that only numbers dated rows.
Watch for
- The MCP side doesn't change.
FIELD_TYPE_GUIDElives insignup-rules.tsbut isn't inRULES_IN_BOTH, andsrc/mcp/instructions.tsdoesn't use it. So the MCP instructions, their 2048-byte limit and the word-for-wordRULES_IN_BOTHtests are untouched.signup-rules.test.tsonly checks the guide has a bullet per field type, which still holds. - Placeholders are different. Rule 4 tells the drafter to write "TBD: game 1" labels when dates are missing. The new sentence must not stop those: they're the slot's only value, with no date beside them. That's why the sentence says "when a date or time already tells them apart". Leave rule 4's wording alone.
- The label check matches inside words.
labels_must_not_match_anyis a substring check, so it catches "Hemmamatch", but it would also fail a date column labelled "Matchdag" or "Matchdatum". The test's right reply labels its date "Datum". If the owner's eval run shows a date field failing on its label, loosen the case, not the prompt. - Worked examples and evals.
prompt.test.tsfails if a worked example's user text, or a quotede.g., holds an eval case's prompt. Example B's user text doesn't change, and the new sentence has noe.g.. Its examples are "Game 1" and "Shift 2", not "Match", soev_048still measures the rule, not recall of the word it failed on. - The build can't run the evals. Pipeline sessions have no
LLM_*settings. The builder adds the checks and runs the offline tests (pnpm testincludesscripts/lib/eval-harness.test.tsand the golden test). The PR asks the owner to runpnpm eval:magic-compose(the whole set, not just--tag=swedish, since Example B and the guide reach every case) andpnpm eval:mcp --case=ev_048(its checks change, andeval:mcpruns it) before merging, so the PR waits atpipeline:owner. CLAUDE.md says editing a rule insignup-rules.tsmeans an eval run; this is that run.
Choices this makes
- Fix what teaches it, and add the rule. Default: change Example B, the guide and rule 1's example, and add the sentence, plus the eval checks. The examples are what the model copies; the sentence says why. Edit this to "examples only" if you'd rather see whether fixing Example B alone is enough.
- Drafter only. Default: the sentence goes in the Magic Compose prompt, not in
signup-rules.tsor the MCP instructions, which are near their byte budget and already behave on this case. - "Game 1" and "Shift 2" as the sentence's examples, not "Match 1": close to the failure without naming it.
Done when
ev_048fails a draft with a "Hemmamatch" column and a third field, and theev_048block inscripts/lib/eval-harness.test.tsshows it, with the right reply and the date-plus-Fika reply still passing.- Example B has only a date field, the guide's text bullet and rule 1 no longer name a game column, and the prompt has the new sentence. The golden file matches.
pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm testpass.- The PR body asks the owner to run
pnpm eval:magic-composeandpnpm eval:mcp --case=ev_048before merging, and says the golden file was rewritten for the new prompt.
From the owner's eval-run comment on #1020, checked against ev_048 on that branch and src/lib/signup-rules.ts at 7acf0fa. https://claude.ai/code/session_016YZ9SVJQ59MJzrJtGaSUDD
Revised against main at d8787e9: the prompt's own Example B, field type guide and rule 1 taught the counter column, so they change too, and #1020 has merged. https://claude.ai/code/session_016YZ9SVTB9qLweVn9KzZpdf
Activity
richshaw commentedon Nov 18, 2026
Revised the brief against
mainat d8787e9 so it can be approved as written:gamecolumn of "Game 1" to "Game 6", the field type guide's text example isgame name "Game 1", and rule 1 names a"game" textfield. The planned sentence would have contradicted all three, so the brief now drops the column from Example B, changes the guide's example to opponent "Hawks", and makes rule 1's example"opponent" text. The new sentence is spelled out exactly and says "when a date or time already tells them apart", so "TBD: game 1" placeholders are untouched.FIELD_TYPE_GUIDEisn't inRULES_IN_BOTHand the MCP instructions don't use it, so the MCP side and its 2048-byte limit don't change. The brief says how to rewrite the golden prompt file, whichvitest -ucan't do.pnpm eval:magic-compose(the whole set, since Example B reaches every case) andpnpm eval:mcp --case=ev_048before merging.https://claude.ai/code/session_016YZ9SVTB9qLweVn9KzZpdf
Generated by Claude Code