Accueil par l'IA, sans programme par défaut (ADR 0008)

Le programme d'Atelier devient un programme d'exemple ; State.program peut
être null ; une proposition peut porter un profil.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pierre MARTIN
2026-11-18 00:59:15 +01:00
co-authored by Claude Opus 5.5
parent 285fca57f5
commit 677507771c
14 changed files with 122 additions and 27 deletions
+2 -1
View File
@@ -68,7 +68,7 @@ export const EVENT_VERSION = 1;
* | Envelope<"TrackingModeSet", {key: string, mode: import("./vocabulary.js").TrackingMode|null}>
* | Envelope<"WeightRecorded", {date: string, kg: number}>
* | Envelope<"WeightDeleted", {date: string}>
* | Envelope<"ProgramProposed", {program: import("./program.js").Program, source: import("./vocabulary.js").ProgramSource, reason: string}>
* | Envelope<"ProgramProposed", {program: import("./program.js").Program, source: import("./vocabulary.js").ProgramSource, reason: string, profile?: import("./profile.js").Profile}>
* | Envelope<"ProgramAdopted", {program: import("./program.js").Program, source: import("./vocabulary.js").ProgramSource, reason?: string, proposalId?: string}>
* | Envelope<"ProposalRejected", {proposalId: string, reason?: string}>
* | Envelope<"ProfileUpdated", {profile: import("./profile.js").Profile}>
@@ -127,6 +127,7 @@ const DATA_CHECKS = {
ProgramProposed: (d) =>
!PROGRAM_SOURCES.includes(d.source) ? "source inconnue"
: typeof d.reason !== "string" ? "raison manquante"
: d.profile !== undefined && validateProfile(d.profile).length ? "profil proposé : " + validateProfile(d.profile)[0]
: validateProgram(d.program)[0] ?? null,
ProgramAdopted: (d) =>
!PROGRAM_SOURCES.includes(d.source) ? "source inconnue"