Skip to content

feat(elos): pedagogical base, cited course questions, private answer keys - #27

Merged
eulogep merged 2 commits into
mainfrom
feat/pedagogical-base
Oct 23, 2026
Merged

eulogep merged 2 commits into
mainfrom
feat/pedagogical-base

Conversation

@eulogep

@eulogep eulogep commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • pedagogical-base.ts: parses a schema 1.0 export (courses/exercises/flashcards) into a course map kept as DERIVED_MATERIAL; answers shipped inside questions are stripped.
  • Quality audit: blocks MCQs whose correct option is almost always the longest or whose distractors are generic and reused; blocks flashcard sets with duplicated backs; flags template prompts, copy-pasted definitions, unsourced exercises, broken links, missing answers.
  • MCP: elos_course_map and elos_course_exercise (statement first, solution only after the learner's answer; audited-out MCQs never served), configured with ELOS_BASE_DIR.
  • Studio: "Base pédagogique (programme)" panel; only the course map and the audit are stored on the device.

Test plan

  • Unit tests with synthetic fixtures (parser, audit, MCP tools via in-memory client)
  • npm run lint, npx tsc --noEmit, full npm run test:ci
  • Studio panel driven in Chrome with synthetic files (import, audit, chapter details, persistence)

🤖 Generated with Claude Code

Course map (objectives, prerequisites, example, analogy, frequent
mistakes) from a schema 1.0 export, kept as DERIVED_MATERIAL. Answer
keys stay apart from questions, and an audit blocks guessable MCQs
(longest option correct, reused distractors) and copy-pasted
flashcards. New MCP tools elos_course_map and elos_course_exercise
(solution only after the learner's attempt); Studio import panel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
daily-english-mission Ready Ready Preview Oct 23, 2026 11:49am UTC

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 04e641ab-fa67-4dd9-9ac7-e0be01281614
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T11:36:47.625486Z 27eaed6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27eaed615c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +195 to +196
return base.exercises.filter((exercise) => exercise.chapterId === chapterId && base.answerKey.has(exercise.id)
&& (exercise.options.length >= 2 ? report.usable.mcq : report.usable.openExercises));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exclude unsourced exercises from practice

When an exercise has an empty sourceIds array, this predicate still admits it as long as an answer exists and its exercise category is globally usable. This contradicts the import contract in docs/integrations/HERMES.md:35-37, which says exercises without sources are discarded, and lets elos_course_exercise serve generated prompts that cannot be checked against course material. Filter these exercises out individually rather than merely reporting UNSOURCED_EXERCISES as a warning.

Useful? React with 👍 / 👎.

Comment thread mcp/elos-server.ts
server.registerTool("elos_course_map", {
title: "Course map of the learner's programme",
description: `Subjects and chapters of the learner's programme from the pedagogical base (ELOS_BASE_DIR). Without chapter_id: chapters list and quality audit. With chapter_id: objectives, prerequisites, notions, worked example, analogy and frequent mistakes, to structure an explanation. ${baseNote}`,
inputSchema: { chapter_id: z.string().optional() },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Namespace chapter lookups by pedagogical base

When two configured export folders reuse a chapter ID, the list response distinguishes them by base name, but the follow-up request accepts only chapter_id and returns the first matching base in sorted order. IDs are only required to be nonempty and are not globally unique, so the corresponding chapter in every later base becomes inaccessible; exercise IDs have the same ambiguity in the other tool. Include a base identifier in both lookup contracts or return composite IDs.

Useful? React with 👍 / 👎.

type Saved = Readonly<{ chapters: readonly BaseChapter[]; report: QualityReport; importedAt: string }>;

function readSaved(): Saved | null {
try { return JSON.parse(window.localStorage.getItem(STORAGE_KEY) ?? "null") as Saved | null; } catch { return null; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject malformed saved base payloads

If this localStorage entry contains syntactically valid but incomplete JSON such as {} or [], the cast returns it as Saved; rendering then calls saved.chapters.map and crashes the whole Learning Studio before the learner can use the removal button. Validate the persisted shape and fall back to null so corrupted or incompatible saved state remains recoverable.

AGENTS.md reference: AGENTS.md:L28-L31

Useful? React with 👍 / 👎.

- chapter-practice: multiple-choice questions built from the learner's
  own course files for each programme chapter, with page citations;
  wrong answers from the same subject (curated confusions first) with
  similar length; extracted terms cleaned of bullets and clause starts.
- elos_course_exercise serves them first, grades them after the
  attempt, logs DERIVED_PRACTICE outside the shared folder and asks
  missed questions again; base exercises remain the fallback.
- mcp:split-base moves answer keys out of the folder the agent browses
  (ELOS_ANSWERS_DIR); an inline key is reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eulogep eulogep changed the title feat(elos): pedagogical base import with quality audit feat(elos): pedagogical base, cited course questions, private answer keys Oct 23, 2026
@eulogep
eulogep merged commit e8c5f39 into main Oct 23, 2026
5 checks passed
@eulogep
eulogep deleted the feat/pedagogical-base branch October 23, 2026 12:05

This branch was successfully deployed

1 active deployment
Preview — f174a4f5 Deployed Oct 23, 2026 by vercel[bot]
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.

1 participant