Skip to content

Magic Compose adds a column that only numbers the rows ("Match 1" to "Match 6") to a plain date list #1029

Open

Description

@richshaw

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 a game text 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_GUIDE in src/lib/signup-rules.ts gives game name "Game 1" as its first example of a text field.
  • Rule 1 names a "game" text field 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_048 in evals/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 its rationale.
  • Test the checks in the ev_048 block of scripts/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 exactly fields.labels_must_not_match_any and must_not_exceed_limits.
  • Fix Example B. Drop the game field and its values, so the example has one field, date, and six slots of { "date": … } with capacity 2. groupBy stays null (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 in prompt.ts itself, not in signup-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 in prompt.test.ts reads it. vitest -u can'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_GUIDE lives in signup-rules.ts but isn't in RULES_IN_BOTH, and src/mcp/instructions.ts doesn't use it. So the MCP instructions, their 2048-byte limit and the word-for-word RULES_IN_BOTH tests are untouched. signup-rules.test.ts only 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_any is 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.ts fails if a worked example's user text, or a quoted e.g., holds an eval case's prompt. Example B's user text doesn't change, and the new sentence has no e.g.. Its examples are "Game 1" and "Shift 2", not "Match", so ev_048 still 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 test includes scripts/lib/eval-harness.test.ts and the golden test). The PR asks the owner to run pnpm eval:magic-compose (the whole set, not just --tag=swedish, since Example B and the guide reach every case) and pnpm eval:mcp --case=ev_048 (its checks change, and eval:mcp runs it) before merging, so the PR waits at pipeline:owner. CLAUDE.md says editing a rule in signup-rules.ts means 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.ts or 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_048 fails a draft with a "Hemmamatch" column and a third field, and the ev_048 block in scripts/lib/eval-harness.test.ts shows 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 test pass.
  • The PR body asks the owner to run pnpm eval:magic-compose and pnpm eval:mcp --case=ev_048 before 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

  1. added
    enhancement
    pipeline:ux
    on Nov 17, 2026
  2. richshaw commented on Nov 18, 2026

    @richshaw
    OwnerAuthor

    Revised the brief against main at d8787e9 so it can be approved as written:

    • The prompt was teaching the counter column. Example B (the only worked date list) has a game column of "Game 1" to "Game 6", the field type guide's text example is game name "Game 1", and rule 1 names a "game" text field. 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.
    • Shared-rules machinery spelled out. FIELD_TYPE_GUIDE isn't in RULES_IN_BOTH and 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, which vitest -u can't do.
    • Evals. The build has no LLM keys, so the builder adds the checks and runs the offline tests. The PR asks you to run pnpm eval:magic-compose (the whole set, since Example B reaches every case) and pnpm eval:mcp --case=ev_048 before merging.
    • The eval checks are kept, with the test made exact. A right reply with a "Fika" column passes, and a reply with "Hemmamatch" and "Fika" columns fails exactly the two new checks. Watch for now notes that the "match" label check would also catch a date column labelled "Matchdag".
    • Order removed. Add five Swedish Magic Compose eval cases #1020 has merged, so nothing blocks this.

    https://claude.ai/code/session_016YZ9SVTB9qLweVn9KzZpdf


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpipeline:proposedpipeline:ux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions