- confirmLevel() declenche desormais l'Agent 5 (Plan) et renvoie le curriculum pret pour CurriculumCard
- Nouveau confirmCurriculum() : confirme le curriculum (immuable), passe la session en "teaching", genere le module 1
- Nouveaux endpoints de sous-interaction module (exercice, indice, debogage, Feynman, completion) et de resultat d'evaluation finale
- routeIncomingMessage() route desormais "planning" (rappel canned), "teaching" (interpretation du message libre via currentAwaiting) et "evaluating" (Agent 7) sans jamais laisser le LLM decider du statut ou de l'UI
- Tests unitaires et de controleur mis a jour en consequence
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
confirmObjective() now chains Agent 2 (mapping) then starts Agent 3
(level) synchronously after Agent 1 confirms - by the time the HTTP
response returns, session.status is already "level_assessment" and
the response carries Agent 3's first question in a new "nextPrompt"
field, to be spoken aloud (never displayed as text).
New endpoints: POST /sessions/:id/level/confirm (runs Agent 4, advances
to "planning") and POST /sessions/:id/level/dispute. routeIncomingMessage
dispatches "level_assessment" sessions to LevelAgent.converse(), same
single entry point used for text and voice.
RouteMessageResponseDto gains levelDone/levelProfile fields: every
response field is a structured, typed signal the frontend's main
process can branch on to decide whether to open a result window - never
an instruction embedded in the LLM's reply text.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add SessionsService#routeIncomingMessage: if the user has an active
non-completed session, route to its agent by status (only
objective_discovery is implemented so far - any other status rejects
with a clear 409 rather than failing silently); otherwise run the
intent router first and only create a session + start Agent 1 when it
detects a learning intent, replying as plain conversational Max
(PERSONALITY_PROMPT only, no session) otherwise.
Exposed as POST /sessions/messages (JWT-protected), the new single
entry point the chat window should call instead of unconditionally
creating a session on every message.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add the sessions module (create/fetch session, Agent 1 conversation and
confirmation endpoints, all JWT-protected) and a reusable OpenRouter
client with DeepSeek/Qwen fallback + backoff on rate-limit/timeout.
Agent 1 runs a Socratic dialogue to capture the 3 mandatory pillars
(subject, professional goal, duration) and enforces two guardrail
levels before any explicit user confirmation: level 1 is hard-coded
length/format rules (objective-guardrails.ts), level 2 is an LLM
coherence score across 3 dimensions (reject below 0.6). The objective
is only persisted to session_objective, and the session only moves to
objective_validated, once the user explicitly confirms via
POST /sessions/:id/objective/confirm - never on the LLM's say-so alone.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>