core/learning/prereq_gap_parser library

Extract [PREREQUISITE_GAP: concept_name] tags emitted by the tutor.

The Socratic mode prompt instructs the model to flag prerequisite gaps inline with this exact tag (see providers.dart _buildSystemPrompt and the server's prompts.ts). The parser strips them from the text the user sees and surfaces the concept names so the UI can offer a "review prerequisite first" nudge.

Tag grammar: [PREREQUISITE_GAP: <concept name>]

  • Concept name is everything until the closing ].
  • Tag is case-sensitive (matches the prompt instruction).
  • Multiple tags per response are supported; duplicates are deduped (preserving first occurrence order).

Classes

PrereqGapParseResult
Result of parsing a single assistant message.

Functions

parsePrereqGaps(String text) PrereqGapParseResult