Skip to content

feat(validate): a free_text answer must not also be a distractor (#237) - #238

Merged
astrapi69 merged 1 commit into
mainfrom
feat/freetext-disjoint
Oct 1, 2026
Merged

astrapi69 merged 1 commit into
mainfrom
feat/freetext-disjoint

Conversation

@astrapi69

Copy link
Copy Markdown
Owner

Closes #237.

Summary

New error E-FREETEXT-DISJOINT in src/rules.ts, the free_text counterpart of E-CLOZE-MS-DISJOINT.

  • What it catches: an accept entry that is also in distractors.
  • Comparison: after trimming, case-sensitive.
  • Params: shared lists the shared answers, each once.
  • Reported by: validateLesson and validateLessonRules (the /rules entry).

Case-sensitive because two exercises in the hub teach capitalisation with a distractor that differs only in case (I am Anna against i am Anna). The issue text wrote i am anna; the real distractor is i am Anna.

Docs

  • lesson-format.md:
    • the free_text section explains distractors and the rule;
    • the rule catalog and the issue-parameters table have the new id.
  • validation.md: the free_text row.
  • architecture.md: an open item. Engine side done; the template's audit drops its copy after the release and re-pin.
  • CHANGELOG: [Unreleased] entry.

Test plan

  • src/free-text-disjoint.test.ts: 9 tests, red before the change:
    • reproduction;
    • happy path, message and anchor, the /rules entry;
    • edge cases: no distractors, empty distractors, an entry repeated in accept;
    • boundaries: whitespace counts as the same entry, case does not.
  • src/issue-params.test.ts: a params case for the new id. The params-table gate was red until the docs listed it.
  • make release-check: 1759 tests passed.
  • make prose-check and npm run docs:api:check: green.
  • Measured with this build over the 632 lessons on origin/main of the eleven content repositories: 0 hits. An overlap seeded into a real lesson (adaptive-learner-content, ex-free-i-capital) is found at /steps/9/exercise.

🤖 Generated with Claude Code

New error E-FREETEXT-DISJOINT, the free_text counterpart of
E-CLOZE-MS-DISJOINT: an accept entry that is also in distractors,
compared after trimming and case-sensitively, with the shared answers
(each once) in params. The schema calls distractors the renderer's
fallback pool of wrong options, so a shared entry offers a correct
answer as a wrong one. The rule lived only in the content template's
advisory audit, outside CI.

Case-sensitive because two exercises in the hub teach capitalisation
with a distractor that differs only in case (I am Anna / i am Anna).

Measured with this build over the 632 lessons on origin/main of the
eleven content repositories: 0 hits; an overlap seeded into a real
lesson is found.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@astrapi69
astrapi69 merged commit 239a438 into main Oct 1, 2026
4 checks passed
@astrapi69
astrapi69 deleted the feat/freetext-disjoint branch October 1, 2026 11:22
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.

free_text: an accepted answer that is also a distractor (E-FREETEXT-DISJOINT)

2 participants