Skip to content

chore: retire the authoring choice between text and image for AI evaluation (CLUE-371) - #2993

Merged
emcelroy merged 2 commits into
masterfrom
CLUE-371-retire-summarizer-setting
Sep 3, 2026
Merged

emcelroy merged 2 commits into
masterfrom
CLUE-371-retire-summarizer-setting

Conversation

@emcelroy

@emcelroy emcelroy commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

CLUE-371

Follows: #2988 (CLUE-371-ai-feedback-text-and-images), already merged to master

What this changes

Curriculum authors could choose what got sent to the AI for evaluation: a text summary of the document, or a screenshot of it. The choice was stored as aiPrompt.summarizer and shown on the AI Settings authoring page as a select labelled "Format Of Content Sent To AI".

That choice no longer means anything. Every evaluation now sends both representations, and the document's own content decides which of the two actually go. The analysis functions stopped reading aiPrompt.summarizer in #2988. This removes the authoring control that still wrote it, along with the Summarizer type and the summarizers list that described it as meaningful.

What is kept

aiPrompt.summarizer is still accepted in stored configuration and ignored. Published unit JSON in the wild carries it, and those units have to keep loading. The field stays declared in two places — IAiPrompt in the authoring types and AIPromptModel in the unit configuration — demoted to a plain string in both, with a comment saying it is ignored.

The property is dropped from a unit's configuration the next time an author saves the AI Settings form. Each authoring page writes the configuration through its own updater, so saving a different page leaves the property in place. This is opportunistic cleanup, not a migration.

Testing

New file: src/authoring/components/workspace/ai-settings.test.tsx. The AI Settings form had no test file; this follows the four sibling forms in the same directory. Four cases, covering the behavior most likely to regress:

  • the format select is absent from the rendered form
  • submitting with a pre-existing aiPrompt that has summarizer deletes the property
  • every other aiPrompt field survives that submit unchanged
  • submitting when the config had no aiPrompt creates one without summarizer

All four fail against the pre-change component, so they are testing what they claim to.

npm test, npm run lint, npm run build, and npm run check:types all pass.

Verified by hand rather than by test

The tests above mock the persistence layer, so the save path was also checked end to end in the real authoring app, running against local Firebase emulators (Realtime Database, Auth, and the authoring-api function).

A unit whose aiPrompt carried summarizer: "text" alongside all five prompt fields was loaded on the AI Settings page. The form rendered with no errors, the format select was gone — the only select left is "AI Evaluation Method" — and all five prompt fields showed their stored values. After saving, the stored configuration had lost summarizer and kept every other field.

One thing to know if you repeat that check: saving this form also writes showIdeasButton and rewrites aiPrompt.categories from the unit's commentTags. Both are pre-existing behavior of the form, unchanged by this PR.

Not in scope

Removing summarizer from the stored configuration format or from the MST model; the mixed-mode pipeline itself; staging verification and rollout; Cypress coverage of the authoring forms.

@codecov

codecov Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.40%. Comparing base (5831947) to head (37e031a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2993   +/-   ##
=======================================
  Coverage   86.40%   86.40%           
=======================================
  Files        1001     1002    +1     
  Lines       57023    57098   +75     
  Branches    15129    15165   +36     
=======================================
+ Hits        49268    49333   +65     
- Misses       7735     7745   +10     
  Partials       20       20           
Flag Coverage Δ
cypress-regression 71.16% <ø> (ø)
cypress-smoke 41.16% <ø> (-0.03%) ⬇️
jest 57.91% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cypress

cypress Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

collaborative-learning    Run #20239

Run Properties:  status check passed Passed #20239  •  git commit 37e031a3ac: Merge branch 'master' into CLUE-371-retire-summarizer-setting
Project collaborative-learning
Branch Review CLUE-371-retire-summarizer-setting
Run status status check passed Passed #20239
Run duration 03m 38s
Commit git commit 37e031a3ac: Merge branch 'master' into CLUE-371-retire-summarizer-setting
Committer Ethan McElroy
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
View all changes introduced in this branch ↗︎

Curriculum authors could choose what got sent to the AI for evaluation: a
text summary of the document or a screenshot of it. That choice was stored
as aiPrompt.summarizer and shown in the authoring app as a select labelled
"Format Of Content Sent To AI". Every evaluation now sends both
representations and the document's own content decides which ones go, so
the analysis functions no longer read the setting and the select no longer
means anything. Remove it.

aiPrompt.summarizer is still accepted in stored configuration and ignored.
Published unit JSON in the wild carries it, and those units must keep
loading. The field stays declared on IAiPrompt and on AIPromptModel, in
both cases demoted to a plain string and commented as ignored. Saving the
AI Settings form now drops the property from the unit's configuration.
Each authoring page writes the configuration through its own updater, so
saving a different page leaves it in place.

Add a test file for the AI Settings form, which had none. Its four cases
cover the behaviour most likely to regress: the select is absent, saving
deletes the property, saving leaves the other aiPrompt fields alone, and
saving a config that had no aiPrompt creates one without the property.

This must not merge before the mixed-mode change
(CLUE-371-ai-feedback-text-and-images), and must not reach a production
release before those functions are deployed. Until they are, an author who
saved this form would drop the property and the old function would fall
back to its "image" default, silently turning a text-only custom unit into
an image-only one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@emcelroy
emcelroy force-pushed the CLUE-371-retire-summarizer-setting branch from 75b028a to 6b90407 Compare September 2, 2026 01:48
@emcelroy
emcelroy requested a balanced review from Copilot September 2, 2026 01:51

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.

🟢 Approval recommended

The focused compatibility-preserving cleanup is complete and adequately tested.

Pull request overview

Removes the obsolete AI content-format authoring choice while preserving compatibility with legacy unit configurations.

Changes:

  • Removes the summarizer selector and associated types.
  • Deletes legacy summarizer values when AI Settings are saved.
  • Adds regression coverage for rendering and configuration cleanup.
File summaries
File Description
src/models/stores/unit-configuration.ts Documents legacy model compatibility.
src/authoring/types.ts Retires the constrained summarizer type.
src/authoring/components/workspace/ai-settings.tsx Removes the control and cleans saved configuration.
src/authoring/components/workspace/ai-settings.test.tsx Tests removal and cleanup behavior.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@emcelroy
emcelroy marked this pull request as ready for review September 2, 2026 02:14
@emcelroy
emcelroy requested a review from scytacki September 2, 2026 02:14

@scytacki scytacki left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good

@emcelroy
emcelroy merged commit b251be4 into master Sep 3, 2026
28 checks passed
@emcelroy
emcelroy deleted the CLUE-371-retire-summarizer-setting branch September 3, 2026 01:54

This branch was previously deployed

1 inactive deployment
development — 37e031a3 Deployed Sep 3, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants